Questions tagged [python]

Python is an 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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
9 views

Highlight certain parts of text in VSE using python

I wanted to highlight a certain part of a text string with a different color like the image below. Is this possible in Blender VSE? How should I approach this?
user avatar
0 votes
0 answers
17 views

How to create a new blank empty area?

I would like to remove the area, yet leave the screen itself(red box) and create a whole new empty black area(light blue area) in that screen for making my own editor type. I've looking for awhile in ...
user avatar
1 vote
1 answer
12 views

How do I make operator properties show up as a dropdown in keymaps?

I've just learned about property definitions in operators. I can't find an answer on how to set them up in a way that their possible options appear as a dropdown in the Keymap panel. Like this one: I'...
user avatar
  • 194
0 votes
0 answers
24 views

object.select_set(True) makes item active, not selected [duplicate]

I'm trying to add a simple triangle to a scene (with Blender demo BMW) using python script. I then want to enter edit mode, select a vertex and then move 3D cursor to that vertex, exit edit mode and ...
user avatar
4 votes
3 answers
281 views

driver not working [duplicate]

I want to use the folowing driver: abs(((frame+45) % 90)-45) But it does nothing. I tried also #abs and ...
user avatar
0 votes
0 answers
21 views

Importing .obj files and rig info file with script

I have .obj files(mesh) and corresponding rig info .txt files. rig info files have information of joint, root, skinning, and hierarchy of joint. I want to import mesh and rig info to a Armature and ...
user avatar
0 votes
0 answers
23 views

How can I assign a material based on CSV data?

Is it possible to change color of a mesh based on external CSV data? I have a CSV file with two columns. One column must refer to/identify a mesh in the Blend file, the other columns displays a '1' or ...
user avatar
0 votes
0 answers
52 views

In what situations would you use the trigonometric functions (sin,cos,tan) in blender? [closed]

In what situations would you use the trigonometric functions (sin,cos,tan) in blender?
user avatar
1 vote
2 answers
29 views

Exposing Variables in addon OR opening file through addon

I wrote a script, which imports a .stl file and does stuff with it. Now I want to convert the script into an addon. Currently the file and directory are hardcoded, which doesnt make much sense in an ...
user avatar
0 votes
1 answer
12 views

How can I speed up this bake script I wrote?

I wrote a script that handles baking objects textures into an image node that is then attached back to a bsdf node. It works well for the most part. It's just really slow. Like 45 seconds - 90 seconds ...
user avatar
  • 163
0 votes
0 answers
41 views

Blender 3.0 and above does not recognize shader node created by 3rd party addon

The addon is used to export .x and .mdl files for use in Microsoft FSX and Lockheed Martin P3D flight simulators. It is open-source, created and modified by various people over the years. There isn't ...
user avatar
  • 121
0 votes
0 answers
24 views

Could you provide feedback for my Blender Game? [closed]

I finally managed to create a game using Blender and would appreciate any feedback. Thanks. https://vagabondgaming.itch.io/soulquest
user avatar
0 votes
0 answers
16 views

Is there a way to select blender project inside python script without being in blender console? (Just python script without blender console)? [closed]

I was wondering if there is a way to select blender project with just only python script.(I dont have a script and I been trying for weeks now and no result.) Like for an exmaple I have an python ...
user avatar
0 votes
0 answers
26 views

Custom Gizmo Operator the alters the behavior of Blender's falloff

I am trying to make a tool in Blender that mimics the "Element Move" tool in Modo. Not necessary to view this but to get an idea here is a quick summary of what the "Element Move" ...
user avatar
0 votes
0 answers
21 views

Python: How to link custom node tree to object (like shader nodes)?

How to make the following custom node tree be linked to objects, similarly to the way shader nodes are? Python code from the Blender Template: ...
user avatar
  • 416
0 votes
1 answer
28 views

An array of 3D arrows (python in Blender)

