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

Geometry Modifier shows only after save/reload of blender file

In a python add-on (operator) I create a number of mesh objects and attach to each a Geometry Modifier (to show wireframe). The challenge here is that the modifiers do not show in the viewport, only ...
0 votes
0 answers
15 views

how do I specify an acceptable path for driver_add('hide_render')

I am trying to add a driver to an objects 'hide_render' property. For: o = bpy.data.objects['my object'] If I specify any of: ...
  • 4,233
0 votes
1 answer
36 views

How to make default path to the executable file via Blender Python API?

I'm working on render engine which need to select binary executable file for working engine properly but I would like to include that binary executable file inside my addon (e.g.: <my_addon\bin\...
0 votes
0 answers
23 views

edit_bones not defined

...
0 votes
0 answers
20 views

Registering Persistent Scene Type Properties

I'm trying to register input variables by extending the scene type using the following line of code: ...
1 vote
1 answer
33 views

How to get the x length of a slice of an object, using python?

If I had a complex object, and it's axises aligned. How can I get the x length or coordinates given a z coordinate? For example, how can I get the x length of object's slice , given z=-1, y= -2? For ...
  • 23
0 votes
0 answers
17 views

Blender real-time animation based on the sensor data

How can i animate the model in the image below based on sensor data? I need to make it real-time(like when person moves his arm, model in the blender should move too.) I tried keyframe_insert method ...
  • 1
0 votes
1 answer
19 views

Using only Python, generate fillets(bevel) on only the bottom edges of a cube

I have been plugging away at this for a couple days without any real progress. I am creating a series of cubes in Blender which I need to all have beveled bottom edges (see image) I was able to ...
2 votes
1 answer
25 views

Getting the name of an object before it was changed using a handler

I'm trying to make sure a list of objects gets updated with an objects new name once it's renamed. The challenge I'm having is connecting the original name with the new name. I'm even more uncertain ...
0 votes
1 answer
74 views

How to export multiple groups with meshes

I have a kitbash file and I want to export each one of the assets to a seprate fbx file for easy viewing and to ease on my pc since the whole .blend file contains around 15 mil polys. I was wondering ...
0 votes
0 answers
24 views

Get pixel data from rendering in script using built blender python module

I need to get the Pixels of the render pass to convert them to a numpy array within a python script. From my research there are 3 possible ways to solve this: using a viewer node in Compositor using ...
1 vote
2 answers
23 views

How do I match the indices of attributes to the indices of vertices?

I'm trying to write a mesh exporter that can export vertex colors (color attributes). On the default cube, I've found the Blender counts 8 regular vertices wherein it stores 24 color attributes. I ...
  • 21
0 votes
1 answer
25 views

Passing material with python - error Function.material expected a Material type, not Material

I'm trying to make a material class in Python. I want to assign it to a custom text class. I have a code, which makes a text object, and if no material is assigned it just makes a black material. But, ...
0 votes
0 answers
17 views

Root Motion error while joining other animations with character

I'm getting this error when joining the animations to character from Godot Game Tools after clicking on Add Root Motion. ...
  • 1
2 votes
1 answer
63 views

How to add image sequence in sequencer via python?

I'm trying to add image sequence to sequencer using python, but it looks like sequence_editor.sequences.new_image() can only add singular images and not image ...
1 vote
0 answers
14 views

Blender on a web server to generate pictures for a configurator [closed]

I am just at developing a house configurator. The first simple part is finished, creating a PDF showing all selections. The next task is to create pictures. All the information about the configuration ...
1 vote
0 answers
28 views

Automating Quad Remesher Process in Python Failing!

Hi, I am really stuck with the development of my workflow I am trying to create and need some support to get this working :) Objective: To have a bunch of meshes inside a single blender file, then run ...
  • 11
0 votes
1 answer
35 views

How to get name of a shader node group in Python (and check if there is a certain shader node inside it)

The material is looking like this: I'm trying with this code: ...
  • 393
