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

How to add new controlpoints to a curve at a specific time?

If I have a curve, how could I add a new controlpoint at the location in 3D space at time t on the curve? I've tried looking at the docs, and they don't seem to provide a way to evaluate a bezier ...
kyopa's user avatar
  • 133
1 vote
1 answer
34 views

AttributeError: 'NoneType' object has no attribute 'modifiers'

So I've been trying to add Geo Nodes modifier to a created cube through custom UI panel, even though it works as intended, Blender shows me AttributeError. How can I fix this? (I'm new to coding so ...
Veeran's user avatar
  • 33
0 votes
1 answer
19 views

Blender 3.5.1, using bpy how can I get Color Attribute, Render Color name?

as the question mentions, I want to get the name of the Render=On vertex color. I can get the index using attributes ...
Satyam's user avatar
  • 3
2 votes
1 answer
16 views

When scripting in python, can you parent and later reparent?

Is "parenting" something you only use when the parenting relationship will never change? The reason I'm asking is because I successfully make animations with keyframes involving parenting ...
jblend's user avatar
  • 21
0 votes
0 answers
36 views

Improve speed of creating keyframes

See edit below. We are looking to visualize scientific data in Blender as animation tracks. The data on every frame is important, including even small fluctuations, so interpolating between keyframes ...
Rob's user avatar
  • 1
1 vote
0 answers
18 views

Rename vertex_group in all associated modifiers

The mesh contains different Vertex Groups. There are many objects that use the same Mesh. Moreover, these objects have Mask modifiers that show only a specific Vertex Group. If you rename Vertex Group,...
Vadim Tss's user avatar
0 votes
1 answer
27 views

How to update the ViewLayer without warnings?

I want to update the view layer but I am getting this warning. Should I ignore it or handle it, How? related to: How to hide/unhide objects in a particular ViewLayer? ...
Karan's user avatar
  • 2,381
3 votes
1 answer
48 views

How to hide/unhide objects in a particular ViewLayer?

I am trying to hide/unhide objects in a particular ViewLayer but it's hiding in the current view layer only. ...
Karan's user avatar
  • 2,381
0 votes
0 answers
15 views

Body obj always take on the color of lower garment (Python API)

So, basically I have a SMPL body mesh(without texture cordinates), a shirt garment mesh(with texture cordinates) and a pant garment mesh(with texture cordinates). Using blender I load the load first ...
Zen's user avatar
  • 1
0 votes
1 answer
24 views

Blender Addon Question - Change World Color

Is there a way to add an option to change the World Surface Color and Strength settings via a button? I already coded out the panel and everything, but maybe it's just based on the specific context, ...
FrostByte Studios's user avatar
2 votes
0 answers
16 views

Check if viewer node is on or off

Is it possible to check with python if a viewer node is on or off? So this: vs: I tried hide, active and ...
clankill3r's user avatar
  • 1,233
0 votes
0 answers
32 views

How can I prevent operator from blocking Blender Interactions during execution?

I'm new to Blender Python programming, and for a personal project, I'm experimenting with creating a Blender Python addon. I aim to execute an asynchronous GET request when I select a button in a ...
kernage's user avatar
0 votes
0 answers
31 views

There are some errors in the script I wrote. Can you help me? (About the geometry data panel)

Then I got help from @Harry McKenzie who helped me with the context issue, but after I re-modified the script, it didn't give an error, but bpy.ops.mesh.customdata_bevel_weight_edge_clear() bpy.ops....
LIN's user avatar
  • 1
0 votes
1 answer
67 views

Transfer (float) vertex-attribute to vertex-weight, to allow GeoNodes to control subsequent Armature binding

In Blender 4.1 or higher, I want to write a custom modifier, which transfers values from a vertex attribute (on geometry generated by geonodes) to a vertex group (usable with other modifiers). This is ...
Mark K Cowan's user avatar
2 votes
0 answers
32 views

The same object in different collections. How to determine which collection contains the selected object (highlighted in blue) in outliner?

The screenshot shows the outliner diagram. The Cube object is in two different collections - Collection 1, Collection 2. Using LMB I can select the Cube in Collection 1 and leave the object unselected ...
Vadim Tss's user avatar
0 votes
0 answers
28 views

How can I add a FloatVectorProperty to my addon layout? [duplicate]

How to properly register a FloatVectorProperty? When I do: box.prop(self, "amb_day_color") where ...
Oleg Kivasev's user avatar
0 votes
0 answers
22 views

How to clear the geometry data panel inside the data?

