X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=blender_export.py;h=538ed6cdd69168bf32316d683daa90cfbd57deca;hb=c4c762ce6f3bbdcb770bbc42e349aebbc3390d9d;hp=515acd770322a82979dc1391b40b1a81aef3c62a;hpb=2a238d32da833812e837cf38e16a7685c98db5c3;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/blender_export.py b/blender_export.py index 515acd7..538ed6c 100644 --- a/blender_export.py +++ b/blender_export.py @@ -1241,6 +1241,8 @@ def encoder_build_scene_graph( collection ): def _extend( p, n, d ): #{ + nonlocal collection + uid = _new_uid() tree = {} tree["uid"] = uid @@ -1249,7 +1251,7 @@ def encoder_build_scene_graph( collection ): tree["obj"] = n tree["parent"] = p n.cv_data.uid = uid - + # Descend into amature # if n.type == 'ARMATURE': @@ -1257,6 +1259,7 @@ def encoder_build_scene_graph( collection ): tree["bones"] = [None] # None is the root transform tree["ik_count"] = 0 tree["collider_count"] = 0 + tree["compile_animation"] = collection.cv_data.animations # Here also collects some information about constraints, ik and # counts colliders for the armature. @@ -1305,7 +1308,6 @@ def encoder_build_scene_graph( collection ): # for obj1 in n.children: #{ - nonlocal collection for c1 in obj1.users_collection: #{ if c1 == collection: @@ -1667,7 +1669,12 @@ def encoder_compile_armature( node, node_def ): # extra info node_def['anim_start'] = len(animdata) node_def['anim_count'] = 0 - + + if not node_def['compile_animation']: + #{ + return + #} + # Compile anims # if obj.animation_data: @@ -2631,6 +2638,7 @@ class CV_SCENE_SETTINGS(bpy.types.PropertyGroup): class CV_COLLECTION_SETTINGS(bpy.types.PropertyGroup): #{ pack_textures: bpy.props.BoolProperty( name="Pack Textures", default=False ) + animations: bpy.props.BoolProperty( name="Export animation", default=True) #} class CV_MATERIAL_SETTINGS(bpy.types.PropertyGroup): @@ -2857,6 +2865,7 @@ class CV_INTERFACE(bpy.types.Panel): #{ box.label( text=col.name + ".mdl" ) box.prop( col.cv_data, "pack_textures" ) + box.prop( col.cv_data, "animations" ) box.operator( "carve.compile_this" ) #} else: