X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;ds=sidebyside;f=blender_export.py;fp=blender_export.py;h=30b1fe99fbe5f8503caa8c867d8c6c95a61b648d;hb=2c38f7b8f422374c4c46c5b636a7275b61876192;hp=168f023d71f6c65c3009adec6edb046a62391603;hpb=3557b0c25545139b4a5adf0ba44cdac63bf77302;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/blender_export.py b/blender_export.py index 168f023..30b1fe9 100644 --- a/blender_export.py +++ b/blender_export.py @@ -484,7 +484,8 @@ class ent_worldinfo(Structure): ("pstr_author",c_uint32), # unused ("pstr_desc",c_uint32), # unused ("timezone",c_float), - ("pstr_skybox",c_uint32)] + ("pstr_skybox",c_uint32), + ("flags",c_uint32)] #} class ent_ccmd(Structure): @@ -1936,7 +1937,17 @@ def sr_compile( collection ): worldinfo.pstr_name = sr_compile_string( obj_data.name ) worldinfo.pstr_author = sr_compile_string( obj_data.author ) worldinfo.pstr_desc = sr_compile_string( obj_data.desc ) - worldinfo.timezone = obj_data.timezone + + flags = 0x00 + + if obj_data.fix_time:#{ + worldinfo.timezone = obj_data.fixed_time + flags |= 0x1 + #} + else: + worldinfo.timezone = obj_data.timezone + + worldinfo.flags = flags worldinfo.pstr_skybox = sr_compile_string( obj_data.skybox ) sr_ent_push( worldinfo ) #} @@ -3411,8 +3422,24 @@ class SR_OBJECT_ENT_WORLD_INFO(bpy.types.PropertyGroup): name: bpy.props.StringProperty(name="Name") desc: bpy.props.StringProperty(name="Description") author: bpy.props.StringProperty(name="Author") - timezone: bpy.props.FloatProperty(name="Timezone(hrs) (UTC0 +hrs)") skybox: bpy.props.StringProperty(name="Skybox") + + fix_time: bpy.props.BoolProperty(name="Fix Time") + timezone: bpy.props.FloatProperty(name="Timezone(hrs) (UTC0 +hrs)") + fixed_time: bpy.props.FloatProperty(name="Fixed Time (0-1)") + + @staticmethod + def sr_inspector( layout, data ):#{ + layout.prop( data[0], 'name' ) + layout.prop( data[0], 'desc' ) + layout.prop( data[0], 'author' ) + + layout.prop( data[0], 'fix_time' ) + if data[0].fix_time: + layout.prop( data[0], 'fixed_time' ) + else: + layout.prop( data[0], 'timezone' ) + #} #} class SR_OBJECT_ENT_CCMD(bpy.types.PropertyGroup):