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
3 views

installing grpcio through pip NOT working

trying to install grpcio and grpcio_tools (v 1.38.0) using pip. This is what i'm running in the terminal and the output i'm getting ...
0 votes
0 answers
18 views

vertex coordinates do not update as mesh is modified

I'm trying to fit the mesh of a human model with the MPFB Plugin until it has the same dimensions as a real world human (data read out of biplanar X-ray images and imported from matlab). The program ...
0 votes
1 answer
17 views

How to add material "Slot List" to panel on my addon?

How to add material "Slot List" to panel on my addon?
0 votes
1 answer
16 views

Blender Python query/list uv edges from selected uv face to do operations on

This is probably a pretty noob question but I'm trying to iterate through the uv edges of selected uv faces on an object to do operations like: bpy.ops.uv.align(axis="ALIGN_AUTO") I can't ...
0 votes
1 answer
25 views

Duplicated collection doesn't show in outliner

I have this very simple scene setup in Blender : I want to duplicate the collection named 'Lights_1_50' along with its contents and I found that every object in Blender has a ...
2 votes
1 answer
1k views

Blender Addon save Hotkey Preferences

I have for my Blender 2.8 addon 2 keyboard shortcuts that I add to the AddonPreferences: In the init file I use this code to draw them: ...
0 votes
0 answers
42 views

Hi! when I export in gltf format this error appears V3.3.1

...
2 votes
1 answer
114 views

knife intersect cut with python scripting?

I want to cut some holes in a shape with a python script in Blender (3.3) I have some images here illustrating a simplified version of what I want to do, to remove the cylinder shape from the cube, ...
0 votes
2 answers
5k views

Vertices coords and edges exporting

Is there a way in blender to export vertex coordinates as a numbered list along with a vertex to vertex edge list? I'll show briefly what I'm talking about. x1 y1 z1 x2 y2 z2 x3 y3 z3 Edge list: ...
0 votes
0 answers
19 views

EnumProperty property not found — why?

I'm new to Python and Blender scripting. I've been modifying an existing script, which worked up to a point, but after my modifications it started throwing an error: ...
1 vote
1 answer
27 views

How can I store a pointer to a custom data type?

I have a type of PropertyGroup that stores some settings. My goal is to have a master collection full of instances of this group stored with the scene, and a list of slots that can be filled with ...
0 votes
0 answers
13 views

Getting spline coordinates of Face Masks

I am struggling with a little task of a project. I want to define an area in a video that is shaped like a rectangle. Then I want to move the rectangle frame per frame to follow a moving object. I ...
1 vote
2 answers
28 views

Rename Operator like F2

I'm working on a task to create the same operator as F2 rename operator inside the blender. I'm stuck at this point because my object names are not refreshing in ...
0 votes
0 answers
14 views

Is there a way to smooth a surface without loosing details

Is there any way to make this wrinkly area smooth without loosing the details. I tried using smooth deform with vertex groups but either it messes up the details or there is no proper output.
0 votes
1 answer
18 views

Text not shown over cylinder

I am learning Blender and facing issue to fit text over cylinder. I want to place the text at the top and bottom of the cylinder, when I am placing text at the top of the cylinder it is hiding some ...
0 votes
1 answer
319 views

How to configure the python values to fix the facial movements of a new 3d character not originally thought to work with those

I've just tracked and saved on the timeline the facial movements of Victor using OPEN CV and following this tutorial : https://www.youtube.com/watch?v=RY_eErKlilw The result has been good,as u can ...
0 votes
0 answers
18 views

Print object name every time I change active object (click)

Tried this code, but it seems have some issue, can't figure it out (need your help): ...
0 votes
0 answers
16 views

Issues when sculpting with python api on imported object

I have run into a problem concerning the application of sculupt brush strokes via the python api. I have a script that applies a brush stroke at either a given vertex group or to a set of vertices in ...
1 vote
1 answer
148 views

Python, How to Convert Rotations of T-pose Pose Bones in Armature 1 to Pose Bones in Armature 2? Finding Rotational difference

The goal is to get the rotational difference of the bones between Armature 1 and Armature 2 in its T-pose(not exactly), then apply the difference to a pose of Armature 2. The purpose is so the model ...
2 votes
0 answers
38 views

3D world to 2D image transformation with equidistant camera model

I'm currently implementing a simulation, where a 3D point needs to be transformed to a fisheye image with the equivalent of Blenders 'PANO' camera and the equidistant camera model. Does anyone know ...
1 vote
1 answer
359 views

Why is my rotation method sometimes incorrect for parented objects

I wrote Python's function to rotate a object 'o' direction, step by step, to 'directionW' direction. When the o has no parent, the function works great. But, when the o has one or more parent, ...
0 votes
1 answer
19 views

How can I add inputs to compositor nodes with Python?

I am writing a Python script that connects some nodes in the compositor. The result will render to a multilayer exr, so I will need add some inputs to an File Output-node. I'm trying to use ...
0 votes
0 answers
19 views

Smart Unwrapped UV Islands

I'm trying to get a list of the bounding boxes of UV islands after a smart unwrap, but the list that's getting returned doesn't make sense to me. Here's my code for getting the islands: ...
0 votes
1 answer
18 views

How to programmatically set the render border?

Blender Version 3.3.0 (3.3.0 2022-09-07) I have a camera and a 3D model (airplane). I only want to render the aircraft and the content within its bounds. Render border seems perfect for this, but for ...
2 votes
1 answer
129 views

Importing arrow positions and directions from a text file

