As of May 31, 2023, we have updated our Code of Conduct.

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

How to get a coordinate of a pivot point of an object with bpy?

How to get a coodinate of an object's pivot point with bpy? (python)
BaraBara's user avatar
0 votes
0 answers
6 views

Connecting PyQt button click event to a separate function in a different module for Blender Tools

So I have created a PyQT tool but now I am trying to segregate it to make it easily readable,earlier I had pyqt UI class, all functions within it in a single module and I was using blender operator to ...
madara_was_right's user avatar
0 votes
0 answers
16 views

Why can't I find text when using the multiprocessing module in blender?

I wrote a multiprocessing module to extract one of the selected bones and perform the task of finding the closest bone. ...
1207 Hooha's user avatar
0 votes
1 answer
16 views

Creating properties dynamically for UI panels in a Blender addon

I'm currently working on a Blender addon, and I'm facing an issue regarding the creation of dynamic properties for UI panels. Specifically, I'm trying to read parameters from a JSON file and display ...
Adrián Delgado Del Sol's user avatar
0 votes
0 answers
10 views

User change hotkey for addon operator

I have code to add hotkey for my operator: ...
ugorek's user avatar
  • 311
0 votes
0 answers
9 views

In bpy, how to a get the amount of VRAM cross platform?

How do I get the amount of VRAM of the hardware the add-on is running on(cross platform)?
tintwotin's user avatar
  • 2,176
0 votes
0 answers
18 views

How do I get a list of all nodes, of all types, in the file?

How would I go about getting a list of all nodes in the file in Python, as efficiently as possible? I want anything that's a node-- shader nodes, geometry nodes, compositor nodes, nodes yet to be ...
SuperFLEB's user avatar
0 votes
0 answers
16 views

Multithreading in Blender Python API

I am trying to make a script that uses a new thread in python to not make blender freeze up. To start a new thread, I use the python threading module. It seems to work because I can create and delete ...
brian turner's user avatar
0 votes
0 answers
26 views

Relative Import with No Known Parent Package: Jacques Lucke Blender VSCode Development [closed]

No matter what addon I use, even if I use the Ctrl+Shift+P New Addon command in the development tool, I always get the following error: ImportError: attempted relative import with no known parent ...
caddev20's user avatar
1 vote
1 answer
19 views

Python: How to get geometry node "incoming output" for Glossy shader?

I am relatively new to blender and its python API and I am trying to define a reflective material similar to what was described in this post: "How to make a "reflective tape" material ...
LooBot22's user avatar
0 votes
0 answers
13 views

is it possible to select/open/show a specific addon tab from script?

I want to select and open in the 3D View sidebar a specific addon tab, but I'm not finding any clue in the docs. I managed to open the sidebar with: ...
joaulo's user avatar
  • 177
0 votes
0 answers
13 views

I'm trying to make 100 drone objects to move from vertices of one mesh to other. And following is the code of the addon that I used [closed]

...
Sanjeet Kotarya's user avatar
0 votes
0 answers
24 views

Random color for each mesh

I would need to export a 3DS-file where each mesh has an unique color and to do this I guess I have to crate a material with an unique color for each selected mesh and wonder how to do this. ...
Max's user avatar
  • 1
0 votes
0 answers
13 views

Python - filling a drop down list with selected object's details

I'm developping an add on to transform 2D plans made of vertices to walls (I extrude them then apply a solidifier modifier). It works great, using a string input to specify a vertex group, but I'd ...
Beb's user avatar
  • 13
-2 votes
0 answers
31 views

Script Python + Blender from Chat GPT, always error: keyword "apply_as" unrecognized; or "bpy.ops.mesh.primitive_gear_add" could not be found [closed]

CLOSED: Activating the "Mesh :: Extra objects" add-on, I see that a new option appear in Add->Mesh: 'Gears'. And there, two more options: Gear and Worm. Modifiing properties, I could ...
EIG's user avatar
  • 1
0 votes
0 answers
21 views

self-made addon cannot be used in other computer (Windows 10 & 11)

Is there anyone else experience the same on other modules or vanilla when installing their customized addon? I'm stuck in this for a long time. I have created an addon that includes other modules (...
Jay's user avatar
  • 1
0 votes
0 answers
6 views

Blender BPY get random object location but ensure object still by camera?

