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.

1
vote
0answers
18 views

How to access “use_transform” property of Nodes in Nodes editor and set it to “True” via python pie menu script? [duplicate]

I am creating a pie menu to access my most frequently used nodes in my node editor. I have successfully created pie menu but it doesn't have "use_transform" property set to "True" which enables us to ...
0
votes
1answer
13 views

What context does make_links_data need?

I can't get bpy.ops.make_links_data to work with context overrides. When I select objects manually, it works fine, but the following doesn't: ...
0
votes
1answer
18 views

Cannot set value 'RGBA' to color_mode in Blender by script (Python)

I use script to split render scene to smaller pieces (tiles) - by setting use_border = True. Then "tiles" are rendered, and after process finishing, I join "tiles" ...
0
votes
2answers
33 views

How controll RGB node with FloatVectorProperty (Blender 2.8)

I can draw in panel an rgb controller , but not know how to update the rgb node inside material, i can get the name in update function , but not undertand the right way to assign parameter to node rgb,...
0
votes
0answers
13 views

How to make the a menu stay even after clicking on an item in the pie?

In this code I access a slider within the pie: ...
0
votes
0answers
16 views

How to render depth map using blender

I need to render depth image for the 3D scene, using 1 camera. I don’t care about color image and the lightning. I only care the depth image. The format should be PNG. Basically the script can be ...
2
votes
0answers
21 views

repath renderlayer output

I'm using blender 2.79 and I want to change the render layer output path of a scene. I have a lot of scenes to render and the output path for the beauty can be controlled via command line. I wrote a ...
0
votes
1answer
46 views

How to check if Node connected to another node input in Python

I am doing a process to some switch links in materials. I need to know if something is ever linked or not before to process. I can't find out how to :/ The script works well if something is linked ...
1
vote
1answer
31 views

Adding text on a new line in VSE(Python operator)

In Blender 2.8,the VSE gives the ability to add text but only on a single line.Inorder to add text on a new line ,a new layer needs to be created . Are their any operators which can be used to add ...
1
vote
0answers
24 views

How to bind Mesh Deform modifier with Python?

I'm trying to bind a Mesh Deform modifier to an object, but when I do that via script it creates one, sets the object to deform with (here child). But when I call bind from the script I does not bind ...
3
votes
1answer
161 views

How to set origin points of multiple objects to a corner of their bounding boxes with Python?

So, I’m new to scripting in Blender but I do have a project which requires me to change the origins of all the meshes to minimum X, maximum Y and minimum Z coordinates of their bounding boxes so the ...
0
votes
1answer
91 views

Impossible to invoke a message inside of a timer app?

it is impossible for me to invoke a message within a timer app, is it normal? or is it a bug? for this message system: ...
3
votes
1answer
56 views

In add-on script, how to automatically rewrite string in the bottom statusbar on each edge select/deselect in edit mode

I'm trying to write my first add-on that should tell me the summary length of selected edges in edit mode if there are any. I got the part with getting selected edges and counting sum length, but what ...
0
votes
1answer
23 views

Changing the name/icon/function of menu/pie menu/panel with a condition?

for example in this pie menu below ...
1
vote
1answer
29 views

How to specify number of cuts for subdivision modifier in python

I'm working on a custom panel in Blender. I can add a subdivision modifier with python like this: ...
0
votes
1answer
40 views

How to populate UIList with all material slot in scene? 2.8

I make that script (Copy a piece from template UIList) Now i can draw My box with inside the active object material but i want to populate that with all material in scene, i not undertand , how to. ...
1
vote
1answer
31 views

Placing cubes in a grid is very slow (using python script)

I'm trying to generate a scene comprising of voxels generated from a 3D data matrix. However the script that I'm using is super slow (~1h per image), and most of the time is consumed while building ...
0
votes
0answers
17 views

How can i get the Driver Value? (which is displayed in Debug info)

Hellow, Please tell me how to get the value of the driver, which is displayed in Debug info. blender 2.79. F-Curve.evaluate(frame) - this value after all modifications, and I need what is in this case ...
0
votes
1answer
15 views

Execute a specific action on the first run of the script?

Id like to execute different action on the first run of the script for example the first try i want to execute: Print("First Hello") and on the second run. <...
1
vote
0answers
10 views

noise.random always outputs the same value (Blender 2.80, Python, Compositor nodes)

I have code that procedurally generates images with a lot of random values for models, lighting, textures, etc.. Part of this process is randomly shifting hue/saturation/value in the compositor to get ...
1
vote
0answers
29 views

Drawing simple non interactive gizmos in the 3DView

For some tool I am working, I would like to draw some simple non interactive gizmo (Preferably in the shape of a “+”) in front of vertices my mouse is currently over, and I was wondering what solution ...
0
votes
1answer
24 views

Way to get vertex index to use in new vertex group from selected faces

I try and not undertand if i am on the right way, that code i want to set the select faces, make a vertex group, this is a piece of code: ...
2
votes
0answers
12 views

How to Link/Append collections from a different blender file in 2.8

im trying to link some collections from python, and i was following the example from this post : How to Link/Append a data-block using the Python API? but its not for 2.8 and it uses groups, how can ...
0
votes
0answers
11 views

Move hair keys by code

I'm working on an add-on that needs to move hair keys, i wasn't able to find any info about it. I'm also new at programming add-ons, so i need some help. i tried to set hair_keys[key].co to a Vector, ...
0
votes
1answer
23 views

How to wait for an operation - to another operator - to complete within an operator (import_scene)

