Skip to main content

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
-1 votes
0 answers
26 views

Add a custom color legend in Blender view [closed]

I would like to build a Python script that can draw a colored legend in the Blender interface. As an example, see the image below. Any idea how to do that?
Alex Mekx's user avatar
2 votes
1 answer
53 views

Script to rearrange vertices evenly

I want to be able to run a function like Space in Loop Tools from the script editor. Only extracted functions related to ...
InamuraJIN's user avatar
0 votes
0 answers
8 views

(Python) Change the bone roll of a list of bones in variables

So I've had to store some bones in variables because I want to call on them even if they have slightly different names. I want to change the roll of a list of these bones, like this: ...
mienaiKnife's user avatar
0 votes
0 answers
25 views

Is there a program that merges convex geometry so that a mesh is represented by the fewest number of convex objects? [closed]

I need help finding a merging algorithm ,that is, one that merges any 2 adjacent pieces of geometry (basically 2 mesh objects that share an edge somewhere) that form a convex one, and do this as many ...
Clorox Beach's user avatar
3 votes
1 answer
74 views

Issue with building a version of Blender 4.1.1 (GooEngine)

I've been trying to build a version of Blender from its github. It kinda works i can open it fine and work on it. But in the cmd prompt, i get this message: ...
Melabr's user avatar
  • 33
0 votes
0 answers
21 views

Adding drivers to mesh vertices and saving blend file crashes python script non-deterministically [closed]

I am using bpy version 4.1.0 (and Python v3.11.4) to write a blender python script and I've run into a really strange issue. I am trying to add drivers to ...
niran90's user avatar
  • 101
0 votes
0 answers
22 views

Set bpy.data.images.pixels from top left instead of bottom left

I have image data in the form of a byte array, and after converting it to floats and plugging it into bpy.data.images.pixels it imports nicely into blender. ...
snipers500's user avatar
0 votes
1 answer
16 views

Load properties from scene in another blend file (without contents)

I'm trying to load scene properties from a given blend file into the current one using bpy.data.libraries.load() ...
mugwortz's user avatar
0 votes
0 answers
27 views

Error when trying to use modifier tool [closed]

As the image below, I get this kind of "Python: Traceback" error message when trying to use the modifier tool. Will anyone know the solution to this? Many thanks :3
Necro_Nexus's user avatar
0 votes
1 answer
39 views

Including external Python libraries in Blender addon

I am developing a Blender addon, which needs few external Python libraries (e.g. scipy, pandas, etc). I was wondering about the best approach for including them into a "stand-alone" software ...
Alex Mekx's user avatar
-1 votes
1 answer
15 views

Server GPUs are not being detected by Blender Cycles CUDA?

I have a shared server with 8 RTX A5000s and am trying to enable GPUs allocated via CUDA_VISIBLE_DEVICES=... when running blender. The code I have so far is: ...
Nick M.'s user avatar
2 votes
0 answers
20 views

How to Get All Possible Values of an EnumProperty in Blender Python [duplicate]

I'm developing a script where I need to retrieve the available values of some EnumProperties in Blender. I found a similar question already answered here. However, ...
RodrigoGama's user avatar
0 votes
0 answers
32 views

How to remember the ring on the cylinder

I am using a cylinder to perform Boolean cuts on a cube After the cutting is completed, I want to choose the rings on the original cylinder,like the picture show Can selection be made through certain ...
mengyuanlan's user avatar
1 vote
0 answers
12 views

Map bpy Object to USD prim during export?

Is there any way to map a bpy Object to a USD prim in the python USDHook? I tried by name which worked for awhile until I hit/discovered both "." and "-" bpy object names are ...
Andrew Wilson's user avatar
5 votes
1 answer
151 views

How to Print to Console When Hidden?

I'm trying to print to the console in Blender using the following function. However, it does not work if the console is not in view (i.e. it's not part of ...
fny's user avatar
  • 153
0 votes
1 answer
28 views

Python While Loop Not Working?

I was trying to make an infinite while loop for my project, however, for some reason the code refuses to proceed past the first iteration. For reference, the driver is meant to make the circle mesh ...
Chris Moliere's user avatar
0 votes
1 answer
34 views

Python: Link Join Geometry node and Group Output

I have this code that creates a bunch of Obj Info nodes and joins them with a join geometry node. It is supposed to end by linking the Join Geometry node to the Group output node but it's failing to ...
Cornivius's user avatar
  • 1,644
3 votes
0 answers
34 views

How to get Named Attributes in Geometry Nodes Modifier in Python

