-
Hello, I'm following this tutorial. How would I add new plugins (Geometry/Volumes etc) after the scene has been loaded? For example, I would like to do something like this: ` env_light = { params = mi.traverse(scene) However, when I try this, I get:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @CGCooke
import mitsuba as mi
mi.set_variant('llvm_ad_rgb')
bsdf = mi.load_string('<bsdf version="3.0.0" type="diffuse"/>')
cube = mi.load_dict({'type': 'cube', 'bsdf': bsdf}) The general recommendation is to commit to one format, either XML or Python dictionnaries. |
Beta Was this translation helpful? Give feedback.
Hi @CGCooke
No, this is not currently supported. Once a scene has been loaded, only its parameters can be modified. No change of plugin types, or removal/addition of new plugins is possible.
The only workaround is to reload a scene with the new desired description. Mixing Python dictionaries with XML descriptions is possible but limited. For example, you can load individual plugins (not an entire scene) through
mi.load_string
,mi.load_file
ormi.load_dict
and then combine these pre-built objects into a scene or another plugin withmi.load_dict
. Like so: