Skip to content

Commit

Permalink
Fix KhronosGroup#1484 Vertex group
Browse files Browse the repository at this point in the history
  • Loading branch information
julienduroure committed Nov 5, 2021
1 parent 9373d43 commit e618dc7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 3 additions & 3 deletions addons/io_scene_gltf2/blender/imp/gltf2_blender_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
5 changes: 0 additions & 5 deletions addons/io_scene_gltf2/blender/imp/gltf2_blender_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,6 @@ def setup_skinning(gltf, pynode, obj):

# 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]
Expand Down

0 comments on commit e618dc7

Please sign in to comment.