I need some help. Is there any way I can check auto smooth in normals, and then the Angle is 30 degrees, add custom split normals data in geometry data, clear edge bevel weight, clear vertex bevel ...
LIN's user avatar
  • 1
2 votes
3 answers
45 views

How to dynamically determine which file is selected programmatically in the File Browser Editor?

My question is not about the File Browser modal window, but about the Editor. I found this other question that shows how to get the selected files from the ...
SO_fix_the_vote_sorting_bug's user avatar
0 votes
0 answers
23 views

Blender 4.1 python-controlled sculpt brush strokes: how do I get strokes instead of dabs?

I'm writing a script to generate brush thumbnails for my library of alpha brushes. I can't figure out how to make proper brush strokes (continuous movements) with Python - only individual dabs in XYZ ...
Emily's user avatar
  • 361
1 vote
1 answer
74 views

How to select only deformation bones?

Is there a way to select all bones from the vertex group of the mesh? I have too many overlapping bones that are very tedious to work and some are non-deformer which I wanted to hide and only work ...
Wissam Seaifan's user avatar
2 votes
2 answers
24 views

How to read and change value of edge crease in blender 4 via python script (MeshEdge.crease property has been removed)

as MeshEdge.crease property has been removed in blender 4, how can I check and change the value of an edge crease ? I used to do this to check edge crease value and set it to 1 if the value was over 0....
cscholl's user avatar
  • 315
0 votes
1 answer
84 views

gltf export file size is too large

i need a export of my blender project to gltf format to show real time on my website. the output generating process working good but the size of file is about 155 mb and the output have a lot of ...
peiman F.'s user avatar
  • 103
0 votes
1 answer
65 views

Blender 4.1 addon to add time to rendered file names

I'm trying to make an addon for Blender 4.1 that adds current seconds to rendered file name. We need it for our workflow when rendering overnight, to check later which frames had the biggest gap ...
Matt's user avatar
  • 3
0 votes
0 answers
21 views

I can't import XYZ file into Blender using Atomic

I am trying to import an xyz format to blender, but suddenly this error message appears. Any idea?. I am using Blender 2.92.
Vanya_BMF's user avatar
2 votes
1 answer
28 views

Python: canvas-flip action is merged with the next user action in undo history

I wrote a simple add-on to enable canvas flipping in Blender (for Grease Pencil) with a hotkey, as well as a menu button. All it does is multiply the camera's local X scale by -1: ...
Latin1's user avatar
  • 33
2 votes
0 answers
38 views

How to access basic type information of Custom Properties?

I'd like to access user-defined custom properties (those that can be created by clicking the "+ New" button in the Custom Properties panel) and their type information in Python. So if I ...
371273's user avatar
  • 165
0 votes
0 answers
22 views

Is it possible to make a script or GeoNod so that all the empties become children of the vertex where vertex and the same coordinates with empties?

Is it possible to make a script so that all the empties become children of the vertex where vertex and the same coordinates with empties? Its not Hook - need vertex are parenting for Empty. Whether ...
user avatar
0 votes
0 answers
15 views

Can't use Cython to compile the Core Library of GeomDL or PyMcubes using --install-option="--use-cython" since "--install-option" is depreciated

I am trying to install Cython compiled versions of GeomDL and PyMcubes packages into Blender 4.1's shipped embedded python (...
fmotion1's user avatar
  • 1,433
1 vote
1 answer
32 views

create an object from scratch by using numpy

I'm trying to create one object from scratch using numpy (in the example, in order to make it very simple, only two vertices and one edge). The code below works (Hurray!) but ... Could anyone give me ...
Certes's user avatar
  • 61
1 vote
0 answers
9 views

Is it possible get a list of every external data used for a render?

Some renderers make it possible to access scene at render time using Python. This access allow you to make operations on the scene. This gives the possibility to list every element needed for a ...
Maxime Caron's user avatar
1 vote
1 answer
27 views

Is it possible to toggle Blender's built-in Boolean command state temporarily by pushing keyboard shortcut?

Is there any way to toggle blender's Boolean command state while pushing keyboard shortcut? I always enable weight paint tool's Restrict mode but sometimes I need to disable it. I would like to ...
Yokomizo's user avatar
  • 415
4 votes
1 answer
124 views

How can I expose Geometry Nodes properties in my addon panel?

I came across this question and learned that I can actually expose properties from the Blender UI in my addon panel. So I was experimenting on exposing properties of modifiers like for example the ...
Harry McKenzie's user avatar
0 votes
0 answers
12 views

