I'll explain the numbering of what I did.
- I created a text file called lowRes inside the blend file as shown in the attached image.
- And I noticed that when I click Run Script in Blender run with GUI, the resolution of all scenes is changed to 128x72.
- Then undo by pressing Ctrl + Z, set it to 1920x1080 resolution, and save the file.
- And I did the Command Line Rendering using the code below.
blender -b "my.blend" ^
-P lowRes.py ^
-S "scene 01" ^
-o "//output\##" -F PNG -f 3 ^
-S "scene 02" ^
-o "//output\##" -F PNG -f 5
good.
03.png and 05.png were generated as expected.
But the resolution is 1920x1080, not 128x72.
The python code doesn't seem to be running.
What am I doing wrong?
-Pis for an external python script. If so: make sure your script is saved in same folder as CLI. Passing a wrong name for script it fails silently and renders images with default size. If the script is a text block in blend thenblender -b --python-text "lowRes"– batFINGER Feb 10 '20 at 13:11--python-textwas listed in the official manual but I haven't looked into it closely. I have one last thing I want to know. As far as I know, if you don't have a textblock or external python file, you can run python code with--python-expr. But I failed to execute lowRes code using--python-expr. I am using Notepad. How can I write code that works correctly? – J. SungHoon Feb 10 '20 at 13:35blender -b --python-expr "import bpy; print(bpy.data.scenes[:])"Personally wouldn't do it. Would use the external script. (Save from notepad with a .py extension) – batFINGER Feb 10 '20 at 13:42scene.render.resolution_xandscene.render.resolution_yafter--python-expr. However, from the example you wrote, it seems that--python-exprdoesn't work alone. – J. SungHoon Feb 10 '20 at 13:48