Page MenuHome

Cant drive ob1 shape key, by obj2 shape key, if modifier is added to obj2
Confirmed, NormalPublicBUG


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: rBb3f96da2e605
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:

And video with steps:

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

Event Timeline

Jacques Lucke (JacquesLucke) lowered the priority of this task from 90 to 50.May 27 2019, 2:24 PM

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 Sharybin (sergey) Any ideas? Should this work currently?

@Jacques Lucke (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.

Bastien Montagne (mont29) changed the subtype of this task from "Report" to "Bug".Feb 3 2020, 5:47 PM

(Copy-pasting my comment from T74207):

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) Sharybin (sergey) might have ideas here?

@Bastien Montagne (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:

@Sybren A. Stüvel (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 (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.

@Bastien Montagne (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.