36
votes
How can I run blender from command line or a python script without opening a GUI?
All what Aldrik wrote, and more Blender Python API Tips and Tricks
From official Blender documentation:
For scripts that are not interactive it can end up being more efficient not to use Blenders ...
32
votes
Accepted
How to use Keyframes and the Python API programmatically?
Figured it out!
Here's how to use the Python API to set it:
...
24
votes
Install Addons in Headless Blender
Using python you can install an addon with bpy.ops.wm.addon_install(), you can then enable the addon with ...
19
votes
How to open system console to get output from Blender on Mac OS 10?
Right click on the Blender icon in the Applications folder and select "Show Package contents". Make an alias of Contents/MacOS/Blender by right clicking and ...
19
votes
Accepted
Rendering a cube as png file using Blender's Python API
Please invest time into researching about the Blender API and Python interface, before asking questions!
...
18
votes
Accepted
Can you clear the System Console without restarting Blender?
Below is an example add-on that adds a button to the text editor for this purpose. Clearing the console is done with the platform specific commands cls for Windows ...
14
votes
Blender script run print to console
Override print method.
Been investigating a number of ways to do this. Possibly the simplest is to override the print in your scripts. Below is designed to ...
13
votes
How to pass command line arguments to a Blender Python script?
thanks for the suggestions. I just managed to get a working example following the double-dash idea that retains all of argparse's functionality with minimal ...
13
votes
Accepted
Rendering on command-line with GPU?
The following script allows you to enable all GPUs and optionally all CPUs as well.
...
13
votes
Can you clear the System Console without restarting Blender?
You can use os.system and call cls or clear:
...
11
votes
Is there anyway to make blender print errors in the UI?
If you do not want to restart Blender to see the messages sent to stdout or stderr, you can always run your script in blenders ...
11
votes
Accepted
How to make Blender exit after running Python script from command line?
use bpy.ops.wm.quit_blender()?
10
votes
Accepted
Install Addons in Headless Blender
You can just unzip the add-on into the /2.7x/scripts/addons/ directory. On Linux, it should be in the same directory as Blender. If there is more than just a single ...
10
votes
How to render in command line?
Firstly open your Command Processor.
Windows(Command Prompt)
Linux(Terminal)
Mac(Command Line).
For Windows:
In cmd first type ...
9
votes
Accepted
Invalid drivers aren't shown and can't be deleted
Remove, since removed shape-key drivers.
From pic in question appears they are shape key drivers, which remain if a keyblock is removed, renamed (To reproduce, add a shapekey "Key 1", give ...
8
votes
8
votes
Why doesn't the Blender console go away when opening the program?
Same here, since a few days – due to a Windows 11 update, I think.
Anyway, to start Blender without the console, you can run blender-launcher.exe. It's in the same ...
7
votes
How can I run blender from command line or a python script without opening a GUI?
you can also directly run expressions without having to create a new .py file
like this:
...
7
votes
Accepted
Command line script renders without shaders
You're not actually rendering the 'simple.blend' file. You're actually rendering the default blend file. This is because the order of command line arguments matters.
To explain further, your ...
7
votes
Can you clear the System Console without restarting Blender?
As of 2021, there is an operator for this.
Clear command history only:
bpy.ops.console.clear(scrollback=False, history=True)
Clear command history and ...
6
votes
What does "Invalid clnors in this fan!" mean?
Since I had the same message in the console with my processor going crazy, and I haven't found more information about that here, I answere this old question.
In my case it was related to custom split ...
6
votes
Accepted
Change value of material emission strength from Python console or script
Found a solution:
bpy.data.materials['material_name'].node_tree.nodes["Emission"].inputs[1].default_value = 3 #or any other value
Thanks to this reference
6
votes
How to open system console to get output from Blender on Mac OS 10?
The only way to see the Blender console and thus the script output is to launch Blender from a terminal using the full path to the executable: ...
6
votes
6
votes
Rendering on command-line with GPU?
After updating to Blender 3.1.0 the script that Robert posted stopped working for me and threw the error ...
5
votes
How do I import a fbx file into blender from command line?
You simply need one operator to import the FBX, and another operator to export the blendfile. Replace the filepath variables with the actual paths you want to use.
...
5
votes
Accepted
How can I copy or print errors from the console?
As of version 2.77 there is a new built-in 'Reports to Text Block' operator, which basically copies all entries of the Report Console into a newly created text block per execution:
However, saving ...
5
votes
How to force console window to show up automatically when Blender starts
Append -con to the command line arguments passed to blender.exe.
You can do so by modifying the properties of your favorite ...
5
votes
python script console command, poll() failed - context is incorrect
I converted your script over to use bmesh constructs. Note that matrix multiplication is not commutative, so $A \cdot B$ is not always equal to $B \cdot A$, and Python for some reason decided to use '@...
5
votes
Accepted
Is there any way to change the number of rendering samples using command-line?
There are several ways you can accomplish this. Probably the easiest is to have your command line include a python expression for Blender to execute. If you look at the manual entry for Command ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
command-line × 440python × 224
scripting × 107
rendering × 94
cycles-render-engine × 25
error × 22
windows × 18
add-on × 15
linux × 15
interface × 10
gpu × 10
blender-internal-render-engine × 9
image × 9
video-sequence-editor × 9
baking × 9
animation × 8
blend-files × 8
compositing-nodes × 8
eevee-render-engine × 7
installation × 7
3d-view × 6
export × 6
drivers × 6
operator × 6
osx × 6