From 8be863fd852ac29e9af58514e93732a50efe74fb Mon Sep 17 00:00:00 2001 From: Zaher Dirkey Date: Wed, 4 Dec 2024 17:55:09 +0300 Subject: [PATCH] boneObj.palette to boneObj.color.palette --- Onigiri/__init__.py | 12 ++++++------ Onigiri/edit.py | 4 ++-- Onigiri/mod_functions.py | 2 +- Onigiri/motion.py | 12 ++++++------ Onigiri/rigs.py | 30 +++++++++++++++--------------- Onigiri/rigutils.py | 16 ++++++++-------- Onigiri/shifter.py | 6 +++--- Onigiri/sim.py | 4 ++-- Onigiri/utils.py | 2 +- 9 files changed, 44 insertions(+), 44 deletions(-) diff --git a/Onigiri/__init__.py b/Onigiri/__init__.py index 81d395e..1085244 100644 --- a/Onigiri/__init__.py +++ b/Onigiri/__init__.py @@ -40012,7 +40012,7 @@ def execute(self, context): for boneObj in targetObj.pose.bones: inactiveCollection.assign(boneObj) - boneObj.palette = mixer_group_target_inactive_theme + boneObj.color.palette = mixer_group_target_inactive_theme bpy.ops.object.mode_set(mode="OBJECT") @@ -40153,7 +40153,7 @@ def execute(self, context): for boneObj in sourceObj.data.bones: sourceObj.data.collections[mixer_group_source_inactive_name].assign(boneObj) - boneObj.palette = mixer_group_source_inactive_theme + boneObj.color.palette = mixer_group_source_inactive_theme bpy.ops.object.mode_set(mode="OBJECT") sourceObj.select_set(False) @@ -40226,7 +40226,7 @@ def execute(self, context): for bone in sources: targetObj.data.collections[mixer_group_target_inactive_name].assign(bone) - bone.palette = mixer_group_target_active_theme + bone.color.palette = mixer_group_target_active_theme constraints = targetObj.pose.bones[bone].constraints for c in constraints: @@ -40379,7 +40379,7 @@ def execute(self, context): sourceObj = obj[self.name] targetObj.data.collections[mixer_group_source_active_name].assign(targetObj.pose.bones[bone]) - targetObj.pose.bones[bone].palette = mixer_group_source_active_theme + targetObj.pose.bones[bone].color.palette = mixer_group_source_active_theme obj[self.name].data.collections[mixer_group_source_active_name].assign(obj[self.name].pose.bones[bone]) @@ -40708,7 +40708,7 @@ def execute(self, context): for bone in bone_names: for sourceObj in oni_mixer["sources"]: sourceObj.data.collections[mixer_group_source_inactive_name].assign(bone) - #bone.palette = mixer_group_source_inactive_theme + #bone.color.palette = mixer_group_source_inactive_theme targetObj.data.collections[mixer_group_target_inactive_name].assign(bone) @@ -61682,7 +61682,7 @@ def execute(self, context): group_base = sim.props["group_base"] base_collection.assign(boneObj) - boneObj.palette = sim.props["theme_base"] + boneObj.color.palette = sim.props["theme_base"] if disable_armatures == True: print("Disabling armature modifiers") diff --git a/Onigiri/edit.py b/Onigiri/edit.py index 51b28b7..ae62371 100644 --- a/Onigiri/edit.py +++ b/Onigiri/edit.py @@ -96,13 +96,13 @@ def auto_weight_colors(bone="", state=""): boneObj = bpy.data.objects[arm].pose.bones[bone] boneCollection.assign(boneObj) - boneObj.palette = md.cc_rename_selected_color + boneObj.color.palette = md.cc_rename_selected_color if bone in ccp["remap_stored"]["reskin"]: for child in ccp["remap_stored"]["reskin"][bone]: boneObj = bpy.data.objects[arm].pose.bones[child] bpy.data.objects[arm].data.collections[md.cc_reskin_selected_name].assign(boneObj) - boneObj.palette = md.cc_reskin_selected_color + boneObj.color.palette = md.cc_reskin_selected_color elif state == "reset": bpy.data.objects[arm].data.collections[md.cc_rename_group].assign(bpy.data.objects[arm].pose.bones[bone]) diff --git a/Onigiri/mod_functions.py b/Onigiri/mod_functions.py index 33de4ca..b9ce80b 100644 --- a/Onigiri/mod_functions.py +++ b/Onigiri/mod_functions.py @@ -1181,7 +1181,7 @@ def add_bone_to_group(armature="", bone="", group="", theme=""): boneObj = bpy.data.objects[armature].pose.bones[bone] bpy.data.objects[armature].data.collections[group].assign(boneObj) if theme != "": - boneObj.palette = theme + boneObj.color.palette = theme bpy.ops.object.mode_set(mode="OBJECT") bpy.ops.object.select_all(action="DESELECT") diff --git a/Onigiri/motion.py b/Onigiri/motion.py index 6b778ab..03d53a6 100644 --- a/Onigiri/motion.py +++ b/Onigiri/motion.py @@ -1146,9 +1146,9 @@ def update_map(inRig=None): try: inRig.data.collections[director_group].assign(inRig.data.bones[rename_in_bone]) - inRig.data.bones[rename_in_bone].palette = props["themes"]["director"] + inRig.data.bones[rename_in_bone].color.palette = props["themes"]["director"] outRig.data.collections[actor_group].assign(outRig.data.bones[rename_out_bone]) - outRig.data.bones[rename_out_bone].palette = props["themes"]["actor"] + outRig.data.bones[rename_out_bone].color.palette = props["themes"]["actor"] except: bad_group = True pass @@ -1159,7 +1159,7 @@ def update_map(inRig=None): if bone not in inRig.data.bones: continue inRig.data.collections[reskin_group].assign(inRig.data.bones[bone]) - inRig.data.bones[bone].palette = props["themes"]["reskin"] + inRig.data.bones[bone].color.palette = props["themes"]["reskin"] utils.set_state(state) @@ -1192,10 +1192,10 @@ def apply_map(inRig=None, outRig=None): actor_group = props["groups"]["actor"] inRig.data.collections[director_group].assign(inRig.data.bones[rename_in_bone]) - inRig.data.bones[rename_in_bone].palette = props["themes"]["director"] + inRig.data.bones[rename_in_bone].color.palette = props["themes"]["director"] outRig.data.collections[actor_group].assign(outRig.data.bones[rename_out_bone]) - outRig.data.bones[rename_out_bone].palette = props["themes"]["actor"] + outRig.data.bones[rename_out_bone].color.palette = props["themes"]["actor"] reskin_bones = reskin.get(rename_in_bone, []) reskin_group = props["groups"]["reskin"] @@ -1205,6 +1205,6 @@ def apply_map(inRig=None, outRig=None): if bone not in inRig.pose.bones: continue inRig.data.collections[reskin_group].assign(inRig.data.bones[bone]) - inRig.data.bones[bone].palette = props["themes"]["reskin"] + inRig.data.bones[bone].color.palette = props["themes"]["reskin"] return True diff --git a/Onigiri/rigs.py b/Onigiri/rigs.py index 6c0fa6d..777d927 100644 --- a/Onigiri/rigs.py +++ b/Onigiri/rigs.py @@ -156,10 +156,10 @@ def create_rig(target="default"): boneObj = obj[arm].pose.bones[bone] if rig_target[bone]["type"] == "bone": obj[arm].data.collections[mod_data.rig_group_mbones].assign(boneObj) - boneObj.palette = mod_data.rig_group_mtheme + boneObj.color.palette = mod_data.rig_group_mtheme else: obj[arm].data.collections[mod_data.rig_group_vbones].assign(boneObj) - boneObj.palette = mod_data.rig_group_vtheme + boneObj.color.palette = mod_data.rig_group_vtheme bpy.ops.object.mode_set(mode="OBJECT") @@ -1681,7 +1681,7 @@ def attach_slave_rig( for boneObj in slaveObj.pose.bones: colObj.assign(boneObj) - boneObj.palette = mod_data.slave_group_theme + boneObj.color.palette = mod_data.slave_group_theme lname = "ONI Copy Loc" rname = "ONI Copy Rot" @@ -1790,7 +1790,7 @@ def attach_proxy_rig(armature=None, clean=False): for boneObj in glueObj.pose.bones: glueCollection.assign(boneObj) - boneObj.palette = "THEME07" + boneObj.color.palette = "THEME07" bpy.ops.object.mode_set(mode="OBJECT") @@ -1998,10 +1998,10 @@ def build_sl_rig(rig_class="pos", store=True, rotate=False): boneObj = obj[arm].pose.bones[bone] if skel.avatar_skeleton[bone]["type"] == "bone": obj[arm].data.collections[mod_data.rig_group_mbones].assign(boneObj) - boneObj.palette = mod_data.rig_group_mtheme + boneObj.color.palette = mod_data.rig_group_mtheme else: obj[arm].data.collections[mod_data.rig_group_vbones].assign(boneObj) - boneObj.palette = mod_data.rig_group_vtheme + boneObj.color.palette = mod_data.rig_group_vtheme bpy.ops.object.mode_set(mode="OBJECT") @@ -2161,17 +2161,17 @@ def build_rig(rig_class="pos", rotate=False, connect=True): boneObj = obj[arm].pose.bones[bone] if skel.avatar_skeleton[bone]["type"] == "bone": obj[arm].data.collections[mod_data.rig_group_mbones].assign(boneObj) - boneObj.palette = mod_data.rig_group_mtheme + boneObj.color.palette = mod_data.rig_group_mtheme elif skel.avatar_skeleton[bone]["type"] == "attachment": if " " in bone: obj[arm].data.collections[mod_data.rig_group_nbones].assign(boneObj) - boneObj.palette = mod_data.rig_group_ntheme + boneObj.color.palette = mod_data.rig_group_ntheme else: obj[arm].data.collections[mod_data.rig_group_abones].assign(boneObj) - boneObj.palette = mod_data.rig_group_atheme + boneObj.color.palette = mod_data.rig_group_atheme else: obj[arm].data.collections[mod_data.rig_group_vbones].assign(boneObj) - boneObj.palette = mod_data.rig_group_vtheme + boneObj.color.palette = mod_data.rig_group_vtheme bpy.ops.object.mode_set(mode="OBJECT") @@ -2696,7 +2696,7 @@ def freeze(armature=None, bones=[], transforms=True, influence=1): for boneObj in glueObj.pose.bones: glueCollection.assign(boneObj) - boneObj.palette = "THEME07" + boneObj.color.palette = "THEME07" bpy.ops.object.mode_set(mode="OBJECT") @@ -3453,17 +3453,17 @@ def set_bone_groups(armObj): continue if skel.avatar_skeleton[bone]["type"] == "bone": armObj.data.collections[mod_data.rig_group_mbones].assign(boneObj) - boneObj.palette = mod_data.rig_group_mtheme + boneObj.color.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(boneObj) - boneObj.palette = mod_data.rig_group_ntheme + boneObj.color.palette = mod_data.rig_group_ntheme else: armObj.data.collections[mod_data.rig_group_abones].assign(boneObj) - boneObj.palette = mod_data.rig_group_atheme + boneObj.color.palette = mod_data.rig_group_atheme else: armObj.data.collections[mod_data.rig_group_vbones].assign(boneObj) - boneObj.palette = mod_data.rig_group_vtheme + boneObj.color.palette = mod_data.rig_group_vtheme bpy.ops.object.mode_set(mode="OBJECT") diff --git a/Onigiri/rigutils.py b/Onigiri/rigutils.py index 94730d9..aaaf843 100644 --- a/Onigiri/rigutils.py +++ b/Onigiri/rigutils.py @@ -1787,7 +1787,7 @@ def attach_slave_rig( for boneObj in slaveObj.data.bones: slaveCollection.assign(boneObj) - boneObj.palette = mod_data.slave_group_theme + boneObj.color.palette = mod_data.slave_group_theme lname = "ONI Copy Loc" rname = "ONI Copy Rot" @@ -2109,10 +2109,10 @@ def build_sl_rig(rig_class="pos", store=True, rotate=False): for bone in skel.avatar_skeleton: if skel.avatar_skeleton[bone]["type"] == "bone": obj[arm].data.collections[mod_data.rig_group_mbones].assign(bone) - bone.palette = mod_data.rig_group_mtheme + bone.color.palette = mod_data.rig_group_mtheme else: obj[arm].data.collections[mod_data.rig_group_vbones].assign(bone) - bone.palette = mod_data.rig_group_vtheme + bone.color.palette = mod_data.rig_group_vtheme bpy.ops.object.mode_set(mode="OBJECT") @@ -2826,7 +2826,7 @@ def freeze(armature=None, bones=[], transforms=True, influence=1): for boneObj in glueObj.data.bones: glueCollection.assign(boneObj) - boneObj.palette = "THEME07" + boneObj.color.palette = "THEME07" bpy.ops.object.mode_set(mode="OBJECT") @@ -3598,17 +3598,17 @@ def set_bone_groups(armObj): boneObj = armObj.data.bones[bone] if skel.avatar_skeleton[bone]["type"] == "bone": armObj.data.collections[mod_data.rig_group_mbones].assign(boneObj) - boneObj.palette = mod_data.rig_group_mtheme + boneObj.color.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(boneObj) - boneObj.palette = mod_data.rig_group_ntheme + boneObj.color.palette = mod_data.rig_group_ntheme else: armObj.data.collections[mod_data.rig_group_abones].assign(boneObj) - boneObj.palette = mod_data.rig_group_atheme + boneObj.color.palette = mod_data.rig_group_atheme else: armObj.data.collections[mod_data.rig_group_vbones].assign(boneObj) - boneObj.palette = mod_data.rig_group_vtheme + boneObj.color.palette = mod_data.rig_group_vtheme bpy.ops.object.mode_set(mode="OBJECT") diff --git a/Onigiri/shifter.py b/Onigiri/shifter.py index fd64322..3e2d74f 100644 --- a/Onigiri/shifter.py +++ b/Onigiri/shifter.py @@ -113,7 +113,7 @@ def snap(sarm=None, tarms=[], type="rig", source=[]): for boneObj in glueObj.pose.bones: glueCollection.assign(boneObj) - boneObj.palette = "THEME07" + boneObj.color.palette = "THEME07" bpy.ops.object.mode_set(mode="EDIT") for boneObj in glueObj.data.edit_bones: @@ -485,7 +485,7 @@ def morph( for boneObj in glueObj.pose.bones: glueCollection.assign(boneObj) - boneObj.palette = "THEME07" + boneObj.color.palette = "THEME07" bpy.ops.object.mode_set(mode="EDIT") for boneObj in glueObj.data.edit_bones: @@ -817,7 +817,7 @@ def freeze(sarm): for boneObj in glueObj.pose.bones: glueCollection.assign(boneObj) - boneObj.palette = "THEME01" + boneObj.color.palette = "THEME01" bpy.ops.object.mode_set(mode="OBJECT") diff --git a/Onigiri/sim.py b/Onigiri/sim.py index 8b2d01c..be3792e 100644 --- a/Onigiri/sim.py +++ b/Onigiri/sim.py @@ -377,7 +377,7 @@ def build_bone(actor=None, director=None, head=None, tail=None, vertices=[]): group_base = props["group_base"] colObj.assign(boneObj) - boneObj.palette = props["theme_base"] + boneObj.color.palette = props["theme_base"] utils.set_state(new_state) @@ -671,6 +671,6 @@ def vertex_constraint( group_base = sim.props["group_base"] colObj.assign(boneObj) - boneObj.palette = props["theme_base"] + boneObj.color.palette = props["theme_base"] return True diff --git a/Onigiri/utils.py b/Onigiri/utils.py index e42dd82..f6ffd7b 100644 --- a/Onigiri/utils.py +++ b/Onigiri/utils.py @@ -1900,7 +1900,7 @@ def vertex_constraint( coll = armObj.data.collections.new(props["constraint_group_base"]) coll.assign(boneObj) - boneObj.palette = props["constraint_theme_base"] + boneObj.color.palette = props["constraint_theme_base"] group_base = sim.props["constraint_group_base"] return True