diff options
author | Nathan Vegdahl <cessen@cessen.com> | 2013-02-15 19:14:24 +0400 |
---|---|---|
committer | Nathan Vegdahl <cessen@cessen.com> | 2013-02-15 19:14:24 +0400 |
commit | a2b35fb7cca524a9027db863f00fe90d7c15c04f (patch) | |
tree | fb73e9a3bc80d87dda7e95cafb593da3fa3c20a2 /rigify/generate.py | |
parent | 3b3ee36a1d0bce6529b19af4510757b43ee0c846 (diff) |
Bunch of bug fixes.
The biggest fixes relate to keeping ID data modification out of
draw methods. This was breaking Rigify with the current API.
Secondary fix was to move widget meshes to match the bones, even
if the widget meshes already exist. It's nice for when the user
is progressively tweaking the metarig.
Diffstat (limited to 'rigify/generate.py')
-rw-r--r-- | rigify/generate.py | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/rigify/generate.py b/rigify/generate.py index 3d595b42..89f89b71 100644 --- a/rigify/generate.py +++ b/rigify/generate.py @@ -157,17 +157,15 @@ def generate_rig(context, metarig): # rigify_type and rigify_parameters bone_gen.rigify_type = bone.rigify_type - if len(bone.rigify_parameters) > 0: - bone_gen.rigify_parameters.add() - for prop in dir(bone_gen.rigify_parameters[0]): - if (not prop.startswith("_")) \ - and (not prop.startswith("bl_")) \ - and (prop != "rna_type"): - try: - setattr(bone_gen.rigify_parameters[0], prop, \ - getattr(bone.rigify_parameters[0], prop)) - except AttributeError: - print("FAILED TO COPY PARAMETER: " + str(prop)) + for prop in dir(bone_gen.rigify_parameters): + if (not prop.startswith("_")) \ + and (not prop.startswith("bl_")) \ + and (prop != "rna_type"): + try: + setattr(bone_gen.rigify_parameters, prop, \ + getattr(bone.rigify_parameters, prop)) + except AttributeError: + print("FAILED TO COPY PARAMETER: " + str(prop)) # Custom properties for prop in bone.keys(): @@ -412,10 +410,7 @@ def get_bone_rigs(obj, bone_name, halt_on_missing=False): pass else: # Gather parameters - try: - params = obj.pose.bones[bone_name].rigify_parameters[0] - except (KeyError, IndexError): - params = None + params = obj.pose.bones[bone_name].rigify_parameters # Get the rig try: |