Page MenuHome

Basic Rigify Spine 2.8 won't successfully generate
Closed, ResolvedPublic

Description

System Information
Operating system: OSX 10.14.3
Graphics card: Intel Iris Pro Graphics 6200

Blender Version

Broken:
(example: 2.80, faa255c0a4e4, blender2.8)
Worked: (2.7)

Short description of error
basic spine system (4 bones, no head, no tail) will crash on generate.

Exact steps for others to reproduce the error
Open attached blend file, click on generate.

Traceback (most recent call last):
  File "/private/var/folders/jn/x12z9rgj4216nhlxwqnhjryc0000gn/T/AppTranslocation/AA081E8A-9E76-4933-8E5E-1B725E1A503C/d/blender.app/Contents/Resources/2.80/scripts/addons/rigify/ui.py", line 763, in execute
    generate.generate_rig(context, context.object)
  File "/private/var/folders/jn/x12z9rgj4216nhlxwqnhjryc0000gn/T/AppTranslocation/AA081E8A-9E76-4933-8E5E-1B725E1A503C/d/blender.app/Contents/Resources/2.80/scripts/addons/rigify/generate.py", line 506, in generate_rig
    create_persistent_rig_ui(obj, script)
  File "/private/var/folders/jn/x12z9rgj4216nhlxwqnhjryc0000gn/T/AppTranslocation/AA081E8A-9E76-4933-8E5E-1B725E1A503C/d/blender.app/Contents/Resources/2.80/scripts/addons/rigify/generate.py", line 601, in create_persistent_rig_ui
    for fcurve in obj.animation_data.drivers:
AttributeError: 'NoneType' object has no attribute 'drivers'

location: <unknown location>:-1

Event Timeline

This was introduced in rBAcadeb9991cb6.
Here’s a suggested fix.

diff --git a/rigify/generate.py b/rigify/generate.py
index d726f14a..03501fe9 100644
--- a/rigify/generate.py
+++ b/rigify/generate.py
@@ -502,7 +502,7 @@ def generate_rig(context, metarig):
     # Create Bone Groups
     create_bone_groups(obj, metarig)
 
-    # Add rig_ui to logic
+    # Create driver to rig_ui
     create_persistent_rig_ui(obj, script)
 
     t.tick("The rest: ")
@@ -598,6 +598,9 @@ def create_persistent_rig_ui(obj, script):
     skip = False
     driver = None
 
+    if obj.animation_data is None:
+        obj.animation_data_create()
+
     for fcurve in obj.animation_data.drivers:
         if fcurve.data_path == 'pass_index':
             driver = fcurve.driver

Fixed the reported exception, but noticed another issue (it fails if the Widgets collection is selected)

Alexander Gavrilov (angavrilov) lowered the priority of this task from 90 to Normal.
Ivan Cappiello (icappiello) changed the task status from Unknown Status to Resolved.Mar 14 2019, 12:36 PM

closing this since it works now. @Alexander Gavrilov (angavrilov) can you open a task for:

another issue (it fails if the Widgets collection is selected)

and fix it if you can?