0 votes
0 answers
29 views

Keyword "filepath" unrecognized

I'm getting this error and I can't find a solution. Could someone help me? Python: Traceback (most recent call last): File "\Text", line 13, in File "C:\Users\migue\Desktop\blender-3.4....
  • 109
0 votes
0 answers
16 views

How to support the shader code for multiple (OpenGL, Metal) backends?

I'm trying to write the custom shader code in Blender by using the gpu module to support multiple backends. We could find the example codes for OpenGL backend from ...
  • 439
0 votes
1 answer
24 views

Change the resolution scale on the fly by shortcuts?

ctrl + alt + Q and ctrl + space are great Shotcuts! When I maximize the Outliner for example I would prefer a 2.0 or 1.5 resolution scale. Or ingeneral when I maximize a window a changed ...
0 votes
0 answers
22 views

Access the parent Panel from a context menu?

I have a created a context menu. I'd like to only show this menu when it's called within a specific Panel. How many I get the Panel in which the context menu is being drawn? I have tried ...
0 votes
0 answers
15 views

How to create an exporter describing certain actions? + and make it as add on?

I just started looking at python with zero background of coding as I really need to create a custom exporter but it seems to far for me yet. Anyone can guide me to create a py script which excutes the ...
0 votes
0 answers
29 views

Is it possible to hijack or implement the builtin placement gizmo?

I'm working on an addon, with included workSpaceTool. I'd like to have interactive placement - to get initial pos and orientation plane from the first mouseclick. Rather than messing around with ...
1 vote
0 answers
46 views

How to get coordinates of intersection between a plane and an object (using python API)? [closed]

Like showing above, I would like to get the coordinates of intersection between an object and a cube(the cube also could be a plane). That's to say, I want to get the intersection coordinates in the ...
  • 23
1 vote
0 answers
41 views

How to get the pixel coordinates of a rendered object

I want to render an object (plane) and want to know exactly where this object is in the image. To do so, I discovered this answer which was already quite helpful. Here the code I use, based on the ...
  • 153
0 votes
0 answers
27 views

How to add NEW Workspaces with Python, not just append from user preferences, or switch to a workspace?

I am aware of questions of similarity such as this: Changing workspace with python, and this one on Blender Artists.org https://blenderartists.org/t/how-to-create-new-layout-workspace/1380035, however,...
0 votes
0 answers
13 views

OpenGL Renderer - How to handle cancel and complete events?

I need to manage events when viewport opengl rendering got canceled or completed. It looks like the handlers that come with python API only work with regular renders - WORKBENCH, EEVEE, CYCLES. I need ...
0 votes
0 answers
14 views

Is there any way to select regions of mesh with shadow and measure the surface area of the mesh?

I am trying to quantify shadow on different parts of a mesh at different orientations of illumination. So far all I have found is to outline the shadow manually on the mesh, separate it and use the 3d ...
  • 1
0 votes
0 answers
58 views

Blender 3.4.1 overlay addon

I am learning how to create extensions and I am stuck. In a text overlay I want to update the time every second with a modal operator. The script is running in principle, but no text is displayed on ...
1 vote
2 answers
39 views

How to add a node group to the world environment?

How to add a node group to the world environment, then specify the texture_coordinate.object in the node group to an empty object with the specified name? If not, ...
0 votes
0 answers
23 views

How to Freestyle script to export overlapping meshes?

I am using this plugin (modified to make it work in Blender 3.2) to export my meshes as an SVG with a stroke and fills. It has 2 scripts I am using: ...
  • 101
0 votes
0 answers
20 views

Is it possible to guarantee a maintained reference to MeshVert/BMVert elements after adding/removing others?

I want to reference/tag a particular set of verts, then manipulate the mesh and still have them have them distinguishable for new ones.
0 votes
1 answer
24 views

grease pencil point's vertex_color attribute different than color picker values

