diff options
author | Nathan Vegdahl <cessen@cessen.com> | 2011-11-03 02:40:35 +0400 |
---|---|---|
committer | Nathan Vegdahl <cessen@cessen.com> | 2011-11-03 02:40:35 +0400 |
commit | 49910302c9a195816377e0469d1d1c8f2638c101 (patch) | |
tree | 4b24c72d1531c24659b0601a970248d6365b3c22 /rigify/generate.py | |
parent | c560938e8b149ad492acf78b54debfc1e1bbba0e (diff) |
Rigify: fixed bug that triggered error when generating a rig that doesn't
involve any drivers.
Diffstat (limited to 'rigify/generate.py')
-rw-r--r-- | rigify/generate.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/rigify/generate.py b/rigify/generate.py index 0d2e2443..9cb022f0 100644 --- a/rigify/generate.py +++ b/rigify/generate.py @@ -299,16 +299,17 @@ def generate_rig(context, metarig): obj.data.bones[bone].use_deform = False # Alter marked driver targets - for d in obj.animation_data.drivers: - for v in d.driver.variables: - for tar in v.targets: - if tar.data_path.startswith("RIGIFY-"): - temp, bone, prop = tuple([x.strip('"]') for x in tar.data_path.split('["')]) - if bone in obj.data.bones \ - and prop in obj.pose.bones[bone].keys(): - tar.data_path = tar.data_path[7:] - else: - tar.data_path = 'pose.bones["%s"]["%s"]' % (make_original_name(bone), prop) + if obj.animation_data: + for d in obj.animation_data.drivers: + for v in d.driver.variables: + for tar in v.targets: + if tar.data_path.startswith("RIGIFY-"): + temp, bone, prop = tuple([x.strip('"]') for x in tar.data_path.split('["')]) + if bone in obj.data.bones \ + and prop in obj.pose.bones[bone].keys(): + tar.data_path = tar.data_path[7:] + else: + tar.data_path = 'pose.bones["%s"]["%s"]' % (make_original_name(bone), prop) # Move all the original bones to their layer. for bone in original_bones: |