Dumping all scene parameters + all objects from BlendLuxCore and use them in LuxCore
Posted: Wed Feb 06, 2019 3:10 pm
Hi,
I would like to dump all the necessary variables and scene objects from BlendLuxCore to recreate the same scene directly in LuxCore (I want to develop only C++ part but prototype scenes/camera positions inside Blender). I would need to automatically generate .cfg and .scn files with all necessary objects (meshes etc.) exported and linked inside .cfg/.scn. I guess the only supported type for meshes in LuxCore is ".ply"? What I did so far was setting these lines in the BlendLuxCore\export\__init__.py inside create_session() function. This gives me many parameters that are passed from BlendLuxCore to LuxCore:
Now I'm facing the problem that in "scene_description.txt" there are many references given without "physical" files (as LuxCore probably needs them). How could I export all the needed mesh objects and reference/link them in exported configuration file.
A practical description of what I want to achieve is also presented below: when dumping variables in textfile, only Blender references are given for meshes as:
scene.objects.Mesh_Plane__001_2236770689416000.material = "Surface_ground_2236777733064"
scene.objects.Mesh_Plane__001_2236770689416000.shape = "Mesh-Mesh_Plane__001_2236770689416000"
scene.objects.Mesh_Plane__001_2236770689416000.camerainvisible = 0
How to export meshes as .ply (or are there also other supported types in C++ core) and also other objects accessible inside Blender, and link them in "scene_description.txt, so I will be able to render the same scene without using Blender?
Thank you very much for your valuable time and your answer!
I would like to dump all the necessary variables and scene objects from BlendLuxCore to recreate the same scene directly in LuxCore (I want to develop only C++ part but prototype scenes/camera positions inside Blender). I would need to automatically generate .cfg and .scn files with all necessary objects (meshes etc.) exported and linked inside .cfg/.scn. I guess the only supported type for meshes in LuxCore is ".ply"? What I did so far was setting these lines in the BlendLuxCore\export\__init__.py inside create_session() function. This gives me many parameters that are passed from BlendLuxCore to LuxCore:
Code: Select all
f = open("scene_description.txt", "w")
f.write(self.camera_cache.props.ToString())
f.write(world_props.ToString())
f.write(scene_props.ToString())
f.write(config_props.ToString())
f.write(halt_props.ToString())
f.close()
A practical description of what I want to achieve is also presented below: when dumping variables in textfile, only Blender references are given for meshes as:
scene.objects.Mesh_Plane__001_2236770689416000.material = "Surface_ground_2236777733064"
scene.objects.Mesh_Plane__001_2236770689416000.shape = "Mesh-Mesh_Plane__001_2236770689416000"
scene.objects.Mesh_Plane__001_2236770689416000.camerainvisible = 0
How to export meshes as .ply (or are there also other supported types in C++ core) and also other objects accessible inside Blender, and link them in "scene_description.txt, so I will be able to render the same scene without using Blender?
Thank you very much for your valuable time and your answer!