diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2020-12-05 00:27:10 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2020-12-05 00:27:20 +0300 |
commit | 0871d330e9028820bf6059d804f09b66021122d7 (patch) | |
tree | 9153e2858333d56d09eed2df8a7532b4cb129a02 /rigify/utils | |
parent | 1a2a24bf4af96c6788eab79c257c32e19124ec26 (diff) |
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.
Diffstat (limited to 'rigify/utils')
-rw-r--r-- | rigify/utils/metaclass.py | 8 | ||||
-rw-r--r-- | rigify/utils/naming.py | 4 |
2 files changed, 9 insertions, 3 deletions
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): |