How can I import position and direction data into blender and place 3D arrows on those points? I have made a custom 3D arrow in blender that I want to be duplicated and re-positioned. For example, ...
0 votes
0 answers
8 views

Converting a Skulpt Mask to a Vertex Group

I need some help with a script to convert a skulpt mask into a vertex group, called "Mask". I can then use that vertex group for other tasks.
0 votes
1 answer
37 views

How to get vertexs indexes of active UV polygon?

How can I get vertex indices of the current polygon selected in the mesh, not the one currently selected in the UV editor, via the Python API?
1 vote
1 answer
587 views

Invert XYZ Euler Rotation Value

I nabbed some code that creates created_box object that represents the Arbitrarily oriented minimum bounding box by volume of the ...
0 votes
0 answers
27 views

Select and join specific objects into one in python

I'm making a plugin to extract meshes from a game. Actually, it extracts well the vertices and indicies/faces of each mesh. Blender version: 3.2.0 Addon target: <...
1 vote
0 answers
16 views

Blender 3.2 will not quit when running in background

I have a windows batch file that calls blender to render various scenes & cameras in background. For some reason, blender.exe does not terminate at the end of the render and pass control back to ...
0 votes
0 answers
14 views

Iterate through a scene and return the location value of all objects and append to a created JSON file as a Set or Dict

I am trying to iterate through a scene and return the world space location data for each object in the scene. I want to zip this data into a dictionary with name, x, y, and Z being the keys and the ...
1 vote
0 answers
20 views

Find missing files per script

I have hundreds of blend files containing assets. I moved the directory containing the textures. "Find missing files" works fine, but it would be quite some work to repeat this step for all ...
0 votes
1 answer
30 views

blender python, condition inside preset_values

I want to make a preset system for storing light parameters, like the light size, intensity and so on... My issue is that there are parameters specific to each type of light like spotlights have ...
0 votes
1 answer
768 views

AttributeError: 'list' object has no attribute

I tried to use IsDecomposedBy and Decomposes code in Python Console in Blender bim but it shows this error: ...
0 votes
1 answer
29 views

How to copy over material settings to another material assigned to object faces?

I'm working with a complicated scenario that requires me to programmatically swap multiple materials in and out of an object at a time. This object has multiple materials applied to different faces of ...
0 votes
0 answers
23 views

How to combine custom icons with module reloading?

I'm trying to create an add-on that combines the two following implementations: Add-on sub-module reloading, allows you to make changes to an add-on's code live in Blender while running it: Blender ...
1 vote
1 answer
400 views

How can I make an animation using importing several x3d files to Blender by scripting?

I have some x3d files made by ParaView. I need to write a script to import these objects sequentially to Blender and make an animation. When each object is imported to 3D View Editor, a keyframe ...
1 vote
0 answers
19 views

Blender Python Translate object using three points

I have a collection of objects that I cycle through with a python script. Each object has six custom properties: OriginX, OriginY, OriginZ, TranslateX, TranslateY, and TranslateZ. Each property ...
2 votes
0 answers
29 views

Make object visible when intersecting with target path of curve modifier

I am creating an animation of a laser pulse traveling down a waveguide. To represent the laser pulse, I am using a long cylinder-like object with an emissive shader. To make the pulse follow the ...
1 vote
0 answers
44 views

How to interpolate/keep values in Python

I would like to interact with a scene in real-time, let’s say for an example when I hold a key, the scale of an object doubles, ie with some sort of driver. As that’s either 1 or 0, the object is ...
1 vote
1 answer
39 views

Geometry nodes dont update real time in python script

I have created an object using geometry nodes. I control its input node "String." I want to control the position of this object based on the x dimension, but when I change the string (...
0 votes
1 answer
147 views

When I paint in vertex paint mode, can I paint per vertex with python script?

I know that selecting vertices is possible in edit mode. I want to color after selecting a vertex in vertex paint mode. Is that possible?
0 votes
1 answer
34 views

How can I add a point or instance to points node with Python?

I want to create a geometry node tree in python, but for some types I get errors: ...
1 vote
0 answers
39 views

Faster way to get selection bounding boxes

I'm trying to get the bounding box coordinates of certain groups of faces. I am running this in a frame update so I'm trying to squeeze out as much performance as possible. I use the result of the ...
0 votes
0 answers
28 views

Is there a way to create a Random Text Reveal with Geometry Nodes in Blender? [closed]

I watched this tutorial about Random Text Reveal https://www.youtube.com/watch?v=2T_4ndZ6Nr8&t=147s in After effects but I am not able to find a way to do it on Blender 3.0. Is there a way this ...
0 votes
1 answer
326 views

How not to overwrite current "Render Result" but generate a new image with different name (bpy)?

I know basically after "render" we may save "Render Result" image or change slot of render, but I hope to use render.opengl() to generate current scene thumbnail with exported json ...
0 votes
0 answers
14 views

Empty, Clear, Delete modifier field using python - MeshDeform

trying to clear the Object field of a MeshDeform modifier on selected objects. My current code populates the field but I would like to check if the field is empty and then clear it if it's not. I ...
6 votes
1 answer
299 views

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

I’m trying to make my custom function: ...
7 votes
3 answers
2k views

Dashed link lines in node editor

While testing a change to an add-on that automatically creates node groups I noticed that the links in the group in the Geometry Node Editor window were dashed instead of solid. It seems to be related ...
0 votes
0 answers
31 views

Add dynamic text over object [closed]

I am working on creating a website where users can create their own coin. The user can add text for the front and back of the coin in the user interface. This is almost done and we are showing the ...

1
2 3 4 5
234