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.
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.
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.