I am trying to export png images with my code. It seems like all steps went well without any error msg.
I also checked rhino command line to find any possible error, but it looks fine to me. But there is no images under the file folder location I have set up. What could cause this issue? Please advise.
you seem to have a space in your file_path, but I can’t quite work out where the script picks up ‘Son\Desktop\render’
For starters, you define render_step() (line 24) within the for loop starting on line 10. This is not good. You never even call this function. Either move it outside of the for loop, or get rid of it. You don’t actually need it in your case.
In line 27, you join render_folder + file_path. Since your render_folder ends with a backslash, that should work. However, I would encourage you to explore the os.path module, specifically os.path.join() for more robust code.
Finally, why don’t you print() the output folder and/or output name first, just to double-check that they are what you expect? Check that the output path actually exists with os.path.isdir()
The problem is that you’re missing enclosing double-quotes around the command: file_path = " \"" + render_folder + file_name + ".png\""
If you want to use the ViewCapture class here is one sample: Issue Programmatically Saving "Raytraced" (Cycles) Renderings - #5 by nathanletwory . This particular script swaps out materials on selected objects and captures the view. If you have a Raytraced view (or other realtime render engine integration view) it’ll render for 10 passes.
I appreciate your advice as a first time learner. I tried to add enclosing double-quotes around the command, and got syntaxError. What went wrong here?