I am new to Blender and I want to create an array of 3D arrows; the array itself is 2*2 (constant space between each object) but the arrows are 3D. I hope to write a python code for it but I don't ...
user avatar
  • 1
0 votes
0 answers
12 views

How to add item to object parent popup menu in Blender >= 3.0

I am able to add an operator to the Object > Parent menu in the 3D Viewport, however; I would like to add the operator to the ...
user avatar
0 votes
1 answer
13 views

Need help with script that loops through a collection and bakes objects

So I'm having some difficulty with a script I wrote that should loop through a collection of objects and bake the materials for each object. I feel like I'm pretty close, but the script is failing at ...
user avatar
  • 163
4 votes
1 answer
106 views

Is it possible to set specific space area types with hotkeys?

For example, I'd like to set a custom hotkey to change a window to shader editor specifically. The way it works right now is that you have major types of area types ...
user avatar
  • 194
4 votes
1 answer
102 views

Why can't I reach this specific keybind through Python?

I'm trying to reach view3d.view_qcd_slot allegedly located inside Object Mode category. But I'm getting ...
user avatar
  • 194
0 votes
1 answer
39 views

How to set context to edit mode

I've been reading through this page on how to change the context of a Python script so that the poll is correct. I recently ran the AssetGen addon that broke because it reported that bpy.ops.uv....
user avatar
  • 2,999
-1 votes
0 answers
16 views

Help with Blender Python Syntax add_mesh_torusknot.py [closed]

Working code: (See comments) NOTE: What's been added is buggy and imperfect, but, it works as intended aside from that. ...
user avatar
  • 519
1 vote
1 answer
25 views

How to enable/disable all keybinds of the same identifier/operator with Python?

I found this working code to enable/disable keybinds: ...
user avatar
  • 194
0 votes
0 answers
11 views

Socket Closes between function calls

I have written a module that is installed into Blender via Edit / Preferences... / Add-ons. Overall, it runs fine. A function in this module establishes a server socket: First "socket_runtime&...
user avatar
0 votes
0 answers
16 views

zipimport.ZipImportError: can't decompress data; zlib not available when running script in Blender 2.43

when I try to execute an export script using Blender -P C:\Code\Code\Testing4Flt\Testing4.py in the cmd on Blender 2.43(Python 2.4), I get an error: ...
user avatar
2 votes
1 answer
84 views

GLSL: 2D space transform matrix of Custom Shader

Here is a template of build-in shader to draw a 2D Rectangle in viewport and that is good. ...
user avatar
  • 2,102
1 vote
0 answers
24 views

TypeError: can only concatenate tuple (not "type") to tuple

I try to make a tuple of the classes loaded from a module I get this error: TypeError: can only concatenate tuple (not "type") to tuple Here is the ...
user avatar
  • 163
2 votes
1 answer
27 views

Create NLA transition with Python

Is it possible to create transition between clips with python?
user avatar
  • 845
1 vote
1 answer
26 views

Select/Unselect collections through python script

I am new to blender, I have a bunch of collections say parent collections ( each collection has one or more sub collection say child collection) What I want is , I want to select only one of the child ...
user avatar
  • 13
0 votes
0 answers
26 views

convert 3d viewing coordinates to 2d plane coordinates?

...
user avatar
  • 149
-1 votes
0 answers
15 views

WARN (bke.customdata) [closed]

I try to render my blender project on Linux and i keep getting this message. i don't understand why, especially since the same file would render a week ago. ...
user avatar
0 votes
0 answers
15 views

Camera locations not updating before render (Python)

I am updating the camera position and rendering frames 1 at a time, however, for the render the camera position is not changing bpy.context.view_layer.update() is not doing it I've checked the ...
user avatar
  • 1
0 votes
0 answers
18 views

reading the contents of a .txt file with python [duplicate]

I have a .txt file, containing values like so: ...
user avatar
4 votes
1 answer
60 views

Sorting vertices counter-clockwise

