Skip to main content
The 2024 Developer Survey results are live! See the results

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.

0 votes
0 answers
3 views

where can I find _bpy module?

In bpy module, there is code like this: When import bpy, it will prompts error. import bpy Traceback (most recent call last): File "", line 1, in File "/usr/share/blender/scripts/...
Franson  Wu's user avatar
0 votes
0 answers
13 views

No module named 'ezdxf'

I'm writing an add-on in vscode to export some geometries as dxf files. When I try to import ezdxf, i get an ModuleNotFoundError: No module named 'ezdxf'. I have ezdxf installed on my computer and can ...
JarodH99's user avatar
1 vote
0 answers
7 views

Runtime error when rendering animation with a frame_change_pre hanlder defined

To visualize time dependent data I make use of handlers. The idea is to change the geometry every time I change the time. A minimal working example is shown here: ...
SimonCan's user avatar
0 votes
0 answers
12 views

Relative Quaternion rotations in Blender Python

I'm trying to calculate the relative/local rotation between two Quaternions q1 and q2. The Quaternion represent a rotation in ...
David B's user avatar
  • 423
0 votes
0 answers
9 views

I want to create a custom asset library with different .blend objects and save it as a combined asset to use in a differrnt scene [closed]

I want to create a custom asset library with different .blend objects and save it as a combined asset to use in a different scene ...
AASIM MIRZA's user avatar
0 votes
0 answers
9 views

Different rotation directions caused by view orientation

I use pyhton "bpy.ops.transform.rotate()" to rotate the right angled pipe I made Set my transform orientation to Normal and Axis to Z. When I change my perspective from small to large, I ...
mengyuanlan's user avatar
1 vote
0 answers
10 views

Is it safe to use a Blender Object as a Python dict key in a background bpy script?

From the Blender Gotchas page I know that Object references are invalidated on Undo/Redo, but what about background script execution where no Undo is performed? Can I safely use a ...
Rush's user avatar
  • 11
1 vote
1 answer
21 views

How to lock the always on top subinterface when run a operator

Open a always on top subinterface Run a operator modal ...
X Y's user avatar
  • 6,248
0 votes
0 answers
16 views

module has no attribute 'register' - Installing Blender 4.2 add-on [closed]

Good day, all! So I finally made my add-on work as it should, but not Blender decided to change how add-ons works) This is great, but now my add-on not installing. I've removed bl_info from script and ...
Dmitry Stogov's user avatar
1 vote
1 answer
25 views

Add text information directly to the viewport for 5 sec

I am trying to add text information directly to the viewport so that it would be displayed for 5 seconds after the button is pressed and then disappear. I have not been able to realize this using ...
Andrew's user avatar
  • 83
0 votes
0 answers
24 views

Check if any popup is running in 3D viewport

How to check if any popup is running in 3D viewport like adjust last operation menu, not include N-Panel I am looking for a method to check this to resolve my addon bugs in blender 4.2. Script for ...
X Y's user avatar
  • 6,248
3 votes
0 answers
17 views

how can i import bmesh module just like bpy?

I try to install bpy to my local python package.It work well,but I just want to import bmesh is not found.What can I solve it? I git clone blender git,and run "make bpy" to import bpy.
沧笙踏歌's user avatar
0 votes
0 answers
13 views

Blender scripting, run the operator after the save window is closed?

have a problem with my addon. I have a button that is intended to first save a copy of the file (a basic save copy window shows up) and then it runs some operations on the file's model etc. So ...
amelylina's user avatar
1 vote
0 answers
29 views

How to handle invalid context in Blender 4.0 after render [duplicate]

In my Python script, I rotate a randomized dice with a rigid body, play the animation using bpy.ops.screen.animation_play() to apply the physics, and then render ...
Mp Thompson's user avatar
-2 votes
1 answer
27 views

AttributeError: 'NoneType' object has no attribute 'type' [closed]

Good time of the day, all. Can't get rid of this error message. Although the function is working, but I get "AttributeError: 'NoneType' object has no attribute 'type'" error message. Code: <...
Dmitry Stogov's user avatar
2 votes
1 answer
79 views

How to get not active object?

What I'm trying to do is select two objects, add Data Transfer modifier to active object in selection and then use not active as source. So, active object is ...
Dmitry Stogov's user avatar
1 vote
0 answers
18 views

Making a basic n panel template with working properties [duplicate]

