glTF exporter: Fix exporting skined mesh without armature
Fix exporting skined mesh without armature, when user export selection only, and export skined mesh without selecting the corresponding armature
Introduced in 97bb515d3a
This commit is contained in:
parent
c79b5d9325
commit
0b4844ede9
|
@ -4,7 +4,7 @@
|
|||
bl_info = {
|
||||
'name': 'glTF 2.0 format',
|
||||
'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
|
||||
"version": (3, 4, 46),
|
||||
"version": (3, 4, 47),
|
||||
'blender': (3, 3, 0),
|
||||
'location': 'File > Import-Export',
|
||||
'description': 'Import-Export as glTF 2.0',
|
||||
|
|
|
@ -24,6 +24,10 @@ def gather_skin(armature_uuid, export_settings):
|
|||
:return: a glTF2 skin object
|
||||
"""
|
||||
|
||||
if armature_uuid not in export_settings['vtree'].nodes:
|
||||
# User filtered objects to export, and keep the skined mesh, without keeping the armature
|
||||
return None
|
||||
|
||||
blender_armature_object = export_settings['vtree'].nodes[armature_uuid].blender_object
|
||||
|
||||
if not __filter_skin(blender_armature_object, export_settings):
|
||||
|
|
|
@ -417,7 +417,11 @@ class VExportTree:
|
|||
|
||||
def add_neutral_bones(self):
|
||||
added_armatures = []
|
||||
for n in [n for n in self.nodes.values() if n.armature is not None and n.blender_type == VExportNode.OBJECT and hasattr(self.nodes[n.armature], "need_neutral_bone")]: #all skin meshes objects where neutral bone is needed
|
||||
for n in [n for n in self.nodes.values() if \
|
||||
n.armature is not None and \
|
||||
n.armature in self.nodes and \
|
||||
n.blender_type == VExportNode.OBJECT and \
|
||||
hasattr(self.nodes[n.armature], "need_neutral_bone")]: #all skin meshes objects where neutral bone is needed
|
||||
|
||||
if n.armature not in added_armatures:
|
||||
|
||||
|
|
Loading…
Reference in New Issue