music player, credits
[carveJwlIkooP6JGAAIwe30JlM.git] / blender_export.py
index 293b87cd89e81385131e586cd25a939446ff929f..32e548b4afa0d1583f4171949d0fec4e534b4886 100644 (file)
@@ -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 )
+         #}
       #}
    #}
 
@@ -2677,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 ):
@@ -2748,16 +2760,15 @@ class SR_OBJECT_ENT_AUDIO(bpy.types.PropertyGroup):
       box.prop( data[0], 'flag_loop' )
       box.prop( data[0], 'flag_auto' )
 
+      layout.prop( data[0], 'probability_curve' )
+
       split = layout.split(factor=0.7)
       c = split.column()
       c.label( text='Filepath' )
       c = split.column()
-      c.label( text='Chance (0.1s)' )
-
-      layout.prop( data[0], 'probability_curve' )
-
+      c.label( text='Chance' )
       layout.template_list('SR_UL_AUDIO_LIST', 'Files', \
-                            data[0], 'files', data[0], 'file_index', rows=5)
+                            data[0], 'files', data[0], 'files_index', rows=5)
 
       row = layout.row()
       row.operator( 'skaterift.al_new_entry', text='Add' )
@@ -2962,6 +2973,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)
@@ -2978,6 +2994,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",
@@ -4097,7 +4114,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 \