diff options
Diffstat (limited to 'rigify')
75 files changed, 382 insertions, 1066 deletions
diff --git a/rigify/__init__.py b/rigify/__init__.py index 50922528..4f31459b 100644 --- a/rigify/__init__.py +++ b/rigify/__init__.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -154,7 +138,7 @@ class RigifyFeatureSets(bpy.types.PropertyGroup): context.preferences.addons[__package__].preferences.update_external_rigs() enabled: bpy.props.BoolProperty( - name = "Enabled", + name = "Enabled", description = "Whether this feature-set is registered or not", update = toggle_featureset, default = True @@ -193,7 +177,7 @@ class RigifyPreferences(AddonPreferences): module_names = feature_set_list.get_installed_modules_names() - # If there is a feature set preferences entry with no corresponding + # If there is a feature set preferences entry with no corresponding # installed module, user must've manually removed it from the filesystem, # so let's remove such entries. to_delete = [ i for i, fs in enumerate(feature_set_prefs) if fs.module_name not in module_names ] diff --git a/rigify/base_generate.py b/rigify/base_generate.py index 7bdb8b0e..81de462a 100644 --- a/rigify/base_generate.py +++ b/rigify/base_generate.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/base_rig.py b/rigify/base_rig.py index 87c89c17..b1c911cb 100644 --- a/rigify/base_rig.py +++ b/rigify/base_rig.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/feature_set_list.py b/rigify/feature_set_list.py index cb46f5c6..819b2c0e 100644 --- a/rigify/feature_set_list.py +++ b/rigify/feature_set_list.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later from typing import List diff --git a/rigify/feature_sets/__init__.py b/rigify/feature_sets/__init__.py index e9981d52..91f1cdf7 100644 --- a/rigify/feature_sets/__init__.py +++ b/rigify/feature_sets/__init__.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # Redirect the module loader to the user scripts directory. diff --git a/rigify/generate.py b/rigify/generate.py index a674ade4..0d99b708 100644 --- a/rigify/generate.py +++ b/rigify/generate.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -146,7 +130,7 @@ class Generator(base_generate.BaseGenerator): if old_collection: # Rename the collection old_collection.name = wgts_group_name - + return old_collection def ensure_widget_collection(self): diff --git a/rigify/metarig_menu.py b/rigify/metarig_menu.py index 7a48df44..f6dda026 100644 --- a/rigify/metarig_menu.py +++ b/rigify/metarig_menu.py @@ -1,20 +1,4 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ##### END GPL LICENSE BLOCK ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/metarigs/Animals/bird.py b/rigify/metarigs/Animals/bird.py index eee6b38b..e1897202 100644 --- a/rigify/metarigs/Animals/bird.py +++ b/rigify/metarigs/Animals/bird.py @@ -1,5 +1,6 @@ -import bpy +# SPDX-License-Identifier: GPL-2.0-or-later +import bpy from mathutils import Color @@ -788,7 +789,7 @@ def create(obj): except AttributeError: pass pbone = obj.pose.bones[bones['thigh.L']] - pbone.rigify_type = 'limbs.super_limb' + pbone.rigify_type = 'limbs.paw' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False @@ -800,6 +801,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -808,7 +813,7 @@ def create(obj): except AttributeError: pass pbone = obj.pose.bones[bones['thigh.R']] - pbone.rigify_type = 'limbs.super_limb' + pbone.rigify_type = 'limbs.paw' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False @@ -820,6 +825,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass diff --git a/rigify/metarigs/Animals/cat.py b/rigify/metarigs/Animals/cat.py index 66321116..a6fd40ab 100644 --- a/rigify/metarigs/Animals/cat.py +++ b/rigify/metarigs/Animals/cat.py @@ -1,5 +1,6 @@ -import bpy +# SPDX-License-Identifier: GPL-2.0-or-later +import bpy from mathutils import Color @@ -1485,7 +1486,7 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] pbone = obj.pose.bones[bones['thigh.L']] - pbone.rigify_type = 'limbs.super_limb' + pbone.rigify_type = 'limbs.rear_paw' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False @@ -1497,6 +1498,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -1509,7 +1514,7 @@ def create(obj): except AttributeError: pass pbone = obj.pose.bones[bones['thigh.R']] - pbone.rigify_type = 'limbs.super_limb' + pbone.rigify_type = 'limbs.rear_paw' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False @@ -1521,6 +1526,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -1653,7 +1662,7 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] pbone = obj.pose.bones[bones['upper_arm.L']] - pbone.rigify_type = 'limbs.super_limb' + pbone.rigify_type = 'limbs.front_paw' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False @@ -1665,6 +1674,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -1673,7 +1686,7 @@ def create(obj): except AttributeError: pass pbone = obj.pose.bones[bones['upper_arm.R']] - pbone.rigify_type = 'limbs.super_limb' + pbone.rigify_type = 'limbs.front_paw' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False @@ -1689,6 +1702,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.limb_type = "paw" except AttributeError: pass diff --git a/rigify/metarigs/Animals/horse.py b/rigify/metarigs/Animals/horse.py index 1cdd4feb..cd393c5c 100644 --- a/rigify/metarigs/Animals/horse.py +++ b/rigify/metarigs/Animals/horse.py @@ -1,5 +1,6 @@ -import bpy +# SPDX-License-Identifier: GPL-2.0-or-later +import bpy from mathutils import Color @@ -805,6 +806,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.bbones = 10 except AttributeError: pass @@ -837,6 +842,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.bbones = 10 except AttributeError: pass @@ -1005,6 +1014,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -1029,6 +1042,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass diff --git a/rigify/metarigs/Animals/shark.py b/rigify/metarigs/Animals/shark.py index 8b72a965..6559fb4a 100644 --- a/rigify/metarigs/Animals/shark.py +++ b/rigify/metarigs/Animals/shark.py @@ -1,5 +1,6 @@ -import bpy +# SPDX-License-Identifier: GPL-2.0-or-later +import bpy from mathutils import Color diff --git a/rigify/metarigs/Animals/wolf.py b/rigify/metarigs/Animals/wolf.py index 775f2973..a2ade910 100644 --- a/rigify/metarigs/Animals/wolf.py +++ b/rigify/metarigs/Animals/wolf.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy @@ -1609,6 +1611,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -1636,6 +1642,10 @@ def create(obj): pbone.rigify_parameters.limb_type = "paw" except AttributeError: pass + try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass pbone = obj.pose.bones[bones['spine.001']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) @@ -1801,6 +1811,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -1821,6 +1835,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass diff --git a/rigify/metarigs/Basic/basic_human.py b/rigify/metarigs/Basic/basic_human.py index 1c584325..57b2d236 100644 --- a/rigify/metarigs/Basic/basic_human.py +++ b/rigify/metarigs/Basic/basic_human.py @@ -1,5 +1,6 @@ -import bpy +# SPDX-License-Identifier: GPL-2.0-or-later +import bpy from mathutils import Color @@ -434,6 +435,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -465,6 +470,10 @@ def create(obj): pbone.rigify_parameters.extra_ik_toe = True except AttributeError: pass + try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass pbone = obj.pose.bones[bones['spine.002']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) @@ -626,6 +635,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_layers = [False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -642,6 +655,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_layers = [False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass diff --git a/rigify/metarigs/Basic/basic_quadruped.py b/rigify/metarigs/Basic/basic_quadruped.py index 5282df25..5575e8c4 100644 --- a/rigify/metarigs/Basic/basic_quadruped.py +++ b/rigify/metarigs/Basic/basic_quadruped.py @@ -1,5 +1,6 @@ -import bpy +# SPDX-License-Identifier: GPL-2.0-or-later +import bpy from mathutils import Color @@ -505,7 +506,7 @@ def create(obj): except AttributeError: pass pbone = obj.pose.bones[bones['thigh.L']] - pbone.rigify_type = 'limbs.super_limb' + pbone.rigify_type = 'limbs.rear_paw' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False @@ -517,6 +518,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -525,7 +530,7 @@ def create(obj): except AttributeError: pass pbone = obj.pose.bones[bones['thigh.R']] - pbone.rigify_type = 'limbs.super_limb' + pbone.rigify_type = 'limbs.rear_paw' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False @@ -544,6 +549,10 @@ def create(obj): pbone.rigify_parameters.limb_type = "paw" except AttributeError: pass + try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass pbone = obj.pose.bones[bones['spine.007']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) @@ -681,7 +690,7 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] pbone = obj.pose.bones[bones['front_thigh.L']] - pbone.rigify_type = 'limbs.super_limb' + pbone.rigify_type = 'limbs.front_paw' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False @@ -693,6 +702,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -701,7 +714,7 @@ def create(obj): except AttributeError: pass pbone = obj.pose.bones[bones['front_thigh.R']] - pbone.rigify_type = 'limbs.super_limb' + pbone.rigify_type = 'limbs.front_paw' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False @@ -713,6 +726,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass diff --git a/rigify/metarigs/human.py b/rigify/metarigs/human.py index 5ff61677..75a089ab 100644 --- a/rigify/metarigs/human.py +++ b/rigify/metarigs/human.py @@ -1,5 +1,6 @@ -import bpy +# SPDX-License-Identifier: GPL-2.0-or-later +import bpy from mathutils import Color @@ -1344,6 +1345,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -1375,6 +1380,10 @@ def create(obj): pbone.rigify_parameters.extra_ik_toe = True except AttributeError: pass + try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass pbone = obj.pose.bones[bones['spine.002']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) @@ -1536,6 +1545,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_layers = [False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -1552,6 +1565,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_layers = [False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -1988,6 +2005,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_extra_layers = True except AttributeError: pass @@ -2004,6 +2025,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_extra_layers = True except AttributeError: pass @@ -2020,6 +2045,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_extra_layers = True except AttributeError: pass @@ -2036,6 +2065,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_extra_layers = True except AttributeError: pass @@ -2052,6 +2085,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_extra_layers = True except AttributeError: pass @@ -2068,6 +2105,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_extra_layers = True except AttributeError: pass @@ -2084,6 +2125,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_extra_layers = True except AttributeError: pass @@ -2100,6 +2145,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_extra_layers = True except AttributeError: pass @@ -2116,6 +2165,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_extra_layers = True except AttributeError: pass @@ -2132,6 +2185,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_extra_layers = True except AttributeError: pass diff --git a/rigify/operators/__init__.py b/rigify/operators/__init__.py index 6c96f908..bda38619 100644 --- a/rigify/operators/__init__.py +++ b/rigify/operators/__init__.py @@ -1,20 +1,4 @@ -# ====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/operators/copy_mirror_parameters.py b/rigify/operators/copy_mirror_parameters.py index a844f8da..982887b2 100644 --- a/rigify/operators/copy_mirror_parameters.py +++ b/rigify/operators/copy_mirror_parameters.py @@ -1,20 +1,4 @@ -# ====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/operators/upgrade_face.py b/rigify/operators/upgrade_face.py index 1dc3cf2c..17953802 100644 --- a/rigify/operators/upgrade_face.py +++ b/rigify/operators/upgrade_face.py @@ -1,20 +1,4 @@ -# ====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -435,7 +419,7 @@ class POSE_OT_rigify_upgrade_face(bpy.types.Operator): @classmethod def poll(cls, context): obj = context.object - return obj and obj.type == 'ARMATURE' and obj.mode in {'POSE', 'OBJECT'} and find_face_bone(obj) + return obj and obj.type == 'ARMATURE' and find_face_bone(obj) def invoke(self, context, event): return context.window_manager.invoke_confirm(self, event) diff --git a/rigify/rig_lists.py b/rigify/rig_lists.py index ae7d9d00..1526d488 100644 --- a/rigify/rig_lists.py +++ b/rigify/rig_lists.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later import os import traceback diff --git a/rigify/rig_ui_template.py b/rigify/rig_ui_template.py index 528a732c..f3bc5374 100644 --- a/rigify/rig_ui_template.py +++ b/rigify/rig_ui_template.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/basic/copy_chain.py b/rigify/rigs/basic/copy_chain.py index 54f09ad7..cd2de206 100644 --- a/rigify/rigs/basic/copy_chain.py +++ b/rigify/rigs/basic/copy_chain.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/basic/pivot.py b/rigify/rigs/basic/pivot.py index 0301790f..e10bf4e2 100644 --- a/rigify/rigs/basic/pivot.py +++ b/rigify/rigs/basic/pivot.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/basic/raw_copy.py b/rigify/rigs/basic/raw_copy.py index e562038c..8aa593aa 100644 --- a/rigify/rigs/basic/raw_copy.py +++ b/rigify/rigs/basic/raw_copy.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/basic/super_copy.py b/rigify/rigs/basic/super_copy.py index e2f70842..e43993b4 100644 --- a/rigify/rigs/basic/super_copy.py +++ b/rigify/rigs/basic/super_copy.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/chain_rigs.py b/rigify/rigs/chain_rigs.py index 96bf8abd..9a96faa0 100644 --- a/rigify/rigs/chain_rigs.py +++ b/rigify/rigs/chain_rigs.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/experimental/super_chain.py b/rigify/rigs/experimental/super_chain.py index c0a0f09e..8a51a938 100644 --- a/rigify/rigs/experimental/super_chain.py +++ b/rigify/rigs/experimental/super_chain.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy from mathutils import Vector from ...utils import copy_bone, put_bone, org, align_bone_y_axis, align_bone_x_axis, align_bone_z_axis diff --git a/rigify/rigs/face/basic_tongue.py b/rigify/rigs/face/basic_tongue.py index 380e14df..005fe551 100644 --- a/rigify/rigs/face/basic_tongue.py +++ b/rigify/rigs/face/basic_tongue.py @@ -1,20 +1,4 @@ -# ====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/face/skin_eye.py b/rigify/rigs/face/skin_eye.py index 16b05b4b..4955df6b 100644 --- a/rigify/rigs/face/skin_eye.py +++ b/rigify/rigs/face/skin_eye.py @@ -1,20 +1,4 @@ -# ====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -609,6 +593,8 @@ class EyeClusterControl(RigComponent): def parent_bones(self): if self.rig_count > 1: + self.get_bone(self.master_bone).use_local_location = False + for child in self.child_bones: self.set_bone_parent(child, self.master_bone) diff --git a/rigify/rigs/face/skin_jaw.py b/rigify/rigs/face/skin_jaw.py index 6829818c..fdcd904f 100644 --- a/rigify/rigs/face/skin_jaw.py +++ b/rigify/rigs/face/skin_jaw.py @@ -1,20 +1,4 @@ -# ====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/faces/super_face.py b/rigify/rigs/faces/super_face.py index 32d013a7..4d062aaf 100644 --- a/rigify/rigs/faces/super_face.py +++ b/rigify/rigs/faces/super_face.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy, re from mathutils import Vector from ...utils import copy_bone, flip_bone diff --git a/rigify/rigs/limbs/arm.py b/rigify/rigs/limbs/arm.py index e276407e..e2563faf 100644 --- a/rigify/rigs/limbs/arm.py +++ b/rigify/rigs/limbs/arm.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -180,6 +164,10 @@ def create_sample(obj, limb=False): pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass + try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass pbone = obj.pose.bones[bones['forearm.L']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) diff --git a/rigify/rigs/limbs/front_paw.py b/rigify/rigs/limbs/front_paw.py index 30582d60..3c192a75 100644 --- a/rigify/rigs/limbs/front_paw.py +++ b/rigify/rigs/limbs/front_paw.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/limbs/leg.py b/rigify/rigs/limbs/leg.py index 59d48993..05c606ef 100644 --- a/rigify/rigs/limbs/leg.py +++ b/rigify/rigs/limbs/leg.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -477,6 +461,10 @@ def create_sample(obj): pbone.rigify_parameters.extra_ik_toe = True except AttributeError: pass + try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass pbone = obj.pose.bones[bones['shin.L']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) diff --git a/rigify/rigs/limbs/limb_rigs.py b/rigify/rigs/limbs/limb_rigs.py index 7ecc508f..b72e9d40 100644 --- a/rigify/rigs/limbs/limb_rigs.py +++ b/rigify/rigs/limbs/limb_rigs.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -448,6 +432,12 @@ class BaseLimbRig(BaseRig): else: self.set_bone_parent(self.bones.ctrl.ik_base, self.bones.mch.ik_swing) + self.set_ik_local_location(self.bones.ctrl.ik) + self.set_ik_local_location(self.bones.ctrl.ik_pole) + + def set_ik_local_location(self, ctrl): + self.get_bone(ctrl).use_local_location = self.params.ik_local_location + @stage.configure_bones def configure_ik_controls(self): base = self.get_bone(self.bones.ctrl.ik_base) @@ -943,6 +933,12 @@ class BaseLimbRig(BaseRig): description = "Create a rotation pivot control that can be repositioned arbitrarily" ) + params.ik_local_location = bpy.props.BoolProperty( + name = "IK Local Location", + default = True, + description = "Specifies the value of the Local Location option for IK controls, which decides if the location channels are aligned to the local control orientation or world", + ) + # Setting up extra layers for the FK and tweak ControlLayersOption.FK.add_parameters(params) ControlLayersOption.TWEAK.add_parameters(params) @@ -965,6 +961,7 @@ class BaseLimbRig(BaseRig): r.prop(params, "bbones") layout.prop(params, 'make_custom_pivot', text="Custom IK Pivot") + layout.prop(params, 'ik_local_location') ControlLayersOption.FK.parameters_ui(layout, params) ControlLayersOption.TWEAK.parameters_ui(layout, params) diff --git a/rigify/rigs/limbs/limb_utils.py b/rigify/rigs/limbs/limb_utils.py index 609da256..b60e865a 100644 --- a/rigify/rigs/limbs/limb_utils.py +++ b/rigify/rigs/limbs/limb_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy, re from mathutils import Vector from ...utils import org, strip_org, make_mechanism_name, make_deformer_name diff --git a/rigify/rigs/limbs/paw.py b/rigify/rigs/limbs/paw.py index 3aa336ac..30d81d4f 100644 --- a/rigify/rigs/limbs/paw.py +++ b/rigify/rigs/limbs/paw.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -342,6 +326,10 @@ def create_sample(obj): pbone.rigify_parameters.limb_type = "paw" except AttributeError: pass + try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass pbone = obj.pose.bones[bones['shin.L']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) diff --git a/rigify/rigs/limbs/rear_paw.py b/rigify/rigs/limbs/rear_paw.py index d0d349e8..967a666d 100644 --- a/rigify/rigs/limbs/rear_paw.py +++ b/rigify/rigs/limbs/rear_paw.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/limbs/simple_tentacle.py b/rigify/rigs/limbs/simple_tentacle.py index 50a5c6ca..21893c14 100644 --- a/rigify/rigs/limbs/simple_tentacle.py +++ b/rigify/rigs/limbs/simple_tentacle.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/limbs/super_finger.py b/rigify/rigs/limbs/super_finger.py index 664094d1..a1f49920 100644 --- a/rigify/rigs/limbs/super_finger.py +++ b/rigify/rigs/limbs/super_finger.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -168,6 +152,12 @@ class Rig(SimpleChainRig): no_fix_rotation=True, no_fix_scale=True, ) + @stage.parent_bones + def parent_ik_control(self): + if self.make_ik: + bone = self.get_bone(self.bones.ctrl.ik) + bone.use_local_location = self.params.ik_local_location + @stage.configure_bones def configure_ik_control(self): if self.make_ik: @@ -382,6 +372,12 @@ class Rig(SimpleChainRig): description = "Create an optional IK control" ) + params.ik_local_location = bpy.props.BoolProperty( + name = 'IK Local Location', + default = True, + description = "Specifies the value of the Local Location option for IK controls, which decides if the location channels are aligned to the local control orientation or world", + ) + ControlLayersOption.TWEAK.add_parameters(params) ControlLayersOption.EXTRA_IK.add_parameters(params) @@ -396,6 +392,9 @@ class Rig(SimpleChainRig): layout.prop(params, 'bbones') layout.prop(params, 'make_extra_ik_control', text='IK Control') + if params.make_extra_ik_control: + layout.prop(params, 'ik_local_location') + ControlLayersOption.TWEAK.parameters_ui(layout, params) if params.make_extra_ik_control: @@ -639,6 +638,10 @@ def create_sample(obj): pbone.rigify_parameters.tweak_extra_layers = False except AttributeError: pass + try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass pbone = obj.pose.bones[bones['f_pinky.02.L']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) diff --git a/rigify/rigs/limbs/super_limb.py b/rigify/rigs/limbs/super_limb.py index 5020f091..f5e4c7bd 100644 --- a/rigify/rigs/limbs/super_limb.py +++ b/rigify/rigs/limbs/super_limb.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/limbs/super_palm.py b/rigify/rigs/limbs/super_palm.py index 7573e4a7..62e39c49 100644 --- a/rigify/rigs/limbs/super_palm.py +++ b/rigify/rigs/limbs/super_palm.py @@ -1,20 +1,4 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ##### END GPL LICENSE BLOCK ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/skin/anchor.py b/rigify/rigs/skin/anchor.py index 0392761f..0474a134 100644 --- a/rigify/rigs/skin/anchor.py +++ b/rigify/rigs/skin/anchor.py @@ -1,20 +1,4 @@ -# ====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/skin/basic_chain.py b/rigify/rigs/skin/basic_chain.py index b2cac8a6..8dfb6140 100644 --- a/rigify/rigs/skin/basic_chain.py +++ b/rigify/rigs/skin/basic_chain.py @@ -1,20 +1,4 @@ -# ====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/skin/glue.py b/rigify/rigs/skin/glue.py index 6f9400cd..cb8ddf48 100644 --- a/rigify/rigs/skin/glue.py +++ b/rigify/rigs/skin/glue.py @@ -1,20 +1,4 @@ -# ====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/skin/skin_nodes.py b/rigify/rigs/skin/skin_nodes.py index 6dec06e8..20a7df8c 100644 --- a/rigify/rigs/skin/skin_nodes.py +++ b/rigify/rigs/skin/skin_nodes.py @@ -1,20 +1,4 @@ -# ====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/skin/skin_parents.py b/rigify/rigs/skin/skin_parents.py index 956c5ca3..a60b85b9 100644 --- a/rigify/rigs/skin/skin_parents.py +++ b/rigify/rigs/skin/skin_parents.py @@ -1,20 +1,4 @@ -# ====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/skin/skin_rigs.py b/rigify/rigs/skin/skin_rigs.py index a4bc361e..bc6b6350 100644 --- a/rigify/rigs/skin/skin_rigs.py +++ b/rigify/rigs/skin/skin_rigs.py @@ -1,20 +1,4 @@ -# ====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/skin/stretchy_chain.py b/rigify/rigs/skin/stretchy_chain.py index c6fae592..18313757 100644 --- a/rigify/rigs/skin/stretchy_chain.py +++ b/rigify/rigs/skin/stretchy_chain.py @@ -1,20 +1,4 @@ -# ====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/skin/transform/basic.py b/rigify/rigs/skin/transform/basic.py index 2069615a..48a178e4 100644 --- a/rigify/rigs/skin/transform/basic.py +++ b/rigify/rigs/skin/transform/basic.py @@ -1,20 +1,4 @@ -# ====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/spines/basic_spine.py b/rigify/rigs/spines/basic_spine.py index 5c64e634..4499af69 100644 --- a/rigify/rigs/spines/basic_spine.py +++ b/rigify/rigs/spines/basic_spine.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/spines/basic_tail.py b/rigify/rigs/spines/basic_tail.py index b5bf1076..a69ac800 100644 --- a/rigify/rigs/spines/basic_tail.py +++ b/rigify/rigs/spines/basic_tail.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/spines/spine_rigs.py b/rigify/rigs/spines/spine_rigs.py index 3c8b8223..9e25018e 100644 --- a/rigify/rigs/spines/spine_rigs.py +++ b/rigify/rigs/spines/spine_rigs.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/spines/super_head.py b/rigify/rigs/spines/super_head.py index f71a95ff..149dd1d8 100644 --- a/rigify/rigs/spines/super_head.py +++ b/rigify/rigs/spines/super_head.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/spines/super_spine.py b/rigify/rigs/spines/super_spine.py index 86021c84..9d9e6d0f 100644 --- a/rigify/rigs/spines/super_spine.py +++ b/rigify/rigs/spines/super_spine.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/utils.py b/rigify/rigs/utils.py index 89873ca4..cbc53e3a 100644 --- a/rigify/rigs/utils.py +++ b/rigify/rigs/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + from ..utils.rig import connected_children_names from ..utils.naming import strip_mch, strip_org, make_mechanism_name import re diff --git a/rigify/rigs/widgets.py b/rigify/rigs/widgets.py index 0c434593..acafe750 100644 --- a/rigify/rigs/widgets.py +++ b/rigify/rigs/widgets.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + from mathutils import Matrix from ..utils.widgets import create_widget, widget_generator diff --git a/rigify/rot_mode.py b/rigify/rot_mode.py index 59a233cb..a395ec6e 100644 --- a/rigify/rot_mode.py +++ b/rigify/rot_mode.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + ''' Quat/Euler Rotation Mode Converter v0.1 diff --git a/rigify/ui.py b/rigify/ui.py index eac8b673..54ae4a70 100644 --- a/rigify/ui.py +++ b/rigify/ui.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -60,8 +44,8 @@ def build_type_list(context, rigify_types): a.name = r -class DATA_PT_rigify_generate(bpy.types.Panel): - bl_label = "Rigify Generation" +class DATA_PT_rigify(bpy.types.Panel): + bl_label = "Rigify" bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' bl_context = "data" @@ -72,76 +56,79 @@ class DATA_PT_rigify_generate(bpy.types.Panel): if not context.object: return False return obj.type == 'ARMATURE' \ - and obj.data.get("rig_id") is None \ - and obj.mode in {'POSE', 'OBJECT'} + and obj.data.get("rig_id") is None def draw(self, context): C = context layout = self.layout obj = C.object - if obj.mode in {'POSE', 'OBJECT'}: - WARNING = "Warning: Some features may change after generation" - show_warning = False - show_update_metarig = False - show_not_updatable = False - show_upgrade_face = False + WARNING = "Warning: Some features may change after generation" + show_warning = False + show_update_metarig = False + show_not_updatable = False + show_upgrade_face = False - check_props = ['IK_follow', 'root/parent', 'FK_limb_follow', 'IK_Stretch'] + check_props = ['IK_follow', 'root/parent', 'FK_limb_follow', 'IK_Stretch'] - for bone in obj.pose.bones: - if bone.bone.layers[30] and (list(set(bone.keys()) & set(check_props))): - show_warning = True + for posebone in obj.pose.bones: + bone = posebone.bone + if not bone: + # If we are in edit mode and the bone was just created, + # a pose bone won't exist yet. + continue + if bone.layers[30] and (list(set(posebone.keys()) & set(check_props))): + show_warning = True + break + + for b in obj.pose.bones: + if b.rigify_type in outdated_types.keys(): + old_bone = b.name + old_rig = b.rigify_type + if outdated_types[b.rigify_type]: + show_update_metarig = True + else: + show_update_metarig = False + show_not_updatable = True break + elif b.rigify_type == 'faces.super_face': + show_upgrade_face = True - for b in obj.pose.bones: - if b.rigify_type in outdated_types.keys(): - old_bone = b.name - old_rig = b.rigify_type - if outdated_types[b.rigify_type]: - show_update_metarig = True - else: - show_update_metarig = False - show_not_updatable = True - break - elif b.rigify_type == 'faces.super_face': - show_upgrade_face = True - - if show_warning: - layout.label(text=WARNING, icon='ERROR') - - enable_generate = not (show_not_updatable or show_update_metarig) - - if show_not_updatable: - layout.label(text="WARNING: This metarig contains deprecated rigify rig-types and cannot be upgraded automatically.", icon='ERROR') - layout.label(text="("+old_rig+" on bone "+old_bone+")") - elif show_update_metarig: - layout.label(text="This metarig contains old rig-types that can be automatically upgraded to benefit of rigify's new features.", icon='ERROR') - layout.label(text="("+old_rig+" on bone "+old_bone+")") - layout.operator("pose.rigify_upgrade_types", text="Upgrade Metarig") - elif show_upgrade_face: - layout.label(text="This metarig uses the old face rig.", icon='INFO') - layout.operator("pose.rigify_upgrade_face") + if show_warning: + layout.label(text=WARNING, icon='ERROR') - row = layout.row() - # Rig type field + enable_generate = not (show_not_updatable or show_update_metarig) - col = layout.column(align=True) - col.active = (not 'rig_id' in C.object.data) + if show_not_updatable: + layout.label(text="WARNING: This metarig contains deprecated rigify rig-types and cannot be upgraded automatically.", icon='ERROR') + layout.label(text="("+old_rig+" on bone "+old_bone+")") + elif show_update_metarig: + layout.label(text="This metarig contains old rig-types that can be automatically upgraded to benefit of rigify's new features.", icon='ERROR') + layout.label(text="("+old_rig+" on bone "+old_bone+")") + layout.operator("pose.rigify_upgrade_types", text="Upgrade Metarig") + elif show_upgrade_face: + layout.label(text="This metarig uses the old face rig.", icon='INFO') + layout.operator("pose.rigify_upgrade_face") - col.separator() - row = col.row() - text = "Re-Generate Rig" if obj.data.rigify_target_rig else "Generate Rig" - row.operator("pose.rigify_generate", text=text, icon='POSE_HLT') - row.enabled = enable_generate + row = layout.row() + # Rig type field + col = layout.column(align=True) + col.active = (not 'rig_id' in C.object.data) -class DATA_PT_rigify_generate_advanced(bpy.types.Panel): + col.separator() + row = col.row() + text = "Re-Generate Rig" if obj.data.rigify_target_rig else "Generate Rig" + row.operator("pose.rigify_generate", text=text, icon='POSE_HLT') + row.enabled = enable_generate + + +class DATA_PT_rigify_advanced(bpy.types.Panel): bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' bl_context = "data" bl_label = "Advanced" - bl_parent_id = 'DATA_PT_rigify_generate' + bl_parent_id = 'DATA_PT_rigify' bl_options = {'DEFAULT_CLOSED'} def draw(self, context): @@ -163,10 +150,12 @@ class DATA_PT_rigify_generate_advanced(bpy.types.Panel): class DATA_PT_rigify_samples(bpy.types.Panel): - bl_label = "Rigify Samples" + bl_label = "Samples" bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' bl_context = "data" + bl_parent_id = "DATA_PT_rigify" + bl_options = {'DEFAULT_CLOSED'} @classmethod def poll(cls, context): @@ -202,11 +191,12 @@ class DATA_PT_rigify_samples(bpy.types.Panel): class DATA_PT_rigify_layer_names(bpy.types.Panel): - bl_label = "Rigify Layer Names" + bl_label = "Layer Names" bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' bl_context = "data" bl_options = {'DEFAULT_CLOSED'} + bl_parent_id = "DATA_PT_rigify" @classmethod def poll(cls, context): @@ -540,11 +530,12 @@ class DATA_MT_rigify_bone_groups_context_menu(bpy.types.Menu): class DATA_PT_rigify_bone_groups(bpy.types.Panel): - bl_label = "Rigify Bone Groups" + bl_label = "Bone Groups" bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' bl_context = "data" bl_options = {'DEFAULT_CLOSED'} + bl_parent_id = "DATA_PT_rigify" @classmethod def poll(cls, context): @@ -1387,10 +1378,10 @@ classes = ( DATA_OT_rigify_bone_group_remove_all, DATA_UL_rigify_bone_groups, DATA_MT_rigify_bone_groups_context_menu, + DATA_PT_rigify, + DATA_PT_rigify_advanced, DATA_PT_rigify_bone_groups, DATA_PT_rigify_layer_names, - DATA_PT_rigify_generate, - DATA_PT_rigify_generate_advanced, DATA_PT_rigify_samples, BONE_PT_rigify_buttons, VIEW3D_PT_rigify_animation_tools, diff --git a/rigify/utils/__init__.py b/rigify/utils/__init__.py index f2444d1c..8a2dee1d 100644 --- a/rigify/utils/__init__.py +++ b/rigify/utils/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + # These forwarding imports are for backwards compatibility with legacy code # that expects a single utils.py file. New code should import directly from # the modules that contain the utilities. Also, don't add more imports here. diff --git a/rigify/utils/animation.py b/rigify/utils/animation.py index 8710e74d..e9a56f4c 100644 --- a/rigify/utils/animation.py +++ b/rigify/utils/animation.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/bones.py b/rigify/utils/bones.py index 4416a1d6..10a8926d 100644 --- a/rigify/utils/bones.py +++ b/rigify/utils/bones.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -498,6 +482,20 @@ def align_bone_orientation(obj, bone_name, target_bone_name): bone1_e.roll = bone2_e.roll +def set_bone_orientation(obj, bone_name, orientation): + """ Aligns the orientation of bone to target bone or matrix. """ + if isinstance(orientation, str): + align_bone_orientation(obj, bone_name, orientation) + + else: + bone_e = obj.data.edit_bones[bone_name] + + matrix = Matrix(orientation).to_4x4() + matrix.translation = bone_e.head + + bone_e.matrix = matrix + + def align_bone_roll(obj, bone1, bone2): """ Aligns the roll of two bones. """ diff --git a/rigify/utils/collections.py b/rigify/utils/collections.py index a19b9da1..6b98b86b 100644 --- a/rigify/utils/collections.py +++ b/rigify/utils/collections.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/components.py b/rigify/utils/components.py index 5c1ebcb6..c1d01c90 100644 --- a/rigify/utils/components.py +++ b/rigify/utils/components.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy from .naming import make_derived_name diff --git a/rigify/utils/errors.py b/rigify/utils/errors.py index 0fc81ccb..1fa1f11b 100644 --- a/rigify/utils/errors.py +++ b/rigify/utils/errors.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/layers.py b/rigify/utils/layers.py index 27c67f0b..1b807cc7 100644 --- a/rigify/utils/layers.py +++ b/rigify/utils/layers.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/mechanism.py b/rigify/utils/mechanism.py index 930309b3..d8ac3a62 100644 --- a/rigify/utils/mechanism.py +++ b/rigify/utils/mechanism.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/metaclass.py b/rigify/utils/metaclass.py index c9d4ec1a..1c53a8ef 100644 --- a/rigify/utils/metaclass.py +++ b/rigify/utils/metaclass.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/misc.py b/rigify/utils/misc.py index 9d4307c0..99767e09 100644 --- a/rigify/utils/misc.py +++ b/rigify/utils/misc.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/naming.py b/rigify/utils/naming.py index a713e407..06d9e36e 100644 --- a/rigify/utils/naming.py +++ b/rigify/utils/naming.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/node_merger.py b/rigify/utils/node_merger.py index 49ebaf27..d627707f 100644 --- a/rigify/utils/node_merger.py +++ b/rigify/utils/node_merger.py @@ -1,20 +1,4 @@ -# ====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/rig.py b/rigify/utils/rig.py index 7969a34f..654f3580 100644 --- a/rigify/utils/rig.py +++ b/rigify/utils/rig.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/switch_parent.py b/rigify/utils/switch_parent.py index 405008b9..d4852c43 100644 --- a/rigify/utils/switch_parent.py +++ b/rigify/utils/switch_parent.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy import re @@ -7,6 +9,7 @@ import json from .errors import MetarigError from .naming import strip_prefix, make_derived_name +from .bones import set_bone_orientation from .mechanism import MechanismUtilityMixin from .rig import rig_is_child from .misc import map_list, map_apply, force_lazy @@ -16,6 +19,7 @@ from ..base_generate import GeneratorPlugin from collections import defaultdict from itertools import count, repeat, chain +from mathutils import Matrix class SwitchParentBuilder(GeneratorPlugin, MechanismUtilityMixin): @@ -80,7 +84,7 @@ class SwitchParentBuilder(GeneratorPlugin, MechanismUtilityMixin): self.local_parents[id(rig)].append(entry) - def build_child(self, rig, bone, *, use_parent_mch=True, **options): + def build_child(self, rig, bone, *, use_parent_mch=True, mch_orientation=None, **options): """ Build a switchable parent mechanism for the specified bone. @@ -89,6 +93,7 @@ class SwitchParentBuilder(GeneratorPlugin, MechanismUtilityMixin): bone Name of the child bone. extra_parents List of bone names or (name, user_name) pairs to use as additional parents. use_parent_mch Create an intermediate MCH bone for the constraints and parent the child to it. + mch_orientation Orientation matrix or bone name to align the MCH bone to; defaults to world. select_parent Select the specified bone instead of the last one. select_tags List of parent tags to try for default selection. ignore_global Ignore the is_global flag of potential parents. @@ -120,6 +125,9 @@ class SwitchParentBuilder(GeneratorPlugin, MechanismUtilityMixin): # Create MCH proxy if use_parent_mch: mch_bone = rig.copy_bone(bone, make_derived_name(bone, 'mch', '.parent'), scale=1/3) + + set_bone_orientation(rig.obj, mch_bone, mch_orientation or Matrix.Identity(4)) + else: mch_bone = bone diff --git a/rigify/utils/widgets.py b/rigify/utils/widgets.py index b3715f80..16f5faab 100644 --- a/rigify/utils/widgets.py +++ b/rigify/utils/widgets.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/widgets_basic.py b/rigify/utils/widgets_basic.py index 543457eb..854b4d7e 100644 --- a/rigify/utils/widgets_basic.py +++ b/rigify/utils/widgets_basic.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/widgets_special.py b/rigify/utils/widgets_special.py index 8e2d7a27..276590a5 100644 --- a/rigify/utils/widgets_special.py +++ b/rigify/utils/widgets_special.py @@ -1,20 +1,4 @@ -#====================== BEGIN GPL LICENSE BLOCK ====================== -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -#======================= END GPL LICENSE BLOCK ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> |