Skip to content

Commit

Permalink
fix object bones armObj.data.bones[bone]
Browse files Browse the repository at this point in the history
  • Loading branch information
zaher committed Dec 4, 2024
1 parent 6c2817c commit fef1458
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Onigiri/rigutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3595,19 +3595,20 @@ def set_bone_groups(armObj):
for bone in skel.avatar_skeleton:
if bone not in armObj.data.bones:
continue
boneObj = armObj.data.bones[bone]
if skel.avatar_skeleton[bone]["type"] == "bone":
armObj.data.collections[mod_data.rig_group_mbones].assign(bone)
bone.palette = mod_data.rig_group_mtheme
armObj.data.collections[mod_data.rig_group_mbones].assign(boneObj)
boneObj.palette = mod_data.rig_group_mtheme
elif skel.avatar_skeleton[bone]["type"] == "attachment":
if " " in bone:
armObj.data.collections[mod_data.rig_group_nbones].assign(bone)
bone.palette = mod_data.rig_group_ntheme
armObj.data.collections[mod_data.rig_group_nbones].assign(boneObj)
boneObj.palette = mod_data.rig_group_ntheme
else:
armObj.data.collections[mod_data.rig_group_abones].assign(bone)
bone.palette = mod_data.rig_group_atheme
armObj.data.collections[mod_data.rig_group_abones].assign(boneObj)
boneObj.palette = mod_data.rig_group_atheme
else:
armObj.data.collections[mod_data.rig_group_vbones].assign(bone)
bone.palette = mod_data.rig_group_vtheme
armObj.data.collections[mod_data.rig_group_vbones].assign(boneObj)
boneObj.palette = mod_data.rig_group_vtheme

bpy.ops.object.mode_set(mode="OBJECT")

Expand Down

0 comments on commit fef1458

Please sign in to comment.