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
1 answer
14 views

How can I center view to selected item via python?

I attempt to center the view on the currently selected object using Python. Normally, you would select the object and then press Numpad . in the viewport. According to the keymap, the command behind ...
Black's user avatar
  • 983
-2 votes
0 answers
26 views

Why is blender showing this when I type E? [closed]

Whenever I try to convert the google basemap to 3d by clicking it's showing error in python with temp_error read Unable to understand.
Sushmita's user avatar
1 vote
1 answer
28 views

How could I speed up pixel iteration and evaluation?

I'm writing a script which finds the highest and lowest red values of a given image. Here's the code: ...
gcs_dev's user avatar
  • 528
0 votes
0 answers
20 views

Python exercise to learn - spiral circular shape

I’m trying to use bmesh extrusion and Matrix to do some spiral shape like this : I would like to start from a circle (like it is described on the picture) Here where I’m stuck: ...
Certes's user avatar
  • 1
0 votes
0 answers
17 views

How can I access and modify a boolean attribute in edit mode?

Re Manually setting custom attributes per edge / vertex / etc TLDR : In edit mode, the regular interface to access and edit attributes, ...
Gorgious's user avatar
  • 30.8k
2 votes
3 answers
184 views

Python: Check if an object is selected

Sorry, I'm extremely surprised I can't find this question anywhere already. In Python I just want to check a specific object to see if it is currently in the set of objects that are selected.
madscribbles's user avatar
0 votes
1 answer
28 views

Acessing input names of a node group