I'm trying to display some different property types on a n-panel. I would like to level up from using operator buttons, but I'm having trouble figuring out how to make a panel with some properties. <...
Yank Scally's user avatar
0 votes
0 answers
25 views

Georeference 3D data generated using BlenderGIS

I generated a 3D model (terrain + extruded buildings) using BlenderGIS,and I was wondering if I could integrate them into an ifc project having the right georeferencing using BlenderBIM. The problem ...
aogino's user avatar
  • 11
0 votes
0 answers
12 views

Binding of machine gun ammunition chain

I made the skeleton of a machine gun, and because I want to achieve the effect of the remaining bullets disappearing bit by bit after finishing the bullet in UE, the parent-child relationship of my ...
Phantom54's user avatar
0 votes
0 answers
53 views

How can I transfer settings from Blender 4.1 to 4.2? [duplicate]

I recently installed Blender 4.2, but it’s starting with the default factory settings—meaning all my key mappings, shortcuts, and startup preferences are gone. It seems like Blender 4.2 starts from ...
Sjun's user avatar
  • 1
0 votes
0 answers
15 views

Regarding the issue of Blender importing FBX large files being too slow and often unresponsive

May I ask everyone, it always takes a long time for me to import FBX model files that exceed 150M or 200M in Blender, and I often encounter unresponsive situations? How can I solve this problem? First,...
MA__AM's user avatar
  • 15
0 votes
0 answers
8 views

How can I rig human-looking face onto a 3d FLAME mesh talking head?

Noob question here as I've just started working with Blender and 3d models: I'm currently working with Blender 3.4.1 and I'm using Python script which runs blender on ...
skidjoe's user avatar
  • 101
0 votes
0 answers
8 views

Copy/Paste and Duplication Differ with Cloth Simulation

I have a baked cloth simulation that looks as follows: I need to create meshes for each part of the shirt, so I copied and pasted the shirt repeatedly and created a mask for each part of the shirt ...
fny's user avatar
  • 153
4 votes
1 answer
218 views

How can I run a function when opening Blender that requires context?

My initial attempt was to call that function directly from the register part. However, I soon realized that this isn't possible for a function that needs context. I also tried using a load_post ...
Tsybe's user avatar
  • 533
0 votes
0 answers
14 views

How can I run code whenever any object is added? [duplicate]

When I add an object, I want to run some initialisation code on it first. How can I do that?
Yank Scally's user avatar
-1 votes
0 answers
18 views

How to access data (point_data, cell_data) written by meshio in Blender shader editor? [closed]

Conext: I have a mesh (N points, M cells) in my Python script (outside Blender). I associate to each point and to each cell a ...
Adel Redjimi's user avatar
0 votes
0 answers
13 views

Index Error Concerning Bound Box When Exporting GM [closed]

As the title says, I'm getting an index (or location unknown) error when exporting a GM. I'm not very experienced with Blender, but it seems Python cannot locate the bound box and I'm uncertain how to ...
jh.bovenkerk's user avatar
1 vote
0 answers
20 views

Subtracting overlapping 2D mesh with Python using Blender API

Supposing I have two 2D mesh objects, A and B. I would like to programmatically subtract the overlapping portion of one from ...
SKNB's user avatar
  • 121
0 votes
0 answers
13 views

How do I close an area using Python in Blender 4.1? [duplicate]

I want to close a panel from within my Python addon. Existing questions and answers seem to yield results that no longer work as they are very dated. The suggested code to run is: ...
Kristopher Ives's user avatar
2 votes
1 answer
31 views

How can I add a library override to a non-API custom property from a linked file with Python?

The question regards setting custom properties of a linked file via Python. Because when setting the property like ...
iclemens's user avatar
  • 117
0 votes
0 answers
13 views

Save an image of an area by it's index [duplicate]

General Question: Is there a way to capture a raw image, so no overlay or gizmo, of an area within Blender only by its index? I would need a script that writes the pixels of the area to an image ...
Erasers45-Studios's user avatar
0 votes
1 answer
77 views

How to recalculate pose bone rotations when armature bone rotation is changed?

I'm trying to import bones and animation data in to blender. The quaternions I have for each keyframe are correct if the armature's bones do not have any rotation. However I also need to import the ...
taptaptaptap's user avatar
1 vote
0 answers
36 views

Is there a way to restart a modified addon without restarting blender? [closed]

This was answered 10 Years ago. Unfortunately, it doesnt work anymore. It should be a simple console command: bpy.ops.script.reload() However, it only reloads the <...
rhavin's user avatar
  • 111
