35
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 ...
30
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:
...
29
votes
Accepted
How to get Blender's version number from Python?
bpy.app.version_string
Test using the python console:
>>> bpy.app.version_string
'2.83.2'
Usage within a script file:
...
22
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
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
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 ...
15
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 ...
13
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
Accepted
Rendering on command-line with GPU?
The following script allows you to enable all GPUs and optionally all CPUs as well.
...
12
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
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 ...
10
votes
Accepted
How to make Blender exit after running Python script from command line?
use bpy.ops.wm.quit_blender()?
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
I can't load an image from a script
To load an image from disk doesn't require bpy.ops. You could use:
...
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
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 ...
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
What does "Invalid clnors in this fan!" mean?
Clnors stands for Custom Loop Normals.
This happens when clnors are not equal to each other where they should (would have to see the geometry), this message is printed and they are all replaced with ...
6
votes
Accepted
Automatic select vertices by given coordinates
If the indices no longer correspond, you can:
use a brute-force proximity check
use spatial search structure (K-dimensional-Tree).
Template for getting a bmesh in Object or Edit mode can be found ...
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
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 ...
5
votes
Accepted
run a text block from command line
Unlike most command line programs the order of the options make a difference. The thing to remember is that blender executes each option in the order they are given, almost like a mini script.
The ...
5
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:
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
command-line × 424python × 211
scripting × 101
rendering × 90
cycles-render-engine × 24
error × 21
windows × 18
add-on × 15
linux × 15
interface × 10
gpu × 10
animation × 9
blender-internal-render-engine × 9
video-sequence-editor × 9
image × 8
blend-files × 8
eevee-render-engine × 7
baking × 7
compositing-nodes × 7
export × 6
drivers × 6
operator × 6
osx × 6
node-editor × 5
3d-view × 5