If i had an image on my computer which acts as a texture and an already created scene in blender which has a 3d object in it. Is it possible to write a blender script to take the image which resides in a location on my computer and use it as a texture on the 3d object in my blender scene, then render the scene and also save the rendered image in a location path on my pc ?
-
2$\begingroup$ Yes it is possible. What have you tried so far? $\endgroup$– user1853Commented Jul 4, 2019 at 16:38
-
$\begingroup$ @cegaton none yet. I wanted to know if it is possible before i start the process. I also want to know if blender GUI has to be running for the process to work ? $\endgroup$– Oto-obong EshiettCommented Jul 4, 2019 at 17:31
-
$\begingroup$ No, you don't need the GUI, you can do this running blender from terminal. $\endgroup$– user1853Commented Jul 4, 2019 at 17:32
1 Answer
The simplest way to do this would be to have a project whose textures point to a files with a known location. Replacing those files with new ones with the same name would take care of the textures.
Then just render using the command line.
blender -b file.blend -a
would render the animation with no GUI.
To set the output path use:
blender -b file.blend -a -o <path>
Read: https://docs.blender.org/manual/en/latest/render/workflows/command_line.html
and
https://docs.blender.org/manual/en/latest/advanced/command_line/arguments.html
-
$\begingroup$ Read also: run-script-stored-in-text-editor-blend-file-from-cli and how-can-i-batch-render-multiple-blendfiles-consecutively $\endgroup$– user1853Commented Jul 4, 2019 at 17:57