2.8 feature request: list added or deleted datablocks

The Depsgraph object has an entry for updates where it lists data blocks that have been updated. It would be great if this could also list datablocks that were added or deleted. As of now there’s no way to quickly determine this, instead if the id_type_updated ( id_type )’ shows positive for a type we have to iterate over every object and compare it to appleseed’s relevant object type to see what changed.

This option would simplify that immensely. And I’d venture a guess that the data is already available somewhere inside Blender.

P.S. The PRMan dev agrees that this would be a good improvement.

1 Like

Said PRMan dev here.

We’re still working in 2.79, but if 2.8 is able to answer questions or we can get callbacks for when things like:

  • object was added
  • object was deleted
  • material added
  • material assigned to object
  • material unassigned

It would help decrease the amount of book keeping we currently have to do.

1 Like

It’s unlikely this will be added soon because this information is not tracked in Blender. A further difficulty is that object instances are not actually computed until you iterate over them, they are not stored anywhere by Blender itself, only the renderer.

Is it really inefficient to keep a hash of IDs known to the renderer, and then generate your own callbacks for when an ID is added, deleted or updated? To me it seems this can be done quite fast even in complex scenes.

We could add an implementation of this on the Blender side, but as far as I can tell doing it yourself would only be a few dozens lines of code. It’s also likely more efficient to do it on the renderer side since you already need to maintain a mapping to Blender’s data structures? Having two of those would only add extra overhead.

In general the data delivered to the renderer can be procedurally generated through some complex node system, and tracking precisely how the resulting data changed requires storing the old data for comparison.

1 Like

Hi Brecht. You are right that it’s not all that difficult for us to do our own checking (aside from making sure I catch everything). I was just hoping there was a quick way for Blender to provide that data so I don’t have to build those routines in.