X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=blender_export.py;h=07179e71b7c5bc5b684d1b0d82f95a62869feddd;hb=0a33f65eecb5e75cddaefa08d3a5eb1a301d0479;hp=721bba6962b4fd5bc3ecc27d0a984761acde58c1;hpb=dd5c7c307f156768189af84603ec6f1f3b887bb4;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/blender_export.py b/blender_export.py index 721bba6..07179e7 100644 --- a/blender_export.py +++ b/blender_export.py @@ -196,6 +196,14 @@ class ent_route(Structure): ("latest_pass",c_double)] #} +class ent_water(Structure): +#{ + _fields_ = [("transform",mdl_transform), + ("max_dist",c_float), + ("reserved0",c_uint32), + ("reserved1",c_uint32)] +#} + def obj_ent_type( obj ): #{ if obj.type == 'ARMATURE': return 'mdl_armature' @@ -366,9 +374,6 @@ def material_info(mat): _graph_read( from_node_def, from_node, depth+1 ) #} - - # No definition! :( - # TODO: Make a warning for this? #} else:#{ if "default" in link_def:#{ @@ -1078,7 +1083,7 @@ def sr_compile( collection ): elif ent_type == 'ent_route': #{ obj_data = obj.SR_data.ent_route[0] route = ent_route() - route.pstr_name = sr_compile_string( obj_data.alias ) #TODO + route.pstr_name = sr_compile_string( obj_data.alias ) route.checkpoints_start = checkpoint_count route.checkpoints_count = 0 @@ -1142,6 +1147,12 @@ def sr_compile( collection ): rn.co[2] = -obj.location[1] sr_ent_push( rn ) #} + elif ent_type == 'ent_water':#{ + water = ent_water() + compile_obj_transform( obj, water.transform ) + water.max_dist = 0.0 + sr_ent_push( water ) + #} #} #} @@ -1516,7 +1527,7 @@ class SR_MATERIAL_PANEL(bpy.types.Panel): def sr_get_type_enum( scene, context ): #{ items = [('none','None',"")] - mesh_entities=['ent_gate'] + mesh_entities=['ent_gate','ent_water'] point_entities=['ent_spawn','ent_route_node','ent_route'] for e in point_entities: items += [(e,e,'')] @@ -1663,7 +1674,8 @@ class SR_OBJECT_PROPERTIES(bpy.types.PropertyGroup): ('ent_gate','Gate','', 1), ('ent_spawn','Spawn','', 2), ('ent_route_node', 'Route Node', '', 3 ), - ('ent_route', 'Route', '', 4)], + ('ent_route', 'Route', '', 4), + ('ent_water', 'Water Surface', '', 5)], update=sr_on_type_change ) #} @@ -1741,7 +1753,8 @@ class SR_MATERIAL_PROPERTIES(bpy.types.PropertyGroup): ('0','concrete',''), ('1','wood',''), ('2','grass',''), - ('3','tiles','') + ('3','tiles',''), + ('4','metal','') ]) collision: bpy.props.BoolProperty( \