Basic Rigify Spine 2.8 won't successfully generate #61711

Closed
opened 2019-02-19 12:31:20 +01:00 by Ivan Cappiello · 6 comments
Member

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.

rigify_spine2.8.blend

rigify_spine2.7.blend

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


**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. [rigify_spine2.8.blend](https://archive.blender.org/developer/F6658397/rigify_spine2.8.blend) [rigify_spine2.7.blend](https://archive.blender.org/developer/F6658396/rigify_spine2.7.blend) ``` 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 ```
Author
Member

Added subscriber: @icappiello

Added subscriber: @icappiello
Author
Member
Added subscribers: @LucioRossi, @angavrilov, @BrendonMurphy, @pioverfour
Member

This was introduced in cadeb9991c.
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
This was introduced in cadeb9991c. 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)

Fixed the reported exception, but noticed another issue (it fails if the Widgets collection is selected)
Alexander Gavrilov self-assigned this 2019-02-19 19:59:32 +01:00
Author
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Author
Member

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

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

and fix it if you can?

closing this since it works now. @angavrilov can you open a task for: > another issue (it fails if the Widgets collection is selected) and fix it if you can?
Sign in to join this conversation.
No Milestone
No project
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#61711
No description provided.