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.
This commit is contained in:
Alexander Gavrilov 2020-12-05 00:27:10 +03:00
parent 1a2a24bf4a
commit 0871d330e9
4 changed files with 12 additions and 5 deletions

View File

@ -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)

View File

@ -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):

View File

@ -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

View File

@ -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):