Page MenuHome

No datablocks flagged as updated on node property edit
Closed, InvalidPublic

Description

Blender Version
Broken: 2.80, 50ccbe6bb233, master

Short description of error
When a property of a custom node is edited, the updates list of the depsgraph does not contain any flagged datablocks.

Exact steps for others to reproduce the error
I wrote a small addon that shows the problem and I created a .blend with a setup for reproducing it:


  • Open the .blend above
  • Install and enable the addon
  • Start a viewport render (viewport shading: rendered)
  • Modify the "testprop" property of the node and check the console messages

What is printed in the console
A lot of stuff is flagged as updated (including material and nodetree), however no actual datablocks are in the depsgraph.updates list.

--- view update ---
ID Type updated: LIGHT
ID Type updated: MATERIAL
ID Type updated: NODETREE
ID Type updated: SCENE
ID Type updated: TEXTURE
ID Type updated: WORLD
0 updated datablocks

What I would expect
Something like this:

--- view update ---
ID Type updated: MATERIAL
ID Type updated: NODETREE
Datablock updated: <bpy_struct, Material("Material")>
Datablock updated: <bpy_struct, NodeTree("NodeTree")>
2 updated datablocks

Event Timeline

Jacques Lucke (JacquesLucke) changed the task status from Unknown Status to Unknown Status.Aug 7 2019, 3:35 PM
Jacques Lucke (JacquesLucke) claimed this task.

Afaik the depsgraph does not know about custom node trees at the moment. Also the Python API does not allow creating custom dependencies between e.g. your properties and the render result.
This part of a larger problem that will hopefully be tackled at some point. (I need parts of it as well for my work on nodes).

I see no reason to have this as a separate bug report, so I'm closing it.

@Jacques Lucke (JacquesLucke): Did you find a workaround for this bug/problem for your work on nodes? Otherwise the viewport rendering of our addon is really annoying because the material/texture node parameters aren't updated during rendering and you have to restart the render. Is there another bug report which is addressing this problem? Otherwise I don't understand why you closed this one.

Kind regards,
Michael

You can always add an update callback to any property you add. This should help in most cases. I'm very aware that this is not a perfect solution, but you can get quite far with it.
I believe this is a bit of a larger, more general problem, that needs a more general solution.

@Jacques Lucke (JacquesLucke)
Thank you for the feedback. I will try to use a update callback as workaround and see how it will perform.

I have added update callbacks to all our node/socket properties, however you should consider that this means that every affected addon needs to implement an ugly workaround. In my humble opinion it would make more sense to implement the ugly workaround in Blender once and save all the addon developers the work and the mess in their code (plus the time they spend debugging until they even find the issue and this bug report).