Besides the point but why is this not working as a default stack is expected to work? I'm trying to get an operator to call another operator and wait for the operator's response before proceeding. ...
0
votes
1answer
83 views

Do an action automatically every n minutes with Python?

I want, for example, to move the context.object every 10 minutes automatically. So no action needed, if I run my script the first time it will activate this incremental action, and if I run it a ...
0
votes
1answer
27 views

How to put if condition for empty material index

I need to have access to the active material and its nodes (if they exist), so I wrote this script that has a problem, when the object has no materials, when the object does not exist, and of course ...
0
votes
0answers
20 views

Way to get UIList for objects in an collection (2.8)

I make the Uilist example and i created Uilist for material inside an object: ...
0
votes
0answers
25 views

help with animation on code not object

I'm working with fractals in Blender/Octane. Unfortunately, it is having a hard time rendering, but rendering in octane is fine. I cannot transfer my animation data from Blender to octane however, ...
1
vote
1answer
27 views

How to find the highest end value of nla strips in a group of objects?

I have a group of objects in my scene that have animated materials. I've converted the material animations to NLA strips, and am trying to find the highest value in the list of end frames that the ...
0
votes
1answer
42 views

Cannot find toolbar in header - blender 2.8

Hi, I cannot find the toolbar in my blender and when I search toolbar it shows like this in the second image
0
votes
1answer
45 views

Changing the scene

I have tried changing the scene, but it doesn't seem to work. Am i missing something? ...
0
votes
0answers
30 views

How can I swap two objects positions?

Either a script or addon or whatever, is there any easier way to swap the Z coordinates of two objects in one click or something, I am making a graph like animation and I need to swap the bars a lot, ...
1
vote
0answers
8 views

Detecting objects within frame’s camera FOV

In Blender 2.80 EEVEE how to enumerate a list of all objects it has to render in a given animation frame? Alternatively how to test if a known plane is in the FOV on a given animation frame? Thanks!
0
votes
0answers
7 views

Customs boolean property for Material slot?

Is possible register a custom property (boolean) to be assigned to the active material slot? Normally for object property i use : class Property_Settings(bpy.types.PropertyGroup): ...
1
vote
0answers
27 views

How to hide/show Collections levels with python?

Hello in this code below i create a lot of collection and add backups inside of them, its kind of a cool withing the file backup system ...
0
votes
1answer
36 views

AttributeError: module 'bgl' has no attribute 'glColor4f'

I'm running the Python template operator_modal_draw.py in Blender 2.80 and I am getting this error in the Console: AttributeError: module 'bgl' has no attribute 'glColor4f' Is this problem just for ...
1
vote
1answer
26 views

How to export Bone Weights?

I am editing the default OBJ exporter of Blender (io_scene_obj) to create my own version which supports bone weights, for skeletal animation. I now know how to access the bone weights per vertex in ...
1
vote
1answer
22 views

Change nodes position through scripts [duplicate]

I'm Creating some nodes through python script. The problem is that all the nodes are overlapping each over. I just wanna programatically re position those nodes. How to do this? ...
0
votes
1answer
18 views

BGE: Which script names produce a “module has no attribute” error?

When I name a module script wave.py it breaks and I get this in the console: ...
2
votes
1answer
53 views

Disappearing metaballs when creating with Python

I have created a simple addon that creates a series of metaballs. Sometimes when the addon executes, the metaballs are rendered invisible (as only outlines, no surface). Usually the metaballs seem to ...
0
votes
0answers
13 views

Running Modal Operator based on condition: Is this legit?

I am using a Modal Operator in my add-on and would like to know if it is a bad idea to use the same Operator sometimes modal and sometimes directly: ...
0
votes
0answers
25 views

Red images when taking screenshots from script

I'm running this extremely simple script in Blender 2.79b: import bpy bpy.ops.screen.screenshot(filepath="file.png", full=True) And I'm doing so just like this: ...
0
votes
1answer
36 views

Python and particle system

I have been using this code to add a new particle system and create a name for it... I need help to choose the particle type "HAIR" and set other parameters.. This script does not work because the [...
0
votes
0answers
10 views

Script has no errors but is still not working

Hey everyone I am creating a simple pie menu but it doesn't seem to be working. I was trying to do this for 2.8. Here is the code ...
0
votes
0answers
6 views

Batch OBJ Import - Change all materials on all objects to the base material for each [duplicate]

I have batch imported 300 obj files (a tile set) into blender. When I do this, the materials get cloned many times for each object. For example, Object 1 might have "Rock", "White", "Red" as ...
0
votes
0answers
14 views

What is the substitute for gpu.export_shader in Blender 2.80?

I am trying to export GLSL from Blender materials in a scene. This call appears to have been removed from module "gpu" in Blender's Python API as of 2.80. Is there any substitute? How should I proceed?...
0
votes
1answer
37 views

Blender Collision Simulation Data

Is it possible to access data from a collision, such as point of collision and impact force? I am trying to simulate a "drop test" in Blender and cannot figure out how to access the information. As of ...
0
votes
0answers
13 views

How to have a script affect all selected bones?

pretty nooby to python here, so go easy on me. I’m trying to set up a script that will fix the bone connections of models exported from source filmmaker. I’ve made a script that works but it only ...
0
votes
1answer
48 views

register group of properties 2.8 [duplicate]

I'm updating my addon to 2.80 and I'm stuck with the new register class system. I try to follow the answer here but I'm not good enough as a coder to understand the solution. The problem comes to ...