[Closed] How to save out a bitmap
Hey guys,
Simple / stupid question: I have a script with the render() command but I want to save it out to an image in the same directory as specified by the render menu, I cant seem to figure out how do do this from the docs…
render outputfile:rendOutputFilename
This will call render() with the optional output file name. rendOutputFilename contains the file name set in the Render Scene Dialog.
Alternatively, you can render into a bitmap value, then set the file name there and save the bitmap.
theBmp = render()
theBmp.filename = rendOutputFilename
save theBmp
close theBmp
This approach has a drawback – using the outputfile: option in the render() command adds frame numbers automatically as needed, while saving the bitmap value does not – you would have to write your own code to add numbers… Thus, the first method is better.
If you want to use the DIRECTORY but not the file name, you can say
render outputfile:(getFileNamePath rendOutputFilename + "yourFileNameHere_.exr")