How to get Named Attributes used in Geometry Nodes Modifier via API? I want to get a list represented by strings ...
X Y's user avatar
  • 5,963
0 votes
2 answers
35 views

Python: Create a Geometry Node set up to join multiple Objects

Is it possible to use a python script to generate a geometry node set up like this? As in, selecting all the objects, with the cube as the active, and then running the script to automatically generate ...
Cornivius's user avatar
  • 1,644
3 votes
2 answers
75 views

Interface Panel not Updating correctly

i'm currently trying to add presets to the addon i'm developing, while creating and loading those presets works fine, updating the values in the panel that the properties are used in does not work in ...
Chris's user avatar
  • 865
2 votes
1 answer
56 views

How to determine whether the FCurve array_index is targetting a specific property?

This question is within the context of Geometry Node and drivers. Using the Python API, we can retrieve the drivers associated to Geometry Nodes of a given node tree this way: ...
Alio's user avatar
  • 85
0 votes
0 answers
10 views

Particle system Alembic/USD export issue [duplicate]

I am facing the export issue for ever type of simulation in blender, tried Alembic/USD for flip fluids, RBD labs for ground destruction, particle system, But nothing is exporting. Tried all type of ...
pratik khilari's user avatar
0 votes
0 answers
44 views

Is there any way to get the face/vertex normals as it is rendered via python?

Let's get a bit more specific here. In my previous question I mentioned I have a mesh with flipped/misoriented UVs, as it was originally textured for an engine that didn't care about the orientation ...
Digital_Utopia's user avatar
0 votes
1 answer
20 views

How to pause function call(back) for ie intproperty value setting, which has update function?

We have ui panel with intproperty & stringproperty fields (all those below 'timezone'): ba_props.py all those properties have 'update=update_coordinates' ...
aum hren's user avatar
2 votes
1 answer
25 views

How to check whether a mesh has Custom Split Normals layer data from python API

I'm tring to get an infromation on a mesh, whether a certain mesh has Custom Split Normal Layer Data or not. I'm not sure how it's stored on the mesh data and how to access the data from python API. ...
Miumiu's user avatar
  • 319
3 votes
1 answer
62 views

possible to change sub-shortcuts of basic tools like 'move' [bpy.ops.transform.translate]?

Hello Blender Community! I'm an experienced 3D artist, and I am trying to switch to Blender completely now. For this, I'm converting many tools I gathered from 3D Software like Maya/3DsMax or ZBrush ...
Martin H.'s user avatar
0 votes
1 answer
47 views

How to change exporting scale using Python?

When we export an .stl via File>Export>STL - we see a window which has a Scale variable. This one: • This variable is named ...
Yaroslav's user avatar
  • 543
0 votes
0 answers
24 views

Show context menu addition only for object custom properties?

I am looking for a bpy.types.?????_MT_context_menu (or similar) so that I can insert an item Copy Color Property as new Driver for a script that will help me past ...
james_t's user avatar
  • 5,549
1 vote
0 answers
17 views

How to make Collection sockets working in addon panel? [closed]

I can´t figure out how to enable editing collection inputs in N-panel. Thanks for any help
RobenSikk's user avatar
3 votes
2 answers
105 views

How to reload ONE particular UI script? (an alternative to 'Reload Scripts' )

My add-on edits Blender's UI scripts. To apply changes to UI - edited scripts should be reloaded. For this purpose I use bpy.ops.script.reload() It does the job, ...
Yaroslav's user avatar
  • 543
-1 votes
1 answer
34 views

My Blender 4.1 whit error AttributeError: 'bpy.app' object has no attribute 'version_char' [closed]