How to make the bones of the two arms have the same direction?

I want the X and Z axis directions of the left and right arms to be the same.I used shift+N but it failed. Is there any other way?
Handsome Fish's user avatar
0 votes
0 answers
9 views

Any way to iterate through animation data and identify fcurves for pose bones?

I am looking for a way to iterate through the animation data for an armature and add a modifier to the pose bones. I cannot figure out how to go from an individual bone back to the fcurves that ...
user1071914's user avatar
0 votes
1 answer
31 views

Passing Edge Vertex Vector Attribute from One object to another

So I was hoping I could update an Objects position Based off the Vertex of another Object without having to Instance it. Here's my Setup: I was hoping the Result would be Something like this: But I'...
Pablo Pesquera's user avatar
3 votes
1 answer
82 views

How can I pass an object (like a bmesh) to an operator or should I not do that?

I have an operator that creates a certain mesh but I want to keep things modular so I separated each operation into its own operator. Like for example, I have an operator that removes vertices that ...
Megan Love's user avatar
0 votes
1 answer
54 views

How do I detect and fix overlapping geometry in 3d text

I'm creating a text object for use in a boolean modifier but I'm having trouble because the letters are overlapping, causing the modifier to fail: Because the overlapping vertices are all exactly on ...
The Gribble's user avatar
0 votes
0 answers
12 views

How can I align the object's or 3d cursor X, Y and Z-axis to tracking together with face normal

...
Rabia Islam's user avatar
1 vote
0 answers
17 views

Script to automate lipsynching

I've been using the Merlin plugin to write Python scripts and think I'm close to a way to use CSV viseme data to automate lip synching. The approach seems promising - have the script open a csv file (...
Hepworks's user avatar
0 votes
0 answers
44 views

3d to 2d transformation

i have a 3d model with multiple imprint areas on them. Below is its texture map. i have the UV map of the bottle aligned with the texture. but the UV map of imprints is not aligned to the texture of ...
Rakshya Panta's user avatar
1 vote
1 answer
28 views

ENUM_FLAG EnumProperty OverflowError when trying to use 1 << 31 as a flag value

I have an enum.Flag defined as so: ...
Jill Nesbit's user avatar
0 votes
1 answer
18 views

Cannot load .blend file from Python script

I am struggling to find out the source of the segmentation fault I get when I try to load a file from a Python script (specifically a production shot of Charge). I try to call: ...
michal.1's user avatar
2 votes
1 answer
30 views

multi-file add-on cannot find import

I am working toward have a multi-file add-on, as our add-on is getting pretty long. I'm starting with a trivial example to build up from and can't even get that to work. I have two files at top level ...
Janet Rossini's user avatar
3 votes
3 answers
287 views

How can I select all edges that form part of a square without a face via python?

I have empty squares (those with exactly 4 edges only) in my 2D mesh and I need to fill them with faces via python but I don't know how to automatically select these edges. Is it possible to select ...
Megan Love's user avatar
0 votes
1 answer
39 views

accessing computed output value from a "NodeSocketFloat" bpy_struct in a GeometryNodes network

I see this same question without no "satisfactory" reply, so i'll just throw it there again. ¿Is it possible to access a value from an output socket of type ? I see many properties out there ...
3mm3ttBr0wn82's user avatar
0 votes
0 answers
31 views

How do you cover the whole building with curtains, randomly

During the construction of the building, I completed the curtain part. This building has more than 20 floors, now I need some help. How can I quickly paste the curtain part using the script? I've got ...
LIN's user avatar
  • 1
0 votes
0 answers
25 views

How To Capture Mouse Movements During Blender Operations

I'm looking to capture mouse movements while using specific Blender operations, such as ...
Axel Olsson's user avatar
4 votes
1 answer
163 views

How to force generation of Image thumbnails?

If you load an image into Blender, its thumbnail preview is not automatically generated until you, for example, open the "Browse image to be linked" menu of an Image Texture node at which ...
gcs_dev's user avatar
  • 622
3 votes
2 answers
209 views

How can I remove a point of junction and reconnect 2 meshes via python?

I have a set of problematic meshes that have junction vertices (those with 4 edges). And I have to remove these via python and connect those vertices marked in green. Is this possible? Basically I ...
Megan Love's user avatar
0 votes
0 answers
26 views

Get USD file start frame number in Python?

USD file stage may have an arbitrary start frame. Is there a way to access that information from Python? There is a (bpy.context.active_object.modifiers[0]).cache_file object, but it seems not to ...
kivig's user avatar
  • 631