Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
2 views
0
votes
0answers
3 views

How to create a list containing lists of bm.verts based on their deform layer (vertex group)?

I have been struggling with trying to find a way to do this. It's related to my previous efforts here: How to get list of bm.verts that belong to a deform layer? When I do this ...
1
vote
1answer
82 views

Scripting more hair keys than six

I need to write a script that allows me to bend a hair to exact coordinates. I've been using - ...
0
votes
0answers
12 views

Display text on 3d viewport

Is there a way to display text on the 3d viewport. (not text objects) After running a script I would like to display instructions on what to do next.
0
votes
0answers
6 views

How to Prepend to Delete Operator?

I know that OBJECT_OT_delete is not in bpy.types, how can i do something before the delete operator is called ? ...
2
votes
1answer
54 views

Blender 2.8 Array Circle along plane

I still have no good solution on how to create an array modifier for an object to 1) Rotate in a circle (I know it can be done with an empty that is rotated) but... (see 2) 2) The objects should ...
1
vote
0answers
9 views

Store object for operator

I have a simple operator that works with the active object and another one in the scene. When the operator is opened again I want to access both objects again. Accessing the active object is no ...
0
votes
0answers
13 views

How to move vertices to a global position on one axis

I have the vert's global position, and the below code moves the vert to Z zero, but it doesnt work if the object is rotated. ...
0
votes
1answer
30 views

Replace Every instances of an object by a 2.79duppligroup / 2.8CollectionInstance?doing this trough python?

hello i want to replace every instances of my asset with a 2.79duppligroup / 2.8CollectionInstance, with the same roientation and scale but i found no way to do this !? ctrl L dont work, = am i ...
1
vote
1answer
20 views

How to Install Multiple Add-ons with Python Script

I am constantly using new workstations where I have to install a new version of blender. While the blender cloud add-on allows one to sync settings between devices, it does not sync user-installed add-...
0
votes
1answer
128 views

Using Blender's Python API to get parent bone names

I’m trying to write a script that will change the name of a parent bone. However digging for data I’m not getting what I suspected to get. I realize that to change data I will have to do it through ...
1
vote
0answers
17 views

alternatives for operator's report() function?

it seems that the report() function of Operator type lets all other routines finish before it actually reports. this makes it useless in many instances: for example, when reporting progress on baking ...
1
vote
0answers
23 views

Is There a Way to Change a Prop with an Update Def without Calling the Update Def?

Is there a way to change a prop with an update def without calling the update def? ...
0
votes
1answer
19 views

Python - Creating a empty per selected object and get the selected object position, rotation

I want to know how can you do the following thing in python. I have a Empty(null or locator) I want to create one for every object selected then I want that nulls to parent or constraint to the ...
0
votes
0answers
6 views

Set value to property using data_path

I'm making a script where i have an array of properties data_paths (like myArr = ["scale[0]", "location[2]", "['prop']"]), and I need to set a certain value to ...
0
votes
0answers
24 views

Store Pointer Property array/list

How can i store a array/list of Pointer Properties?! I want every pointer to point to a object and get a specific pointer with an index or key. ...
0
votes
0answers
13 views

Converting from Tree of Empty to Armature back to Tree of Empties

I'm writing an importer for an irregular model format. This is based on a 3dsmax script. The format stores the skeleton as a list of bones listing each bone's parents and two matrices, one called "...
3
votes
1answer
21 views

Selecting curve after importing svg using bpy

I'm importing an SVG file into my scene using bpy. But after importing, the curve is not selected nor active. Here is wat I am doing: ...
1
vote
1answer
22 views

How to quickly assign an individual material to color thousands of cubes at the same time with python API in Blender 2.8?

Let us just say you have a 100x100 cubes 2d grid and each cube will be assigned its own individual material. How can you do this? My code below worked initially when I created all the cubes as ...
0
votes
1answer
9 views

Timer with uncapped frame rate

I have been struggling a ton to get a basic time trial type timer that includes milliseconds. The kicker is, I REALLY want to have my frame rate uncapped. With that in mind, this solution I found ...
0
votes
1answer
61 views

What is the fastest way to create 28 x 28 x 28 individual cubes with its own material in python? Writing 3 forloops is too slow

Is it possible to create this many cubes without for loops? Is it possible to create and place cubes in the right location with a 3D numpy matrix?
0
votes
1answer
23 views

2.8: How to add a button to the toolbar?

What is the proper way to add a button to the toolbar just to be visible in object-mode? I try to port an old addon to Blender 2.8 and I managed to add a button to the toolbar, but the button is ...
1
vote
1answer
28 views

Finding a specific face/vertex/edge based on position value, not indices value

[Looking for answers possible via python] Hi everyone! I'm trying to select a face/vertex/edge based on location rather than selecting it based on its specific index. After the specific face/vertex/...
1
vote
1answer
33 views

API access for workbench render settings

In Blender 2.8 how do I change the settings for the workbench render properties via python? The settings for the workbench render, not a viewport. For example if I manually change the lighting to FLAT,...
0
votes
2answers
22 views

How Bpy.ops.mesh differs from bmesh ops

I know that Bmesh is a standalone module and bpy is an application module. But still why we have mesh related operations under bpy i.e bpy.ops.mesh , if we have bmesh? I need deep insight. Thanks
0
votes
0answers
11 views

Python Panel Slider Controlling Object material and World Sky at the same time?