I'm trying to make a list of inputs to a GeometryNode Node I created. I've done this before in Blender 3.6 like so: input_names = [input.name for input in bpy.data.node_groups["Neuron"]....
Karate Dragon's user avatar
0 votes
0 answers
24 views

NumPy errors with compatable addons 4.1

I just upgraded to Blender 4.1 (Windows) and my addons, which say they work with 4.1, all fail because of a missing numpy.core._multiarray.umath. I don't know how ...
Lamerex2111's user avatar
0 votes
0 answers
14 views

Importing Vertex groups with duplicated vertices

I'm working on a project to generate a mesh that was written in VSCode. When I create my vertex groups and run it directly in Blender, there is no issue. However, when import the file as a .obj, it ...
Ryan Lansford's user avatar
0 votes
2 answers
22 views

'Context is incorrect' error from `project_from_view` [duplicate]

I'm studying the Blender Python API and trying to run the following simple script: ...
Jacobian_1201's user avatar
0 votes
0 answers
30 views

Isolating a collection in an offscreen buffer without altering the viewport?

The goal of the script is to live-capture the scene from a camera POV but only have certain collections be visible in the texture. Some things I have tried - hiding objects before drawing and ...
Nyubug's user avatar
  • 1
0 votes
0 answers
12 views

How are appended assets from the Asset Browser handled, can i replicate this in python?

The Asset Browser does something special that I can't quite grasp: If you drag a material from a library into the scene, on an object, it loads and appends it. If I modify this material (name, ...
Xoliul's user avatar
  • 65
1 vote
0 answers
14 views

How to force UNDO panel to be maximized in custom operator

I made an operator, which have an UNDO panel with my custom properties. If UNDO panel was collapsed – it remembers this state and next time will appear also collapsed: __ It's not ok in my case. I ...
Yaroslav's user avatar
  • 435
0 votes
1 answer
14 views

How to hide some properties in UNDO window *depending on the execute() result

I'm making an operator which has multiple properties in the UNDO window: Depending on the result which happened inside the execute() function some of these ...
Yaroslav's user avatar
  • 435
1 vote
1 answer
21 views

Cut polygons out of planes in blender using python

I have a plane in blender, generated using a script with known coordinates. I'd like to cut multiple polygons out of the plane. The coordinates of the polygon vertices are already known with respect ...
derekboase's user avatar
2 votes
2 answers
37 views

How do I add a button to the Armature Pose menu in Blender 4?

I've been trying to make a button to reset all the stretch-tos in my custom armature as per this question, but my previous menu work has all been in a new menu section in the sidebar of the 3D view. ...
MisterLBlends's user avatar
0 votes
0 answers
8 views

How to execute a function after opening an Image from disk?

I have a button which calls image.open and a drop down menu which is the "image" property of an Image Texture node. For now, the user must click to open a ...
gcs_dev's user avatar
  • 528
1 vote
0 answers
14 views

How to determine if a face intersects with other faces

I am using Python scripts for filling, and sometimes he may encounter situations as shown in the picture the fill face intersects with the pre-existing face This is obviously not good, so is there an ...
mengyuanlan's user avatar
1 vote
0 answers
27 views

Reading ShaderNodeHueSaturation color output

I am trying to read the color from an HSV-Node via the scripting api. This is my material shadernodes tree (simple test scene, no other materials etc). I have confirmed that the HSV node is correctly ...
Gregor Jochmann's user avatar
0 votes
1 answer
16 views

BPY toggle viewport visibility of modifiers

I want to save the dimensions of an object in a script before and after the viewport visibility for the modifiers has been switched off. ...
Kr3o's user avatar
  • 93
1 vote
0 answers
26 views

I have several files in my addon. Where should I initialize the global variable?

I have several files in my addon: __init__.py, operators.py, ui.py, etc. Where should I ...
Cyril's user avatar
  • 21
0 votes
0 answers
12 views

Installing blender on termux x11 with hardware acceleration

Is there a way to install blender on termux x11 with hardware acceleration? Anyone with experience please help.
danielkotzer's user avatar
0 votes
0 answers
14 views

How to choose the shortest path along the edge loop

I need to choose the shortest path between two points along the loop edge with python. When I use bpy.ops.mesh.shortest_path_select(), the selected point will deviate from the edge loop like this The ...
mengyuanlan's user avatar
0 votes
0 answers
9 views

Question about bpy's matrix_world to torch3d coordinate system conversion

From the visualization results, it appears that the camera pose I converted is not accurate. It has moved backwards. Is there have any suggestions ?QAQ 1.difference of cameras space 2 some discussion
Haitao Xiao's user avatar
0 votes
1 answer
46 views

How can we use same import paths in PyCharm and Blender?

A friend and I are working on an add-on to Blender. It does some complicated geometry work and so we have developed the code using PyCharm and pytest. We have a handful of commands that get added to ...
Janet Rossini's user avatar
1 vote
0 answers
18 views

daz to Blender bridge issue with exporting

I have installed the Daz to Blender bridge add on and it used to work fine. But now I am having some variation of this error message whenever I try to import a model animation in Blender: If anyone ...
zak's user avatar
  • 19
3 votes
1 answer
111 views

silencing Blender output using Python

I have a python app that imports bpy as a module. I am trying to silence all the Blender console outputs so that outputs like ...
Mike Pan's user avatar
  • 11.7k
0 votes
0 answers
8 views

bpy: handlers.save_pre not updating immediately before saving

This script is to update a property to its relative path when the file is saved, however how it is currently set up, the property does not update until a few seconds after the save. Even worse, if I ...
Zak Nelson's user avatar
1 vote
1 answer
23 views

Color selection in palette does not update in different mode

I'm trying to create a relatively simple addon for Blender to make our workflow a little easier. I got the scripts running... kinda. I'm sure there is something about how Blender works under the hood ...
dasfrodo's user avatar
0 votes
0 answers
15 views

Trackball Behaviour With Modal Operator

I need to create a trackball like behaviour for a modal operator. Is there a possibility to implement this into the functionality by moving the mouse? I just need to know how the math works when ...
Coloremblem's user avatar
0 votes
0 answers
19 views

Overridden delete operator does not work if object has been assigned to a variable

When I override the delete operator and then delete an object that has been assigned to a variable Blender does not use the overriding function. If I do not assign it, my function is being used. Here ...
SimonCan's user avatar
0 votes
0 answers
29 views

How can I label the faces of a mesh so that they remain labelled after I UV unwrap the mesh?

I have been trying to figure this out from these posts: Storing Face Indices in Data Arrays https://stackoverflow.com/questions/60713817/how-to-get-data-and-edit-it-on-uv-map-edges How to get data and ...
Ciara's user avatar
  • 1
1 vote
1 answer
24 views

Reallocates a dead pointer Object

Consider the following situation: Suppose you store the Cube in a global variable and prints the object's position every 2 seconds. Assume you never delete the object. ...
X Y's user avatar
  • 5,303
0 votes
0 answers
7 views

no bpy accessable atribute for Workbench Sampling

I'm making a very bodged script to export textures for a game and need some rendered with AA and some without. When adjusting this setting it comes up in the editor terminal as ...
Maebh Thomas's user avatar
1 vote
0 answers
22 views

Python Centering Mouse X Y Coordinates To Operator

I am trying to get familiar with the modal operators in blender and want to create some kind of custom trackball rotation. When I set the rotation euler values to the mouse_x and mouse_y event values, ...
Coloremblem's user avatar
0 votes
0 answers
13 views

How to code a dynamic line?

I'm plotting several points and connecting them with a polyline, the objective is to implement a feature where, if any of the plotted vertices are moved within the scene, the polyline dynamically ...
crisplettuce's user avatar
1 vote
0 answers
14 views

Which way to dynamically change the content of the panel is better:: if-else or subpanels_with_poll?

I want to dynamically change the content of the Panel.(Template_icon which depends on selected object) I found two ways to do this. if - else ...
Cyril's user avatar
  • 21
0 votes
1 answer
15 views

hello i want to port 3D render to Blender [closed]

I know a friend of mine he build 3D renderer better then Corona. How can I port that engine to Blender? By the way he built his engine into Lightwave3d and I told him about the idea he told me you ...
abdelkarim keraressi's user avatar
0 votes
1 answer
35 views

Syntax error in script: bpy.data.window_managers["WinMan"].(null) = 'PAN'

I'm trying to create a button, when I press it the Middle Mouse Action setting should change from Orbit to Pan and back. When I change manually, in the python console, this text is displayed: ...
André Ruf's user avatar
0 votes
1 answer
15 views

Camera pose not updated for render

I created a script to render images with different came poses with Blender 4.0. But I always get the same image, the camera pose is not updated. I tried with the python interpreter, blender script tab,...
Apo's user avatar
  • 33
0 votes
0 answers
13 views

StringProperty of type DIR_PATH duplication issue

I'm using scripting in Blender to automate some of the work done on my team, and for that I need a path property as a root folder where all the work and exports are saved when a button is clicked. ...
Hilla Shahrabani's user avatar
0 votes
0 answers
13 views

How to use a PropertyGroup inside the Preferences?

I would like to create a PropertyGroup and use it to store some preferences. A list of folders with some additional information for each folder. There will be a ReScan button to check for updates in ...
Steve's user avatar
  • 446
0 votes
0 answers
25 views

How to install modules into Blender's Python

I have a Python file that is hundreds of lines long. To make things simpler and to cut down on scrolling, I want to put the functions, e.g. ...
Paul St George's user avatar
0 votes
1 answer
79 views

How to reload a module which was imported via importlib.import_module()?

If I import a module using from . import *module* – this module could be reloaded via importlib.reload(*module*) BUT if the same ...
Yaroslav's user avatar
  • 435
0 votes
0 answers
9 views

Python: How to move area edge to resize area?

I want to move the PROPERTIES area's edge with python,but it's not working.Here is my code.But it reported error:Operator bpy.ops.screen.area_move.poll() failed, context is incorrect.How can I solve ...
fage's user avatar
  • 109
0 votes
1 answer
27 views

How can I make an instance-level dictionary in a PropertyGroup class?

I have a class that inherits PropertyGroup I have lots of properties inside, and besides I want it to have also a dictionary that store different keys and values ...
Golden Dragon's user avatar
0 votes
0 answers
24 views

How to highlight a vertex in Edit Mode?

I'm working on an addon, and I have an operation that manipulate vertices in some way. The problem is that after this manipulation I want the user to easily see which vertices were effected by the ...
liad inon's user avatar
  • 101
0 votes
0 answers
19 views

How to add Vertex Group for each group of linked vertices using python

I have mesh that may contain many groups of linked vertices, and I want to create for every one of them a Vertex Group using python.
Sicarius1's user avatar
0 votes
0 answers
17 views

Installing blender from file

I'm new to Ubuntu, and I want to install blender on Linux from *.tar.xz file I have downloaded from the blender.org, but I just can't make it work. If I install blender from the Repository, it works ...
danielkotzer's user avatar
1 vote
1 answer
22 views

Fill the inner face

I'm a beginner in Blender, and currently, I want to fill the inner wall of a ear canal model while keeping the shape of the inner wall consistent with the outer wall. you can get my file from My ...
mengyuanlan's user avatar

1
2 3 4 5
262