glTF importer: Fix T92808 change after change on vertex groups data now on mesh

This commit is contained in:
Julien Duroure 2021-11-06 09:58:53 +01:00
parent cd70923356
commit 64fcec250d
Notes: blender-bot 2023-02-14 18:29:17 +01:00
Referenced by issue #92808, Default .glTF importer not importing vertex groups data
3 changed files with 5 additions and 10 deletions

View File

@ -15,8 +15,8 @@
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": (1, 7, 31),
'blender': (2, 91, 0),
"version": (1, 7, 32),
'blender': (3, 0, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
'warning': '',

View File

@ -303,9 +303,9 @@ def do_primitives(gltf, mesh_idx, skin_idx, mesh, ob):
# TODO: this is slow :/
if num_joint_sets:
pyskin = gltf.data.skins[skin_idx]
for i, _ in enumerate(pyskin.joints):
# ob is a temp object, so don't worry about the name.
ob.vertex_groups.new(name='X%d' % i)
for i, node_idx in enumerate(pyskin.joints):
bone = gltf.vnodes[node_idx]
ob.vertex_groups.new(name=bone.blender_bone_name)
vgs = list(ob.vertex_groups)

View File

@ -241,11 +241,6 @@ class BlenderNode():
# Armature/bones should have already been created.
# Create vertex groups for each joint
for node_idx in pyskin.joints:
bone = gltf.vnodes[node_idx]
obj.vertex_groups.new(name=bone.blender_bone_name)
# Create an Armature modifier
first_bone = gltf.vnodes[pyskin.joints[0]]
arma = gltf.vnodes[first_bone.bone_arma]