Can't use shape key properties in driver when modifiers generate a new mesh #65148

Closed
opened 2019-05-26 15:17:22 +02:00 by Jose Conseco · 13 comments

System Information
Operating system: Windows-10-10.0.17134 64 Bits
Graphics card: GeForce GTX 660/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 416.94

Blender Version
Broken: version: 2.80 (sub 72), branch: blender2.7, commit date: 2019-05-23 20:37, hash: b3f96da2e6
Worked: 2.79

Short description of error
I have simple setup: two objects with shape keys. Lets say obj1 called 'Parent' (not really parented) with shape key that drives shape key 2 on child object. Works ok.
But when we add modifier to 'Parent' obj, and use 'Update dependencies' of child driver properties, error is displayded: 'Invalid python expression'. This works ok in blender 2.79

Exact steps for others to reproduce the error
In attached blend file:

  1. Change shapekey value on 'Parent' object. Child is updated. Works ok
  2. Add subsurf od 'Parent' obj, and press 'update dependencies'. It won't work now even though it worked in 2.79
    Blend file:
    Shape_modifier_bug.blend
    And video with steps:
    Shape_modifer_bug.mp4

And for reference same file for blender 2.79b - it works ok:
Shape_modifier_works279.blend

**System Information** Operating system: Windows-10-10.0.17134 64 Bits Graphics card: GeForce GTX 660/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 416.94 **Blender Version** Broken: version: 2.80 (sub 72), branch: blender2.7, commit date: 2019-05-23 20:37, hash: `b3f96da2e6` Worked: 2.79 **Short description of error** I have simple setup: two objects with shape keys. Lets say obj1 called 'Parent' (not really parented) with shape key that drives shape key 2 on child object. Works ok. But when we add modifier to 'Parent' obj, and use 'Update dependencies' of child driver properties, error is displayded: 'Invalid python expression'. This works ok in blender 2.79 **Exact steps for others to reproduce the error** In attached blend file: 1. Change shapekey value on 'Parent' object. Child is updated. Works ok 2. Add subsurf od 'Parent' obj, and press 'update dependencies'. It won't work now even though it worked in 2.79 Blend file: [Shape_modifier_bug.blend](https://archive.blender.org/developer/F7070375/Shape_modifier_bug.blend) And video with steps: [Shape_modifer_bug.mp4](https://archive.blender.org/developer/F7070379/Shape_modifer_bug.mp4) And for reference same file for blender 2.79b - it works ok: [Shape_modifier_works279.blend](https://archive.blender.org/developer/F8307299/Shape_modifier_works279.blend)
Author

Added subscriber: @JoseConseco

Added subscriber: @JoseConseco

#74207 was marked as duplicate of this issue

#74207 was marked as duplicate of this issue
Member

Added subscribers: @Sergey, @JacquesLucke

Added subscribers: @Sergey, @JacquesLucke
Member

I guess the issue is that the shape keys do not exist on the mesh anymore after modifiers are applied. So the data path does not exist on the parent, when the driver is evaluated.
I don't really see how that could be fixed in a good way...

@Sergey Any ideas? Should this work currently?

I guess the issue is that the shape keys do not exist on the mesh anymore after modifiers are applied. So the data path does not exist on the parent, when the driver is evaluated. I don't really see how that could be fixed in a good way... @Sergey Any ideas? Should this work currently?
Sergey Sharybin self-assigned this 2019-05-27 14:50:27 +02:00

@JacquesLucke, confusing part here is that path might or might not depending on the order of updates. There is definitely something to be sanitized here.

@JacquesLucke, confusing part here is that path might or might not depending on the order of updates. There is definitely something to be sanitized here.
Sergey Sharybin was unassigned by Dalai Felinto 2019-12-23 16:34:15 +01:00

Added subscribers: @Jun-Takahashi, @mont29, @lichtwerk

Added subscribers: @Jun-Takahashi, @mont29, @lichtwerk
Sybren A. Stüvel self-assigned this 2020-02-28 10:47:41 +01:00

(Copy-pasting my comment from #74207):

The issue here is that the drivers gets evaluated by the depsgraph, using evaluated datablocks. And evaluated objects have evaluated obdata (like mesh) from modifier stack, which obviously have no shapekeys anymore (since those shapekey data would be completely invalid for the mesh generated by the modifiers most of the time).

Am not sure how to fix that best tbh, @Sergey Sharybin (sergey) might have ideas here?

(Copy-pasting my comment from #74207): The issue here is that the drivers gets evaluated by the depsgraph, using evaluated datablocks. And evaluated objects have evaluated obdata (like mesh) from modifier stack, which obviously have no shapekeys anymore (since those shapekey data would be completely invalid for the mesh generated by the modifiers most of the time). Am not sure how to fix that best tbh, @Sergey Sharybin (sergey) might have ideas here?

@mont29 To me that sounds like this is not a bug in Blender but a known limitation. There is quite a simple workaround: add a few custom properties and use those to drive the shapekeys on both objects. Here is a demo:

workaround.blend

@mont29 To me that sounds like this is not a bug in Blender but a known limitation. There is quite a simple workaround: add a few custom properties and use those to drive the shapekeys on both objects. Here is a demo: [workaround.blend](https://archive.blender.org/developer/F8377600/workaround.blend)

@dr.sybren wouldn't mind having some depsgraph expertise on this topic first. If (as I suspect) this is not easily solvable, then yes, think we can consider it a known limitation. But if some relatively simple solution exists, then I think the issue is important enough to be considered a bug. :)

@dr.sybren wouldn't mind having some depsgraph expertise on this topic first. If (as I suspect) this is not easily solvable, then yes, think we can consider it a known limitation. But if some relatively simple solution exists, then I think the issue is important enough to be considered a bug. :)
Sybren A. Stüvel removed their assignment 2020-02-28 11:12:17 +01:00

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren

@dr.sybren, this used to work before dependency graph changes done in 2.80, so is something to be fixed in one way or another than to be called a limitation. "New" dependency graph is to allow having more comprehensive setups, not to introduce limitations.

@mont29, simple idea: allow evaluated mesh to reference shapekeys with mesh it was crated for, Will keep RNA paths valid, and should not cause issues: sine evaluated mesh is not meant to be re-evaluated, so shapekeys will be ignored.

@dr.sybren, this used to work before dependency graph changes done in 2.80, so is something to be fixed in one way or another than to be called a limitation. "New" dependency graph is to allow having more comprehensive setups, not to introduce limitations. @mont29, simple idea: allow evaluated mesh to reference shapekeys with mesh it was crated for, Will keep RNA paths valid, and should not cause issues: sine evaluated mesh is not meant to be re-evaluated, so shapekeys will be ignored.
Sybren A. Stüvel changed title from Cant drive ob1 shape key, by obj2 shape key, if modifier is added to obj2 to Can't use shape key properties in driver when modifiers generate a new mesh 2020-05-19 12:08:20 +02:00
Sybren A. Stüvel self-assigned this 2020-05-19 12:08:20 +02:00

This issue was referenced by cb2565195e

This issue was referenced by cb2565195e72ee4dc5c0b53b7cd5037b2169d55f

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 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#65148
No description provided.