chaos pt 1
[carveJwlIkooP6JGAAIwe30JlM.git] / blender_export.py
index 1646d83a252a3e5f6469ca05a407b080c831e521..51b25dd4ed0d96acfec643f5610c90fe68a81d6a 100644 (file)
@@ -39,12 +39,14 @@ sr_entity_list = [
    ('ent_ccmd',         'CCmd',           '', 17 ),
    ('ent_objective',    'Objective',      '', 18 ),
    ('ent_challenge',    'Challenge',      '', 19 ),
-   ('ent_relay',        'Relay',          '', 20 )
+   ('ent_relay',        'Relay',          '', 20 ),
+   ('ent_miniworld',    'Mini World',     '', 22 )
 ]
 
 MDL_VERSION_NR = 103
 SR_TRIGGERABLE = [ 'ent_audio', 'ent_ccmd', 'ent_gate', 'ent_challenge', \
-                   'ent_relay', 'ent_skateshop', 'ent_objective', 'ent_route' ]
+                   'ent_relay', 'ent_skateshop', 'ent_objective', 'ent_route',\
+                   'ent_miniworld' ]
 
 def get_entity_enum_id( alias ):
 #{
@@ -521,6 +523,14 @@ class ent_cubemap(Structure):#{
                ("placeholder",c_uint32*2)]
 #}
 
+class ent_miniworld(Structure):#{
+   _fields_ = [("transform",mdl_transform),
+               ("pstr_world",c_uint32),
+               ("purpose",c_int32)]
+
+   sr_functions = { 0: 'zone' }
+#}
+
 def obj_ent_type( obj ):
 #{
    if obj.type == 'ARMATURE': return 'mdl_armature'
@@ -1942,6 +1952,14 @@ def sr_compile( collection ):
             cubemap.live = 60
             sr_ent_push( cubemap )
          #}
+         elif ent_type == 'ent_miniworld':#{
+            miniworld = ent_miniworld()
+            obj_data = obj.SR_data.ent_miniworld[0]
+
+            compile_obj_transform( obj, miniworld.transform )
+            miniworld.pstr_world = sr_compile_string( obj_data.world )
+            sr_ent_push( miniworld )
+         #}
       #}
    #}
 
@@ -2578,6 +2596,11 @@ class SR_OBJECT_ENT_ROUTE_ENTRY(bpy.types.PropertyGroup):
                poll=lambda self,obj: sr_filter_ent_type(obj,['ent_gate']))
 #}
 
+class SR_OBJECT_ENT_MINIWORLD(bpy.types.PropertyGroup):
+#{
+   world: bpy.props.StringProperty( name='world UID' )
+#}
+
 class SR_UL_ROUTE_NODE_LIST(bpy.types.UIList):
 #{
    bl_idname = 'SR_UL_ROUTE_NODE_LIST'
@@ -3370,6 +3393,7 @@ class SR_OBJECT_PROPERTIES(bpy.types.PropertyGroup):
    ent_objective: bpy.props.CollectionProperty(type=SR_OBJECT_ENT_OBJECTIVE)
    ent_challenge: bpy.props.CollectionProperty(type=SR_OBJECT_ENT_CHALLENGE)
    ent_relay: bpy.props.CollectionProperty(type=SR_OBJECT_ENT_RELAY)
+   ent_miniworld: bpy.props.CollectionProperty(type=SR_OBJECT_ENT_MINIWORLD)
 
    ent_type: bpy.props.EnumProperty(
       name="Type",
@@ -4597,7 +4621,7 @@ classes = [ SR_INTERFACE, SR_MATERIAL_PANEL,\
             SR_OBJECT_ENT_WORKSHOP_PREVIEW,SR_OBJECT_ENT_MENU_ITEM,\
             SR_OBJECT_ENT_WORLD_INFO,SR_OBJECT_ENT_CCMD,\
             SR_OBJECT_ENT_OBJECTIVE,SR_OBJECT_ENT_CHALLENGE,\
-            SR_OBJECT_ENT_RELAY,\
+            SR_OBJECT_ENT_RELAY,SR_OBJECT_ENT_MINIWORLD,\
             \
             SR_OBJECT_PROPERTIES, SR_LIGHT_PROPERTIES, SR_BONE_PROPERTIES, 
             SR_MESH_PROPERTIES, SR_MATERIAL_PROPERTIES \