Is there a way for a panel slider to control both an object's material node and a world node at the same time? I currently have the slider controlling the mix factor of a material that is assigned to ...
0
votes
0answers
17 views

bgl Hello Triangle Blank Screen

This code should draw the "Hello Triangle" (1) that everyone starts off with but it's not showing up. Since it's in Blender, I used (3) as a reference for when to draw. That's why the code itself ...
1
vote
1answer
13 views

Move selected mesh items to cursor in defined axis

I want to make a pie menu to snap selected parts of my mesh to the cursor constrained to specified directions. Example of snapping to cursor along x: I would like to do this for x,y,z,xy,zx,yx. I don'...
0
votes
0answers
13 views

Why this error turns out when i tried to check an addon that i installed

this error turns out when i tried to check to activate an addon that i installed, this addon its this one from here https://github.com/CGCookie/retopology-contours i am using b3d 2.78a how can this ...
0
votes
1answer
28 views

How is the most bottom bar called and how can i access it

How is the most bottom bar called and how can I access it?
1
vote
2answers
30 views

Segfaut when going back to Object Mode, on unrelated data

I am writing an Addon. I have a list of Vectors: centers = [p.center for p in obj.data.polygons] In a later section of code, I do the following to a different ...
0
votes
1answer
17 views
4
votes
0answers
43 views
+50

Call pie menu in holding state

so here is what i want to do: holding state = when you hold the key when calling vie keymap tapping state = when you tap the key when calling vie keymap call a pie menu from another pie menu set the ...
0
votes
1answer
99 views

Gizmo types in blender 2.8

So, in Blender 2.8 avialable Gizmo Widgets(bpy.types.Gizmo, bpy.types.GizmoGroup). i am tring to find out how to use different type of widgets(gizmos) but cant find any information about them. Here ...
1
vote
0answers
21 views

How can I create a checkbox that will execute my code when checked?

First of all, I am a total beginner in terms of Blender API. I have been working with Python and the Blender API for about 3 days now. I already found out how to hide unwanted objects. Here is my ...
1
vote
2answers
35 views

Problem with Boolean-difference modifier – or – How to model a cuboid with two cylindric holes

Simplified: I want to generate a cuboid with cylinders as holes in Blender. When I add with a difference-modifier, I come to pretty common problems/limitations. There are lots of tips or advice ...
0
votes
1answer
31 views

How do I lay objects on the surface of a sphere with Python?

Just started Blender (and Python) about a week ago, so please bare with me. I apologize ahead of time for confusing/misused terminology, etc. I am working on a research project and I need to: ...
1
vote
2answers
27 views

Python: How to select the collection an object belongs to

I can access objects belonging to a collection like so: objects_in_collection = bpy.data.collections["My_Collection"].objects How can I access the collection a ...
1
vote
2answers
155 views

Blender 2.8 : python code to switch shading mode (between wireframe and solid mode)

If i switch between solid and wireframe mode, i can see in the info window that these commands are invoked : ...
1
vote
2answers
179 views

Navigate the disk cycle, like you can navigate the loop and radial loop cycles in bmesh?

So, in bmesh you can navigate the loop cycle via loop.link_loop_next loop.link_loop_prev You can navigate the radial loop cycle via ...
0
votes
1answer
92 views

Whats the Blender 2.8 command for adding an object to a collection using python?

I currently have a method that does: self.myCol = bpy.data.collections.new(self.collection_name) bpy.context.scene.collection.children.link(myCol) This method ...
1
vote
1answer
392 views

How can I scale all objects in the scene about the origin using Python?

I'm currently writing a small script to help ease exporting objects made in Blender to the Unreal Engine, and one of the things I need to do is scale all mesh objects by 100 about the origin (0,0,0). ...
0
votes
2answers
27 views

Reselect faces that was already selected?

How can I reselect faces that is already selected? I need to get selected faces, do something else, and then reselect those faces again. I tried this ,but it doesn't work. ...
0
votes
1answer
97 views

Change circle segment depends on diameter

I want to program a tool for checking radial parts of a mesh. The idea is: You push a button, the scripts add an object (circle) to the scene. Then you grab it place it and when you scale this circle ...
1
vote
0answers
19 views

How to create a script that will evenly distribute selected nodes?

I would like to create a script that would evenly distribute the locations of some selected nodes so that I can better organize my node trees. I'm seeking a script solution for this issue, instead of ...
0
votes
1answer
31 views

Making disorganised structures

I am new to both Blender and Python coding, so here is my question: Is it possible to make arrays of cylindrical structures of random heights and/or random interspace? Is it possible to code something ...
2
votes
2answers
347 views

Empty bpy.data.node_groups

I need to change the value of an RGB node programmatically. The data path of the node in question is bpy.data.node_groups["Compositing Nodetree"].nodes["RGB"], as ...
0
votes
1answer
21 views

How to save texture bake image file to local drive in python

How do i access and save a image file ? Under Image there is a Save As - option i need to know how to access this and save the image to some location. ...
0
votes
0answers
28 views

I am trying to install py script in blender 2.80, but i cant find that script in user preference!

I am trying to install python script in blender 2.80, but I cant find that script in user preference! I have checked everything and its all set but I still cant find script to activate! Is it ...
4
votes
1answer
92 views

Adding icon to toolshelf in 2.8

I've been struggling all day to add icon with action from loop tools (circularize selection). Firstly I've added a hotkey into my keymap: Then I looked into it's structure and tried to make it happen ...