From 0de4e4ac89f81125678957c9ce21e413ebfa98d3 Mon Sep 17 00:00:00 2001 From: Bastien Montagne <montagne29@wanadoo.fr> Date: Thu, 17 Apr 2014 10:26:47 +0200 Subject: [PATCH] FBX: After talk with Campbell, remove "simplify skinning" option. This kind of target app compatibility feature is not well suited to an export addon, would better be in a dedicated pre-export tool. --- io_scene_fbx/__init__.py | 10 ---------- io_scene_fbx/export_fbx_bin.py | 20 ++------------------ 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py index 8d29b3a3e..0631c036f 100644 --- a/io_scene_fbx/__init__.py +++ b/io_scene_fbx/__init__.py @@ -220,12 +220,6 @@ class ExportFBX(bpy.types.Operator, ExportHelper): description="Apply modifiers to mesh objects (except Armature ones!)", default=True, ) - # 7.4 only - use_simplify_skinning = BoolProperty( - name="Simplify Skinning", - description="Many game engines do not support more than four bones per vertex, select four most important ones", - default=True, - ) mesh_smooth_type = EnumProperty( name="Smoothing", items=(('OFF', "Off", "Don't write smoothing"), @@ -354,10 +348,6 @@ class ExportFBX(bpy.types.Operator, ExportHelper): layout.separator() layout.prop(self, "object_types") layout.prop(self, "use_mesh_modifiers") - if is_74bin: - sub = layout.column() - sub.enabled = ({'ARMATURE', 'MESH'} <= self.object_types) - sub.prop(self, "use_simplify_skinning") layout.prop(self, "mesh_smooth_type") layout.prop(self, "use_mesh_edges") layout.prop(self, "use_tspace") diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py index e06c8da80..ddc9398f7 100644 --- a/io_scene_fbx/export_fbx_bin.py +++ b/io_scene_fbx/export_fbx_bin.py @@ -1850,8 +1850,6 @@ def fbx_data_armature_elements(root, armature, scene_data): elem_data_single_float64(fbx_skin, b"Link_DeformAcuracy", 50.0) # Only vague idea what it is... # Pre-process vertex weights (also to check vertices assigned ot more than four bones). - is_complex_skinning = False - simplify_skinning = scene_data.settings.use_simplify_skinning bo_vg_idx = {bo.name: obj.vertex_groups[bo.name].index for bo in clusters.keys()} valid_idxs = set(bo_vg_idx.values()) vgroups = {vg.index: OrderedDict() for vg in obj.vertex_groups} @@ -1859,22 +1857,9 @@ def fbx_data_armature_elements(root, armature, scene_data): key=lambda e: e[1], reverse=True) for v in me.vertices) for idx, vgs in enumerate(verts_vgroups): - if len(vgs) > 4: - is_complex_skinning = True - if simplify_skinning: - vgs[:] = vgs[:4] for vg_idx, w in vgs: vgroups[vg_idx][idx] = w - if is_complex_skinning: - report = scene_data.settings.report - if simplify_skinning: - report({'WARNING'}, "Some vertices were assigned to more than four bones, " - "only the four most significant weights were kept") - else: - report({'WARNING'}, "Some vertices are assigned to more than four bones, " - "this is usually not supported by game engines") - for bo, clstr_key in clusters.items(): # Find which vertices are affected by this bone/vgroup pair, and matching weights. vg_idx = bo_vg_idx[bo.name] @@ -2916,7 +2901,7 @@ FBXSettingsMedia = namedtuple("FBXSettingsMedia", ( FBXSettings = namedtuple("FBXSettings", ( "report", "to_axes", "global_matrix", "global_scale", "bake_space_transform", "global_matrix_inv", "global_matrix_inv_transposed", - "context_objects", "object_types", "use_mesh_modifiers", "use_simplify_skinning", + "context_objects", "object_types", "use_mesh_modifiers", "mesh_smooth_type", "use_mesh_edges", "use_tspace", "use_armature_deform_only", "bake_anim", "bake_anim_use_nla_strips", "bake_anim_step", "bake_anim_simplify_factor", "use_metadata", "media_settings", "use_custom_properties", @@ -2931,7 +2916,6 @@ def save_single(operator, scene, filepath="", context_objects=None, object_types=None, use_mesh_modifiers=True, - use_simplify_skinning=True, mesh_smooth_type='FACE', bake_anim=True, bake_anim_use_nla_strips=True, @@ -2975,7 +2959,7 @@ def save_single(operator, scene, filepath="", settings = FBXSettings( operator.report, (axis_up, axis_forward), global_matrix, global_scale, bake_space_transform, global_matrix_inv, global_matrix_inv_transposed, - context_objects, object_types, use_mesh_modifiers, use_simplify_skinning, + context_objects, object_types, use_mesh_modifiers, mesh_smooth_type, use_mesh_edges, use_tspace, False, bake_anim, bake_anim_use_nla_strips, bake_anim_step, bake_anim_simplify_factor, False, media_settings, use_custom_properties, -- GitLab