[Bf-extensions-cvs] [0871d330] master: Rigify: a number of small fixes.

Alexander Gavrilov noreply at git.blender.org
Fri Dec 4 22:27:31 CET 2020


Commit: 0871d330e9028820bf6059d804f09b66021122d7
Author: Alexander Gavrilov
Date:   Sat Dec 5 00:27:10 2020 +0300
Branches: master
https://developer.blender.org/rBA0871d330e9028820bf6059d804f09b66021122d7

Rigify: a number of small fixes.

- Don't try to add an update callback to CollectionProperty.
- Restore exact alignment of the super_finger master control to 1st bone.
- Add an option to run a sub-object after all methods of the parent.
- Fix wrong identifier in SideZ.from_parts.

===================================================================

M	rigify/__init__.py
M	rigify/rigs/limbs/super_finger.py
M	rigify/utils/metaclass.py
M	rigify/utils/naming.py

===================================================================

diff --git a/rigify/__init__.py b/rigify/__init__.py
index df584872..7e5ee944 100644
--- a/rigify/__init__.py
+++ b/rigify/__init__.py
@@ -474,7 +474,8 @@ class RigifyParameterValidator(object):
                 print("!!! PREVIOUS DEFINITION BY %s:\n\n    %s\n" % (cur_rig, format_property_spec(cur_info)))
 
         # inject a generic update callback that calls the appropriate rig classmethod
-        val[1]['update'] = update_callback(name)
+        if val[0] != bpy.props.CollectionProperty:
+            val[1]['update'] = update_callback(name)
 
         setattr(self.__params, name, val)
         self.__prop_table[name] = (self.__rig_name, new_def)
diff --git a/rigify/rigs/limbs/super_finger.py b/rigify/rigs/limbs/super_finger.py
index 5dd7e681..b50d54f9 100644
--- a/rigify/rigs/limbs/super_finger.py
+++ b/rigify/rigs/limbs/super_finger.py
@@ -63,7 +63,7 @@ class Rig(SimpleChainRig):
 
         first_bone = self.get_bone(orgs[0])
         last_bone = self.get_bone(orgs[-1])
-        self.get_bone(name).tail += (last_bone.tail - first_bone.head) * 1.25
+        self.get_bone(name).length += (last_bone.tail - first_bone.head).length * 1.25
 
     @stage.configure_bones
     def configure_master_control(self):
diff --git a/rigify/utils/metaclass.py b/rigify/utils/metaclass.py
index 9e169e05..c9d4ec1a 100644
--- a/rigify/utils/metaclass.py
+++ b/rigify/utils/metaclass.py
@@ -135,6 +135,7 @@ class StagedMetaclass(type):
 
 class BaseStagedClass(object, metaclass=StagedMetaclass):
     rigify_sub_objects = tuple()
+    rigify_sub_object_run_late = False
 
     def rigify_invoke_stage(self, stage):
         """Call all methods decorated with the given stage, followed by the callback."""
@@ -145,11 +146,16 @@ class BaseStagedClass(object, metaclass=StagedMetaclass):
         getattr(self, stage)()
 
         for sub in self.rigify_sub_objects:
-            sub.rigify_invoke_stage(stage)
+            if not sub.rigify_sub_object_run_late:
+                sub.rigify_invoke_stage(stage)
 
         for method_name in cls.rigify_stage_map[stage]:
             getattr(self, method_name)()
 
+        for sub in self.rigify_sub_objects:
+            if sub.rigify_sub_object_run_late:
+                sub.rigify_invoke_stage(stage)
+
 
 #=============================================
 # Per-owner singleton class
diff --git a/rigify/utils/naming.py b/rigify/utils/naming.py
index 415dddaf..45307323 100644
--- a/rigify/utils/naming.py
+++ b/rigify/utils/naming.py
@@ -131,9 +131,9 @@ class SideZ(enum.IntEnum):
             if parts.side_z[1].lower() == 't':
                 return SideZ.TOP
             else:
-                return Side.BOTTOM
+                return SideZ.BOTTOM
         else:
-            return Side.MIDDLE
+            return SideZ.MIDDLE
 
     @staticmethod
     def to_string(parts, side):



More information about the Bf-extensions-cvs mailing list