X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=blender_export.py;h=ca29004d8c743edf498af4c6446d0695b080b556;hb=74174e4357c402824302174845f89b975dba5981;hp=8c1eaace97da36bdd8f3831d403f8521a9c86e8c;hpb=0310bab3c018e23f5516c3e3c3653b844a8106ed;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/blender_export.py b/blender_export.py index 8c1eaac..ca29004 100644 --- a/blender_export.py +++ b/blender_export.py @@ -35,6 +35,7 @@ sr_entity_list = [ ('ent_swspreview', 'Workshop Preview', '', 14 ), ('ent_menuitem', 'Menu Item', '', 15 ), ('ent_worldinfo', 'World Info', '', 16 ), + ('ent_ccmd', 'CCmd', '', 17 ) ] def get_entity_enum_id( alias ): @@ -439,6 +440,11 @@ class ent_worldinfo(Structure): ("timezone",c_float)] #} +class ent_ccmd(Structure): +#{ + _fields_ = [("pstr_command",c_uint32)] +#} + def obj_ent_type( obj ): #{ if obj.type == 'ARMATURE': return 'mdl_armature' @@ -1727,6 +1733,12 @@ def sr_compile( collection ): worldinfo.timezone = obj_data.timezone sr_ent_push( worldinfo ) #} + elif ent_type == 'ent_ccmd':#{ + ccmd = ent_ccmd() + obj_data = obj.SR_data.ent_ccmd[0] + ccmd.pstr_command = sr_compile_string( obj_data.command ) + sr_ent_push( ccmd ) + #} #} #} @@ -1922,6 +1934,7 @@ def sr_compile( collection ): path = F"{folder}{collection.name}.mdl" print( path ) + os.makedirs(os.path.dirname(path),exist_ok=True) fp = open( path, "wb" ) header = mdl_header() header.version = 101 @@ -2676,7 +2689,7 @@ class SR_OBJECT_ENT_VOLUME(bpy.types.PropertyGroup): target: bpy.props.PointerProperty( \ type=bpy.types.Object, name="Target", \ poll=lambda self,obj: sr_filter_ent_type(obj,\ - ['ent_audio','ent_skateshop'])) + ['ent_audio','ent_skateshop','ent_ccmd'])) @staticmethod def sr_inspector( layout, data ): @@ -2961,6 +2974,11 @@ class SR_OBJECT_ENT_WORLD_INFO(bpy.types.PropertyGroup): timezone: bpy.props.FloatProperty(name="Timezone(hrs) (UTC0 +hrs)") #} +class SR_OBJECT_ENT_CCMD(bpy.types.PropertyGroup): +#{ + command: bpy.props.StringProperty(name="Command Line") +#} + class SR_OBJECT_PROPERTIES(bpy.types.PropertyGroup): #{ ent_gate: bpy.props.CollectionProperty(type=SR_OBJECT_ENT_GATE) @@ -2977,6 +2995,7 @@ class SR_OBJECT_PROPERTIES(bpy.types.PropertyGroup): bpy.props.CollectionProperty(type=SR_OBJECT_ENT_WORKSHOP_PREVIEW) ent_menuitem: bpy.props.CollectionProperty(type=SR_OBJECT_ENT_MENU_ITEM) ent_worldinfo: bpy.props.CollectionProperty(type=SR_OBJECT_ENT_WORLD_INFO) + ent_ccmd: bpy.props.CollectionProperty(type=SR_OBJECT_ENT_CCMD) ent_type: bpy.props.EnumProperty( name="Type", @@ -4096,7 +4115,7 @@ classes = [ SR_INTERFACE, SR_MATERIAL_PANEL,\ SR_UL_FONT_VARIANT_LIST,SR_UL_FONT_GLYPH_LIST,\ SR_OBJECT_ENT_FONT,SR_OBJECT_ENT_TRAFFIC,SR_OBJECT_ENT_SKATESHOP,\ SR_OBJECT_ENT_WORKSHOP_PREVIEW,SR_OBJECT_ENT_MENU_ITEM,\ - SR_OBJECT_ENT_WORLD_INFO,\ + SR_OBJECT_ENT_WORLD_INFO,SR_OBJECT_ENT_CCMD,\ \ SR_OBJECT_PROPERTIES, SR_LIGHT_PROPERTIES, SR_BONE_PROPERTIES, SR_MESH_PROPERTIES, SR_MATERIAL_PROPERTIES \