Fix T61711: Rigify fails to complete generate if no rigs create drivers.

The code attaching the UI script to the rig didn't check
that animation_data exists before accessing it.
This commit is contained in:
Alexander Gavrilov 2019-02-19 21:02:03 +03:00
parent b1320f3af6
commit 29a359840e
1 changed files with 3 additions and 0 deletions

View File

@ -598,6 +598,9 @@ def create_persistent_rig_ui(obj, script):
skip = False
driver = None
if not obj.animation_data:
obj.animation_data_create()
for fcurve in obj.animation_data.drivers:
if fcurve.data_path == 'pass_index':
driver = fcurve.driver