1 vote
1 answer
38 views

Addon works from Text Editor, but fails to enable from Add-ons preferences [duplicate]

I've written very simple addon that exports triangulated and quad mesh of selected object, deleting all material slots and applying transformation. And all work fine if I run it from the Text Editor, ...
Dmitry Stogov's user avatar
3 votes
0 answers
38 views

How to create unsigned Int property?

I need a property that can accept the 2267538950 number, unfortunately by default Blender uses a signed int range. There was a way to set subtype="UNSIGNED" in the previous versions but it ...
Ігор Спасівський's user avatar
0 votes
0 answers
29 views

Copy framebuffer of 3D View into image

General Question: How can I copy the frame buffer of the currently active viewport to an image within Blender? The following link already addressed the question, however it utilizes a modal operator ...
Erasers45-Studios's user avatar
3 votes
1 answer
58 views

How can I instantiate a Simulation Zone input / output node's socket via python?

I couldn't find an interface like the node tree interface where I can add sockets using interface.new_socket(). In the documentation, the only method I found for ...
Trantor's user avatar
  • 45
2 votes
1 answer
31 views

direction perpendicular to screen

I want to create a script that squeezes a curve along the vertical direction of the screen. Currently, I am using `def get_view_direction(): ...
hutianyi's user avatar
1 vote
1 answer
27 views

Python: Randomly selecting 1 object in a set

I have a set up like this: Where there are 3 or sometimes more grids of different objects one behind the other. The objects are regularly spaced around 20 units in each axis, tho their origins are ...
Cornivius's user avatar
  • 1,896
3 votes
1 answer
78 views

bpy.app.timers.register is lagging Blender

In my blender python script I have a function which reads data from a serial port then moves the position of an object based on that data. I use ...
David B's user avatar
  • 423
2 votes
1 answer
39 views

Correct way of using bpy.ops.import_mesh.stl bpy function?

First time here! So, I'm trying to create a python script that uses bpy (This script is not being used from within blender, but rather bpy is being called from python as a module), and in this script ...
Syl's user avatar
  • 51
0 votes
0 answers
14 views

How can I turn an Object LineArt into a Poly Curve?

I am really new to bpy and I wrote this script: ...
Psyduck Fan's user avatar
2 votes
1 answer
41 views

KeyError: 'bpy_prop_collection[key]: key "View Layer" not found' when launching blender with external script

When I execute the following code within Blender, it works well regardless of whether it's version 3.x or 4.x. However, if I try to use it by launching Blender with a specific argument to open a ...
cscholl's user avatar
  • 315
0 votes
0 answers
15 views

problem with UvRizom

I downloaded the trial version of UvRizom 2024, And I bought the Rizomuv Bridge addon - Blender 2.8+ (https://blendermarket.com/products/rizomuv-bridge) In "RizomPath" I chose this path: ...
Alena Zhuravleva's user avatar
0 votes
0 answers
13 views

is it correct to set the camera intrinsics in this way?

I have a 3x3 matrix inside a calibration file that has the intrinsics of my real room inside it. We will call them fx fy cx cy. I would like to know if the code I have written is correct, as I am not ...
wiseme's user avatar
  • 1
2 votes
0 answers
25 views

Operator called by another operator does not trigger Adjust Last Operation panel

I have an Operator defined as ImportImageOperator which calls another operator ...
stib's user avatar
  • 981
-1 votes
0 answers
23 views

Script for importing an OBJ file as Shape key for blender 4.1

I have blender version 4.1 I’m trying to adapt the script for my version ...
notgrilbi's user avatar
0 votes
1 answer
24 views

How to get the path to an image that the user chooses

I'm using openCV to process an image that is chosen by the user. For OpenCV I just need to get the path to the image, but I'm unable to find anything in the API which lets me just pick a file path (...
stib's user avatar
  • 981
1 vote
1 answer
22 views

Running modal seems to freeze if the mouse is not moving

I've written an addon for baking an animated material to a texture sequence. It works by creating a new image texture to bake to, baking to that image, saving the image to disk, and then moving on to ...
gcs_dev's user avatar
  • 622
1 vote
1 answer
107 views

Control Blending Mode of the Color Mix node through the custom driver

Could somebody point me out on how to control the Blending mode of Color Mix nodes through the Custom Properties driver? I want to be able to choose between Mix, Multiply and Add parameters. I have ...
3DBear's user avatar
  • 835

15 30 50 per page
1
2 3 4 5
266