('ent_challenge', 'Challenge', '', 18 )
]
+MDL_VERSION_NR = 102
+
def get_entity_enum_id( alias ):
#{
for et in sr_entity_list:#{
class ent_gate(Structure):
#{
- _fields_ = [("type",c_uint32),
+ _fields_ = [("flags",c_uint32),
("target", c_uint32),
("key",c_uint32),
("dimensions", c_float*3),
("_anonymous_union",version_refcount_union),
("timing_time",c_double),
("routes",c_uint16*4),
- ("route_count",c_uint8)]
+ ("route_count",c_uint8),
+ ("submesh_start",c_uint32), # v102+
+ ("submesh_count",c_uint32), # v102+ (can be 0)
+ ]
#}
class ent_route_node(Structure):
if ent_type == 'ent_font_variant': continue
if ent_type == 'ent_menuitem': continue
if ent_type == 'ent_challenge': continue
+
+ #TODO: This is messy.
+ if ent_type == 'ent_gate':#{
+ obj_data = obj.SR_data.ent_gate[0]
+ if obj_data.custom: continue
+ #}
#--------------------------
print( F'[SR] {i: 3}/{mesh_count} {obj.name:<40}', end='\r' )
obj_data = obj.SR_data.ent_gate[0]
mesh_data = obj.data.SR_data.ent_gate[0]
+ flags = 0x0000
+
if obj_data.tipo == 'default':#{
if obj_data.target:#{
gate.target = sr_compile.entity_ids[obj_data.target.name]
- gate.type = 1
+ flags |= 0x0001
#}
#}
elif obj_data.tipo == 'nonlocal':#{
gate.target = 0
gate.key = sr_compile_string(obj_data.key)
- gate.type = 2
+ flags |= 0x0002
+ #}
+
+ if obj_data.flip: flags |= 0x0004
+ if obj_data.custom:#{
+ flags |= 0x0008
+ gate.submesh_start, gate.submesh_count, _ = \
+ sr_compile_mesh_internal( obj )
#}
- else: gate.type = 0
+ gate.flags = flags
gate.dimensions[0] = mesh_data.dimensions[0]
gate.dimensions[1] = mesh_data.dimensions[1]
os.makedirs(os.path.dirname(path),exist_ok=True)
fp = open( path, "wb" )
header = mdl_header()
- header.version = 101
+ header.version = MDL_VERSION_NR
sr_array_title( header.arrays, \
'index', len(file_array_instructions), \
sizeof(mdl_array), header_size )
key: bpy.props.StringProperty()
tipo: bpy.props.EnumProperty(items=(('default', 'Default', ""),
- ('nonlocal', 'Non-Local', ""),))
+ ('nonlocal', 'Non-Local', "")))
+
+ flip: bpy.props.BoolProperty( name="Flip exit", default=False )
+ custom: bpy.props.BoolProperty( name="Mesh is surface", default=False )
@staticmethod
def sr_inspector( layout, data ):
if data[0].tipo == 'default': box.prop( data[0], 'target' )
elif data[0].tipo == 'nonlocal': box.prop( data[0], 'key' )
+
+ flags = box.box()
+ flags.prop( data[0], 'flip' )
+ flags.prop( data[0], 'custom' )
#}
#}