I want to create a face, using given tuples, representing the xyz-coordinates of vertices. For that I need to arrange the vertices in a list. They need to be structured "counter-clockwise" ...
user avatar
0 votes
0 answers
9 views

How to determine what value has changed on scene update

I'm considering writing a Take Manager addon so that Blender can have the same functionality as Houdini's Take system (where you can create multiple "takes" that inherit properties from the ...
user avatar
  • 2,999
1 vote
0 answers
29 views

How can i programmatically create a hierarchy of collections?

I have this code that works nicely, but, I have no idea if this is the correct way to write it. The idea is to have a main Scene collection and all other sub-collections inside but some of them also ...
user avatar
0 votes
0 answers
27 views

Search Box for Custom CollectionProperty

When you have 'particle effects', or 'sounds' or 'actions' (among others), there's a dropdown like this: It lists all items of a data type, and allows you to create a new one, change the active one, ...
user avatar
  • 310
0 votes
0 answers
19 views

Kind of asset selector

I'm beginning in blender, addons development I want to create simple add-ons who's creating some asset And I got a file with some assets, and I want to present them in a panel like the one in the ...
user avatar
0 votes
0 answers
23 views

Baking a Blender modifer to shape keys

I am attempting to export a mesh with a build modifier on it to an gITF animation (to simulate a motion trail). I currently create a curve with the movement data, convert to mesh, and then use the ...
user avatar
0 votes
1 answer
27 views

Exporting Mesh + Material does not work with error message "NO NODES!"

I have the following simple script that draws a cube and color it in red. ...
user avatar
1 vote
1 answer
26 views

Drop Object on Z to Zero

I've been using Serpens to create my own addon, and I have this action that drops one object selected to Zero in the Z axis, and it works really nice, and I got curious to know how to do it in code. ...
user avatar
1 vote
2 answers
42 views

If there is any way in Blender I can use a mathematical formula to control particle density?

I'm trying to visualize something in physics. I have a formula that determines the density of particles at each point in 3D space. How can I visualize this? For example: density=1/r^2
user avatar
  • 11
0 votes
0 answers
9 views

Getting Wrong Confidence Values after dividing hidden and visible vertices point :- Problems with vertice selection

Method :- For confidence interval part I am using to set of group Long edges and short edges vertices group. Step 1 :- Hide all shaft except one Step 2 :- Count the Vertices on both the edges of ...
user avatar
1 vote
0 answers
30 views

Blender error: QuadRemesher doesn't work on my sculpting

This is the first time for me using this addon. Every time I try to remesh my sculpting this error appears on the screen: ...
user avatar
4 votes
1 answer
102 views

Set collection color in outliner with Python

I have this script that creates the collection, but I have no clue where to add the color_tag to it that it works. Thanks for the help. This is the code or at least a piece: ...
user avatar
1 vote
1 answer
26 views

How to change strength of studio light via python? (UPBGE)

Hello I would like to have the studio light strength change from 1 to 0 when entering a new scene. I assume that this is achievable via python, but what would the required script be? Thanks.
user avatar
  • 45
7 votes
1 answer
152 views

I can’t use Python console commands in my custom functions

I’m trying to make my custom function: ...
user avatar
5 votes
2 answers
60 views

Update Float Property Based on Selected Object

I'm writing an add-on and have a float property which drives the thickness attribute of a solidify modifier for the selected object. Currently, the float property displays the last value assigned by ...
user avatar
0 votes
0 answers
13 views

Duplicate parent and children by python,but children are in the wrong place

I use scripts below to duplicate and move one parent and its children. When i move parent to another location and run the scripts, parent.copy() moves from the new original location, but children.copy(...
user avatar
5 votes
1 answer
114 views

Making a Closed Curve Using a Python Script

I'm just trying to make a closed curve using just python for a script that I'm writing. This is what I have so far: ...
user avatar

1
2 3 4 5
217