Questions tagged [scripting]
Questions concerning scripting in Blender using the Python programming language. Also use this tag for questions about scripting in OSL (Open Shading Language).
6,654 questions
0
votes
0
answers
58
views
blender bone object has no attribute 'select' [closed]
Tried using wiggle 2 after not using it for a couple of long months and now I keep getting this report "blender bone object has no attribute select" i thought it was because i was on a newer ...
3
votes
2
answers
175
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 ...
0
votes
0
answers
49
views
How to access brush in Blender sculpt mode using python script
In Blender, I define a tool in sculpt mode and set a timer: if the tool is activated, the draw brush will be accessed. But when I click leftmouse, it is binded with tweak operator, I want to know why &...
3
votes
1
answer
43
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
179
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 <...
3
votes
1
answer
84
views
Creating a new menu in the Object mode top bar (header)
I'm making an addon for Blender and I want some of the functionality to appear in a menu next to the View, Select, Add, and Object menu in Object Mode.
Something that looks like this:
I know I can ...
3
votes
1
answer
88
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....
0
votes
1
answer
27
views
How to automate setting multiple machines to use OptiX Cycles Render Devices in User Preferences?
My goal is to be able to do this without manually opening Blender.
I'm managing a render farm and I've noticed that some machines render faster. I found out it is because they have GPUs enabled with ...
1
vote
1
answer
73
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
44
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 ...
0
votes
0
answers
43
views
How to model Table Base with Geometry Node?
I want a base. that maintain some parameters, but also updates based on total table length and width.
So if table width is 1000mm (sorry for the metric folks)
I want the width of the base 600mm
and if ...
1
vote
1
answer
56
views
Is it possible to delete a screen without a workspace?
I'm making an add-on for the video editor, that pops up blenders text editor in a new window, which allows me to write texts with line breaks, and then (with a sidebar button) copy that text to the ...
1
vote
1
answer
46
views
Z position of curve resets to zero when edited
I have some code that generates a curve:
...
3
votes
0
answers
44
views
Text Editor sidebar only updates on mouse over, because of bug or bad programming?
I'm writing a tiny add-on that gives me some extra options in both the video sequencer sidebar and text editor sidebar, but only if the active strip is a text strip.
It works just as intended in the ...
3
votes
1
answer
156
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 ...
5
votes
1
answer
188
views
Inverting reliefs
Does anybody knows if there's a way to invert the reliefs in the sphere without distorting it?
0
votes
1
answer
48
views
Unable to match performance of geometry shader with Vulkan back end
I am writing an addon that creates textures using Blender's gpu api.
I want to be able to distribute thousands of 2D cards with textures on them and have controls ...
1
vote
1
answer
75
views
Decimate via script [closed]
Is it possible to create this entire decimate process in areas where the camera can't see, as in the image, but through a script?
Also creating the vertex group and the decimate modifier already ...
0
votes
1
answer
67
views
Creating a new image texture using python scripting
How to create a new image texture using python scripting ?
I tried this :
...
1
vote
0
answers
51
views
How to properly export vertex normals from Blender?
I'm writing a script that exports a mesh from Blender to a game format. The format stores, per vertex, their normals, tangents, and what i assume is a bitangent sign. The latter is a single signed ...
0
votes
0
answers
37
views
Smoothen the sharp edges on the high model after a subtraction by a boolean
I need someone who can help me with finding out a solution how I can make sharp edges to smooth after subtracting an object from a high model scanned by 3D scanner.
I don’t want to sculpt those edges ...
0
votes
0
answers
20
views
How to consistently detect Maximum Hip Extension (MHE) using mocopi skeleton data in Blender?
I’m working on analyzing soccer kicking motion using mocopi BVH data in Blender.
My goal is to extract two joint events:
MHE (Maximum Hip Extension) → the timing when the hip joint is most extended
...
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
30
views
How to create a brush texture slot and assign an image via Python?
I want to create an addon that allows a user to right-click on an image in the File Browser and set it as the paint brush texture. I managed to get the file path of the image and load it into Blender, ...
0
votes
1
answer
67
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
0
answers
63
views
Getting the vertex group weight of a point in Grease Pencil 3.0?
In Grease Pencil previous to 3.0, we were able to do:
weight = stroke.points.weight_get(vertex_group_index=vertex_group.index, point_index=points_index)
In Grease ...
0
votes
0
answers
36
views
Shrinkwrap not projecting onto corners
I am trying to project a plane onto an object I made but the shrink wrap isn't attaching to the right spots and end up clipping through the model. The object and the plane have the same dimensions.
...
1
vote
0
answers
29
views
Color wheel appears unstable in invoke_popup()
I have made an add-on for the visualization of molecular orbitals by students. This add-on is only used in-house and the users have absolutely no experience with Blender. They simply smash buttons in ...
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, ...
-3
votes
1
answer
68
views
How to select an object via a variable?
I want to know how to pass an object as a variable to a function.
...
0
votes
0
answers
26
views
How to mock bpy.ops.export_scene.fbx
I'm working on a simple tool that imports a set of fbx models to be resized on Blender. The first model is the source that the rest of models will be resized to. The first part of the algorithm is to ...
1
vote
1
answer
58
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
106
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.
🎯 ...
3
votes
1
answer
120
views
Modal Operator Does Not Receive Middlemouse Release Event In 3D View
I’m encountering an issue while developing a modal operator in Blender where the Middlemouse release event is never received. The operator detects the press event correctly but never gets the release ...
1
vote
0
answers
42
views
How can I open a popup windows with the value already selected?
Okay, this one is a little difficult to explain, but I've made a little addon that lets me use a shortcut to set a keyframe.
It works pretty good but the only thing that bugs me is that I need to ...
0
votes
1
answer
90
views
How to force UI redraw in context.window_manager.invoke_popup() for real-time progress updates?
I'm creating a popup UI using context.window_manager.invoke_popup() to display real-time progress while downloading content from a remote server.
However, the popup only updates when there's mouse ...
0
votes
0
answers
33
views
can you bake geometry nodes from a script or command line
I have a geometry node setup with a long running simulation, that takes a good hour to bake. I would love to set up my workflow so that I can automate the process of baking it, then setting off the ...
0
votes
0
answers
25
views
Motion tracking with python API from script
I've been trying to create a script to allow me track the camera in a video in blender.
The reason for this is such that I can later add a 3d model in the video. I want to do all of this with scripts. ...
2
votes
1
answer
51
views
Problem with getting a current context inside a modal operator
The following modal operator (after launched from F3) should report the type of left-clicked screen area.
*But instead of reporting the type of clicked area - it reports the type of area from which it ...
1
vote
1
answer
53
views
Some objects in a collection are None
I have a collection of objects; I want to render one of them at a time quickly and easily. I wrote a script, and I've pasted below what I currently have:
...
1
vote
1
answer
88
views
Access the active viewlayer name or render engine in a shader node's driver
I'm trying to find a way to fetch the active view layer name or render engine via a driver in shader nodes, the idea would be to use this as a way to customize the shader depending on the view layer ...
0
votes
1
answer
51
views
How to access 3D Viewport Text Info overlay using Python?
Is it possible to retrieve this text using Python? Reconstructing it is not an option. The reason is that I need to know whether a Viewer node is active, and this information is not exposed in the ...
0
votes
0
answers
51
views
Mass ungroup procedural materials [duplicate]
I have bunch of procedural materials, most of them use multiple nodes grouped together under one custom node, which has input values and a BSDF output. I want to ungroup all of them, as in remove the ...
0
votes
0
answers
36
views
Script to convert After Effects Camera rotation to Blender
I have After Effects ExtendScript (.jsx file that I exported from Google Earth Studio) with camera movement and camera rotation animation. In After Effects camera works correctly, but when I'm trying ...
0
votes
0
answers
34
views
How to Replace Geometry Nodes Modifiers Across Files and Reapply Driver from Controller?
I have 20 different .blend files. Each file contains the same 20 models, each with a unique name like Model01_Master, Model02_Master, and so on. Each of these models uses a Geometry Nodes setup that ...
0
votes
0
answers
50
views
Base Color not being captured in baked textures, using procedural textures
I am trying to bake procedural textures. The base colour always bakes as black. All other textures (roughness, metallic, AO and normal) seem to be fine. Strangely even diffuse texture bake worked fine....
0
votes
0
answers
21
views
Custom Rigify Script: Add controls to the Rigify menu for activating/deactivating constraints
can someone point me in the direction on how to add custom controls in the Rigify menu (n-panel) via the rig-creation-script in the meta-rig.
I can't seem to find any scripting guide for Rigify (what ...
1
vote
1
answer
21
views
Independently controls the enabled property of multiple buttons arranged horizontally on same row in a panel
I used UILayout.column_flow(...) and UILayout.operator(...) to arrange buttons horizontally in a panel.
These buttons need to ...
2
votes
1
answer
50
views
How to cycle through Outliner entries for an object in multiple collections?
In the Outliner, when an object exists in multiple collections, it appears more than once as separate list entries under each collection it belongs to as expected. If I have an object that is the ...