is this : Traceback (most recent call last): File "C:\Program Files\Blender Foundation\Blender 4.1\4.1\scripts\modules\addon_utils.py", line 376, in enable mod = importlib.import_module(...
Paulo Petris's user avatar
0 votes
1 answer
17 views

bpy.ops.transform.skin_resize script issue

I am iterating through vertices and applying `bpy.ops.transform.skin_resize" to each vertex. In the info panel, I can see that the correct value is being applied to each vertex, but in the ...
Gregory Driscoll's user avatar
1 vote
0 answers
27 views

How can I determine if the Dope Sheet menu state is expanded or closed via Python?

Is there a way I can access certain UI elements through a script in Blender? I am trying to access information within the Dope Sheet Editor. One thing I would like to achieve is to determine if a menu ...
Axel Olsson's user avatar
0 votes
0 answers
25 views

Use rigid body physics with python

I want to drop a sphere into a curved pipe and have it bounce along the edges realistically but does not come to a stop. I tried using rigid body but the ball comes to rest after a bit. I played ...
Broly's user avatar
  • 113
0 votes
0 answers
31 views

How to add your own modifier via Python

I'm very new to the scripting scene. I want to create and add my own modifier in the modifiers panel so I can work with it there rather than needing to deal with the script itself. I looked and saw ...
Lazer670's user avatar
1 vote
0 answers
17 views

Unable to reproduce armature bone rotations from .bvh import

I am trying to format the bone rotations of an armature in the way they are formatted inside of a .bvh mocap file. I thought I would be able to obtain the 3D Euler rotations as they seem to be written ...
wolfg269's user avatar
0 votes
0 answers
13 views

Clarification on Using `add` and `move` Methods with CollectionProperty

I'm working on a Blender add-on and I've been trying to understand the correct usage of the add and move methods with ...
Pluglug's user avatar
1 vote
1 answer
21 views

Auto updating blender python scripts working in UPBGE?

Changing variables or functions within the blender scripts should normally be auto updated. I wanted to select a face on the plane added to scene and extrude it for several units. At the beginning no ...
blendpro's user avatar
  • 111
1 vote
0 answers
21 views

Object flags per render Layer and multi renderLayer workflows

I have been building my own pipeline on top of Blender for a few months to make my own short film and am at a point where I think I need to take a real deep dive into blender dev. I come from a vfx ...
Jwood's user avatar
  • 11
-1 votes
0 answers
20 views

Copy custom properties and their drivers from selected object to target with a custom name

I've been trying to mess with ChatGPT and MS Co-pilot for some time now and they manage to give me a script that does what I ask, except with the drivers, it always chooses the variable property type ...
J4k996's user avatar
  • 1
1 vote
1 answer
18 views

bpy.Mesh.from_pydata create bad faces

I am new to blender scripting so this might be a stupid question. I used scipy to create a spherical voronoi and I want to turn it into a mesh with ...
John Cheung's user avatar
0 votes
0 answers
27 views

Is it possible to get a callback when the selection changes in the graph editor?

Is it possible to get a callback in Python when the selection changes in the graph editor? I need to synchronize a custom property with the coordinate of the selected point in the graph editor, and ...
gfytrbbbaa's user avatar
0 votes
1 answer
15 views

Algorithm for retargeting facial bone animation (location only)

I am looking for a method to automatically retarget facial bone actions between two identical rigs with different morphology, so that poses from the source rigs can be used on the target rig. Relevant ...
f.bra's user avatar
  • 142
0 votes
0 answers
18 views

Rotate an object around its origin with an arbitrary (imported) global axis. Do it while keyframing. Do not rotate around root's origin

Can someone explain how to do this, rotate around an object's origin, not the root object, Rotate objects around their origin along a global axis (scripted) without bpy.ops but do it in terms of ...
John Carlson's user avatar
2 votes
2 answers
32 views

Shrink an object with respect to global coordinates

I have checked the following site but cannot understand it well. How to set child object world scale using python? I am having trouble executing the Script drawn here. The goal is a Script that ...
mml's user avatar
  • 612
2 votes
3 answers
346 views

How can I determine direction of flipped UVs?

I'm working with a mesh created for a rendering engine that has no problem with UVs folded upon themselves, when using a normal map. The destination engine certainly does however, so it's important ...
Digital_Utopia's user avatar
2 votes
0 answers
18 views

Draw object selector property without drawing entire pointer property button

I want to draw just the datablock selector button from the pointer property ui: I tracked the operator down to bpy.ops.ui.eyedropper_ui, but when I draw it in a ...
Strike Digital's user avatar
1 vote
0 answers
13 views

USD Import Context Error

I am trying to import a USDC file, I am using a custom built QT tool that has a UI, that I am using to manage my assets but each time I try to import something I get a context is incorrect issue. Any ...
Shamiel's user avatar
  • 11
2 votes
1 answer
30 views

How to avoid persisting bpy properties to .blend files

I have a few operators that are effectively batch scripts that perform bulk operations on objects in a scene or .blend file. Each operator is a one-shot thing that has no need for the followup ...
Foxcapades's user avatar
3 votes
2 answers
44 views

How to Describe Infinite Lines

I would like to create a script to shrink an object. In doing so, I would like to run an infinite line (along XYZ or other axis) along the object in modal mode. What kind of script would make this ...
mml's user avatar
  • 612

1
2 3 4 5
265