mitsuba2 icon indicating copy to clipboard operation
mitsuba2 copied to clipboard

Editing scene object structure - [❔ other question]

Open anderslanglands opened this issue 2 years ago • 2 comments

I'm trying to write a USD Hydra delegate for Mitsuba. In order to do so I need to be able to change the scene structure, e.g. to assign a new BSDF to a Shape. This doesn't appear to be possible with the current API - one can change the value of many parameters using the TraversalCallback API but not assign new Objects.

Would it be possible to modify Mitsuba to do this? Or is the current architecture fundamentally antithetical to changing the structure of the scene graph after the scene is first created?

anderslanglands avatar May 29 '22 03:05 anderslanglands

Thinking about it some more, it occurs to me that a possible solution might be to create and hold ref's to all the objects individually, then construct the scene graph fresh each time the topology changes. I'll give that a go.

anderslanglands avatar May 29 '22 03:05 anderslanglands

Indeed this isn't something we support at this point.

We will look into the ability to modify the scene graph on the fly eventually but this isn't high priority on our todo list.

Your alternative solution should work as well, although might be less efficient (e.g. rebuilding the BVH when setting a new BSDF)

Speierers avatar May 29 '22 10:05 Speierers