Join Blender Studio for just €11.50/month and get instant access to all of our training and film assets!
This is the second video in a series of “tech videos” in which Sybren discusses concrete problems seen on Stack Exchange. This video is all about loading 10,000 individual OBJ files and rendering them to 10,000 images.
pathlib.Path
to access the filesystembreak
statement.break
statementSlides are only visible to Blender Cloud susbcribers
Hi Sybren
First of all thank you very much for making these wonderful tutorials These tutorials are very helpful.
I need some help from you to achieve some functionality.
I have tried loading fbx files and rendered them through this scripting.
Apart from this i want to achieve the following working -
This will go in a loop for many blender scenes same like you did for .obj files but instead i want to do the same for blender whole scene file with proper lighting.
From above points I have checked the 1 and 4 point and i hope i will be able to achieve the 2 and 3 point also. But my problem is when i open a blender file using following script -
obj_root = pathlib.Path("I:/PythonBlender/first.blend") bpy.ops.wm.open_mainfile(filepath= str(obj_root))
the old file running the python scripts is closed and this new first.blend file is opened in blender. I want my python scripts to keep running and the scenes should load as an addon. and remove the addon scenes after rendering is finished.
Please help me achieve this functionality. Thankyou so much
*@gagan.zedinteractive* not sure if it will work, but I think you should try appending the scene to the current blend file instead of opening a new .blend (as you are in fact running a separate instance of blender) , this I guess should leve the script running and allow you to interact with the additional scene in your original .blend (not sure how to do it in python though)
@gagan.zedinteractive You can start another Blender instance from Blender itself. That's the easiest way to get this kind of processing done. Run blender --help
to see all the possible options. Probably the form you'd want to use is blender.exe thefile.blend -P thescript.py
, where thescript.py
takes care of everything that needs to happen with that particular file.
Join to leave a comment.