Adding a mesh to a loaded scene #380
-
Hello, i'm trying to add a mesh, which i create in the python script, to a scene which i load from an .xml file. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi Currently, it is not possible to add a One nice workaround is, if you have your scene description in a Python If you're dealing with a XML scene description, you can save your mesh to a PLY using |
Beta Was this translation helpful? Give feedback.
Hi
Currently, it is not possible to add a
Mesh
to aScene
once it has been loaded.One nice workaround is, if you have your scene description in a Python
dict
, you can dynamically add your loaded mesh to the scene description and then load the scene. You can find an example here (last cell of the "Procedural mesh" section).If you're dealing with a XML scene description, you can save your mesh to a PLY using
Mesh.write_to_ply
and then either add it to your XML file or you can read the contents of the XML file and edit the string to add your mesh and then usemitsuba.load_string
.