I am trying to randomly place an object in my CYCLES scene. The below function gets a random location within the camera's FoV, but there is a problem: if the object is too far away, it will not be ...
pookie's user avatar
  • 123
0 votes
0 answers
13 views

How to get StringAttribute with foreach_get() method?

I know how to transfer data from the most Attributes with other data types to Numpy arrays with foreach_get() method. Can anyone explain how to do it with ...
Andrey Sokolov's user avatar
0 votes
4 answers
29 views

Script: set origin to selected vertex

I'm trying to write a quick script that will work on all selected objects: Start in object mode Go into edit mode Set the 3d cursor location to the selected vertices Go back to object mode Set the ...
Ebi's user avatar
  • 751
0 votes
0 answers
39 views

How to place a surface in the projection plane of the viewport

I am currently working on an addon where two-dimensional mesh surfaces should be automatically placed in the projection plane of the viewport window (not that of a camera) (note: perspective ...
lcs's user avatar
  • 1
0 votes
0 answers
11 views

Duplicate object and knife project in python

I am trying to code an addon that does the same thing as knife project but duplicates the target object that will be cut operates on the duplicate separates the two cut pieces deletes the one that ...
simone's user avatar
  • 663
0 votes
0 answers
20 views

Blender Nested UI Lists

Please, I would to know if anyone have an idea about How to make a nested lists in blender UI?. "Nested Lists" means I can add children to each list element. The same behavior can be found ...
Mostafa Samir's user avatar
1 vote
1 answer
15 views

Blender Add On : "Measureit", the measurement line generated are diagonal

referring to the title, the line generated using the Measureit add on are diagonal. The following image below are from my scene Blend file of the model.
Kenny's user avatar
  • 205
2 votes
1 answer
23 views

Deactivate Info Log popup - Python: Traceback (most recent call last):

Some scripting errors generate this error popup. Clicking the red X doesn't close the error message, but opens up Blender's Info Log. It fades aways after a few seconds, but during that I can't click ...
Tortenrandband's user avatar
0 votes
0 answers
10 views

How to use cached_property in PropertyGroups

I'm trying to use cached_property to help store unchanging node and socket references for my addon to access quickly. Still, I noticed that it doesn't actually ...
Zach Eastin's user avatar
1 vote
1 answer
37 views

How to export Blender spreadsheet data into .csv file without applying GN?

I created this geometry in Blender GN, and I need to export the 3d coordinates of a list of points(These points are not on the input geometry), the data is already shown in the "Blender ...
miaomiao's user avatar
1 vote
1 answer
23 views

How can I apply a preset to an operator and execute it using Python?

I want to use Python to run an add-on Something like: import bpy bpy.ops.export_mesh.paper_model() But I need to change some settings before I run the add-on. I ...
Paul St George's user avatar
0 votes
1 answer
13 views

Texture Loss in Texture Node during Looped Baking (Python)

I am creating a Python script that bakes the textures for each object in the scene, and then deletes all the shader nodes of the materials of each object and replaces them with image texture nodes of ...
user167693's user avatar
0 votes
0 answers
53 views

How to import BSP files with Python? [closed]

I'm new on this and I want know how to import .bsp files on Blender 3.5 with Python scripts because I try to create my first addon. I tried to import that files by some ways but I had no result, so I ...
MineProgrammer303's user avatar
0 votes
1 answer
30 views

How to run script in a new blender subprocess

In my code I am trying to open a new blender subprocess with this code I am trying to do some action like this how to run a give code = ''' import bpy''' like in code below, in that new blender ...
NamanDeep's user avatar
  • 441
0 votes
0 answers
21 views

Error During Running Python file in a Blender Subprocess from blender

I am working on this code from the post: How can I run blender from command line or a python script without opening a GUI? I am trying to open a blend file and have a script run in that blend file to ...
NamanDeep's user avatar
  • 441
0 votes
0 answers
21 views

How to draw round POINT with custom shader?

I want to draw round POINT with custom vertex_shader and fragment shader. I defined the <...
Karan's user avatar
  • 779
0 votes
0 answers
7 views

Export Quaternion Data from Imported FBX File to Text File

I am importing a motion-captured FBX animation file into Blender and trying to extract the w, x, y, and z quaternion components of each keyframe within the animation for selected nodes into a text ...
Cheast's user avatar
  • 1
0 votes
0 answers
22 views

detect error during Bone Heat Weighting: failed to find solution for one or more bones

I am using the operator bpy.ops.paint.weight_from_bones to generate weight maps from within Python. This works great as long as the weighting algorithm in Blender ...
Gaia Clary's user avatar
  • 3,632
0 votes
0 answers
11 views

Script Indices Change Between Operations

I have an issue with my code where randomly in the middle the indices of faces, edges, and vertices switch between two different patterns. It's not randomized, and yet it isn't consistent where the ...
caddev20's user avatar
1 vote
1 answer
18 views

Can we arrange NodeGroup Sockets with Python?

I'm writing an addon script which can create a new NodeGroup from a set of texture nodes, or add features to an already created NodeGroup. When adding features which require new Input or Output ...
gcs_dev's user avatar
  • 187
1 vote
2 answers
33 views

How to apply an already existing material to an object in Python?

I've searched a bit and gotten close to the answer but I just can't figure it out. I just want to apply it to a context object.
Hyde 's user avatar
  • 21
0 votes
0 answers
43 views

How can I catch events?

I used to use a script to catch events from another operator (WM_OT_event_catcher) as shown in the code below, However, since the blender 3.3 spec change, I can no longer use it. The cause is unknown. ...
mml's user avatar
  • 187
1 vote
0 answers
16 views

Un/hide Specific Collection Elements

Is there any way to specify the collection in which I want to show or hide the elements that are inside it ? Is this line of code useful to do that? ...
Eyus Vila's user avatar
0 votes
0 answers
18 views

props.BoolProperty's update not being called when pressed

I am trying to do a simple floating menu toggles with update functions linked. At the moment the update functions does not get called (not showing up in the console) which means something is not quite ...
MenisPelis's user avatar
1 vote
0 answers
27 views

Can I export the 3D coordinates of part of an object created in Geometry Nodes (without applying the modifier)?

Can I export the 3D coordinates of a part of an object made by the Geometry Nodes to a .csv file (without applying the GN)? For example, I created this road (and its accessories) in Geometry Nodes, ...
miaomiao's user avatar
2 votes
1 answer
34 views

Python: How to get selected collections list?

I can find only active collection with bpy.context.collection, there should be bpy.context.selected_collections similar to ...
Karan's user avatar
  • 779
0 votes
0 answers
16 views

How to get property DIR_path

I have a string property with DIR_path, and wanna get the path like this path = bpy.data.scenes["Scene"].GenTex_props.assets_path But I end up with '...
Keung Mak's user avatar
0 votes
1 answer
24 views

How to get location and rotation object

I'm working on a script that makes a rigid body simulation, I'm interested to get the final position and rotation of my objects but I have not idea how to do considering that I'm pretty new in the ...
Valerio Gianforte's user avatar
0 votes
0 answers
16 views

Adding two objects in Blender-python with a delay

Need your help. I had written the following code ...
gychung's user avatar
1 vote
1 answer
28 views

Python - Extrude vertices while filling them

I want to mimic a behaviour in Blender using Python. I Add a new plane, switch to Edit mode to only keep the vertices, then Vertex mode, select 2 or more neighbour vertices, then extrude them, the ...
Beb's user avatar
  • 13
0 votes
0 answers
21 views

bpy.ops.wm.redraw_timer method causes blender to crash and slow down

in the code block below i wanted to show the number of vertex of the selected object on the screen. ...
Zen Of Kursat's user avatar
0 votes
0 answers
27 views

Blender Script is executing successfully but I can't see the tool in blender UI

I have create this simple blender tool using pyqt but even though the script got executed successfully I can't find the tool in my blender UI. here are my following code modules For execution I just ...
madara_was_right's user avatar
0 votes
0 answers
28 views

Registration and Unregistration of custom generated panels isn't working

I made this add-on script that creates panels for each node in the compositor when the button is pressed. However when I install the addon and remove or disable it only the panel with the button is ...
Erasers45-Studios's user avatar
0 votes
1 answer
30 views

Determine the number of the selected particle system

When a mesh has multiple particle systems, one can be selected in the particle system tab (see image). In my case I have a mane and a tail assigned to a horse mesh. Now I would like to know the index ...
Matthias Müller's user avatar

1
2 3 4 5
248