Questions tagged [python]
Python is an interactive, object-oriented programming language. In Blender, it is used as a general-purpose scripting language and to create add-ons to extend Blender's functionality.
13,608 questions
2
votes
2
answers
40
views
How to automatically refresh or reload Import CSV node data?
I am experimenting with the Import CSV node in Blender. I have Blender open alongside a text editor where I edit my CSV file, and I would like an easy way for the new data to update automatically in ...
1
vote
1
answer
25
views
How to get bounds scale of selected vertices
I'm coming from a Maya MEL background so total newb to Blender & python, so thanks in advance for any advice to point me in the right direction.
I've been giving this a google for a good couple of ...
3
votes
1
answer
41
views
Stopping a property Panel from appearing on objects of other data types
I'm making an addon for Blender and I want to create a new Panel in the mesh properties.
I managed to do it, but it appears on every object type: Cameras, lights, empties, etc.
This is because the <...
3
votes
1
answer
177
views
How to determine using Python whether the mouse pointer is hovering over the viewport navigation gizmos?
In top-right part of 3D Viewport, the Navigation Gizmo has multiple components:
Axis gizmo
View gizmos
I have a custom operator which meant to be executed only when mouse pointer is above VIEW_3D <...
2
votes
1
answer
79
views
Determine the name of the shader property under the mouse pointer
In Blender, in the Material tab, there are different properties such as Base Color (1), Metallic (2), etc.
I need to find a way to determine which property the mouse pointer is currently hovering over....
1
vote
1
answer
65
views
Video fps incorrect in Blender API new_movie() strip
I have an MP4 file that I want to add as a new video strip to the Video Sequencer Editor using an addon or a script. The following Blender API code adds the video, but the playback speed becomes ...
0
votes
1
answer
62
views
Add new Array modifier via python without bpy.ops ( in Blender 5.0 ) [closed]
In blender 5.0 beta there is the new array modifier.
( in the background it is actually a "geometry node group" )
The modifier can be added and updated via python with:
...
0
votes
1
answer
42
views
Detect that operator is called above a certain color swatch
In Texture Paint mode there are two color swatches in the top left corner:
If press E above a color swatch – color picker will appear: it's ...
1
vote
1
answer
44
views
Z position of curve resets to zero when edited
I have some code that generates a curve:
...
3
votes
1
answer
138
views
How exactly do ActionSlots work?
I'm trying to work with action slots through python scripts and I need to understand how they work, really.
The docs say action slots allow an action to animate multiple objects--so far so good. I can ...
1
vote
1
answer
57
views
Building Collapsible UI Panels Procedurally
Using Blender 4.5.3, I am trying to automatically generate a list of shapekeys for each mesh object that is a child of the armature that the UI script is running on. The count and the names of the ...
0
votes
1
answer
62
views
Creating a new image texture using python scripting
How to create a new image texture using python scripting ?
I tried this :
...
0
votes
0
answers
22
views
How do you create Annotation strokes and points via Python API of blender 4.5.3 LTS?
When I create strokes with the Annotation Tool, I can access and move individual points of a stroke like this
...
0
votes
0
answers
38
views
Why does vector data change every time you re-enter edit mode?
I've stored a vertex's coordinate in a variable but when I re-enter edit mode - values are different! Why?
...
0
votes
4
answers
76
views
How can I make a tapered cylinder given 2 points and 2 radii?
If I have two lists, each containing an x, y, z, and a radius at that point, how can I make a tapered cylinder connecting the two points, with the radius of the cylinder equal to the specified radius ...
0
votes
0
answers
20
views
Cycles fails with “Resource temporarily unavailable” when running many Blender processes via Ray on 4× A100 GPUs
I’m launching multiple Blender renders through Ray on a private machine with four A100 GPUs, using fractional allocation (@ray.remote(num_gpus=0.25)) so up to 16 render processes start concurrently. ...
3
votes
1
answer
122
views
How to find all mesh lights in Blender
I know it's super easy to select all the lights in a scene. But what if I want to select all the mesh lights in a scene?
For example, here I have the Blenderman:
I've turned off all objects of type '...
0
votes
1
answer
62
views
Baking operation through script repeatedly updates image of same mesh | Optimization
I am running baking operation for blender through python script but its taking a lot of time due to update image operations running for same mesh. (total time 23 mins)
I need to optimize the process ...
2
votes
1
answer
75
views
Generating a triangle with a perfectly rounded tip
I'm aware this question may not belong in this forum, but I'll try to ask anyway.
Given a triangle formed by 3 vertices (v1, v2 and v3), I want to generate a perfectly rounded tip on it in the form ...
2
votes
1
answer
50
views
Add keyframe to an Action via script?
I'm trying to import models from a video game into Blender. The tools I have to dump the models gives me a rigged-but-unanimated FBX as the main model, and a second file in a custom format that ...
0
votes
0
answers
34
views
Problem copying frames via code
I'm trying to copy N times a grease pencil frame and then iterate over their .drawing.strokes for doing some other things.
My problem:
Right after copying them, ...
0
votes
0
answers
23
views
Call pack islands operator with a low level override showing popup for tweaking
I'd like to pack island by calling the operator from code with a low level override. Here it is:
...
1
vote
1
answer
55
views
How to prevent newly created objects from being added to a specific collection in Blender even if that collection is selected?
I’m working with Blender and have a particular workflow where I want to make sure that newly created objects are NOT automatically added to a certain target collection, even when that collection is ...
2
votes
1
answer
104
views
How to Stick a Light to the Top-Center of the Viewport in Screen Space (Like UI Overlay)?
I'm working on a Blender Python add-on/script, and I need to position a light source so that it stays fixed at the top-center of the 3D Viewport, similar to how UI elements behave in screen space.
🎯 ...
2
votes
1
answer
62
views
Auto Random Seed Generation/Increment in Geometry nodes
I have a geometry node group that takes a "seed" input, which will be used for "Seed" input of different "Random Value Node" nodes inside this node group. However, I want ...