I've noticed that if I query the vertex_color of points in strokes created in vertex color mode in Python, it returns values that are different than the values shown in the color picker color used to ...
1 vote
1 answer
28 views

Change default/user camera with python BPY

I'm not sure what's the right word, but I would like to manipulate the camera you see from with python BPY. I know there are 2 cameras on startup. One camera you render from, and another camera you ...
2 votes
1 answer
37 views

BPY python change input unit from meter to centimeter

When using python bpy I can change the default "view" units to cm: bpy.context.scene.unit_settings.length_unit = 'CENTIMETERS' However, all the input is ...
1 vote
0 answers
25 views

How to avoid "internal error: modal gizmo-map handler has invalid area" when toggle maximize area while modal operator is in progress?

When modal operator is in progress and I press Ctrl+Space to Toggle Maximize Area in Blender it starts spamming ...
0 votes
1 answer
22 views

How to delete all keyframes of a specific property in python?

I have many objects that contain animation on their properties like location, rotation, and scale. I want to delete all keyframes from a specific property like a scale which I can do by right-clicking ...
  • 777
0 votes
0 answers
28 views

What's the differences between posebone's vector and bone's vector?

I want to get a certain bone's head/tail coords in world space in pose mode. I've seen some answers about Bones.vector and PoseBone.vector. When I set different frame of the armature, the PoseBone....
0 votes
1 answer
17 views

Selected_visible_fcurves from the 3D Viewport?

I'm trying to get the selected visible keyframes in a Graph Editor from a 3D Viewport. If I try context.selected_visible_fcurves in the 3D Viewport, it returns <...
0 votes
0 answers
65 views

Using Python to create a Cube using Geometry Nodes (Blender 3.4 and up)!

I got two bugs I'm trying to solve for creating a Cube using Geometry Nodes, all scripted in Python! I've Frankenstein this script from an older post, but for some reason, I get the error: "line ...
1 vote
2 answers
82 views

How to implement bgl.glScissor with using gpu module?

As you know, bgl module has been deprecated and will be deleted in the future Blender release. So, I'm tackling to change my old code to use ...
  • 439
0 votes
1 answer
15 views

Add keyframe for position of an Image strip with python

I want to add keyframe for position of an Image strip with python in video sequence editor. I set the value like this: ...
0 votes
0 answers
22 views

Why are my Vertex Colors not being rendered in Python API?

I'm rendering a mesh with vertex colors, but cannot get the colors to render. I'm using blender python 3.4.0 Here's what I tried: ...
0 votes
0 answers
11 views

6-DOF platform Bone binding

How to create a 6-DOF simulation platform, the platform is the main skeleton, but the range of motion of the six axes is limited (such as 0-1), which limits the range of motion of the main skeleton ...
0 votes
0 answers
39 views

Vertex group information in geometry nodes cannot be obtained by add-ons

I am trying to get information about the start and end vertex groups used in an object through a geometry node in a modifier, but it is not working. Currently, I can get the number of vertex groups ...
1 vote
0 answers
25 views

How to write a script to multiply a mesh and after that export the multiplied meshes to an FBX file

I'm learning to work with blender and also to program with Python. I found an article teaching how to create a maze, multiplying the faces and edges all through Geometry Nodes and carving the walls ...
  • 111
3 votes
1 answer
153 views

Getting and using the selected Color Attribute

Fairly new to blender python, though have some experience with python outside of blender, I'm trying to work out why this bit of code is only ever working on the first color attribute and not the ...
0 votes
0 answers
40 views

I'm having some errors with Auto Rig pro in blender 3.4

So I'm using blender 3.4 and I'm trying to figure out why Auto Rip Pro is constantly giving me these errors. When ever I try to generate the meta-rig I get the first error and if it does generate the ...
1 vote
2 answers
52 views

When rigging a car It rescales and rotates

I use Rigacar plugin. MacOs Ventura, Blender 3.4.1 (Steam) At first I parent everything to the body of the car, origins to geometry and finally, apply all transformations. However when: Add > ...