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

Create a tree of properties?

My add-on acts upon a hierarchy of data (a tree). I am not sure how best to represent this hierarchy as properties to expose the data to the user. For simplicity, let us define an example: say that ...
0
votes
1answer
42 views

remove node links by python

Will someone tell me what is wrong and way this is not working ...
0
votes
0answers
9 views

How can I test a Python module that I ran in the the text editor in the Python console? [duplicate]

I have a Python script that I named moduleA.py in the text editor. I ran the script by clicking the "Run Script" button. Then I expected to be able to import the module in the console with "import ...
0
votes
0answers
14 views

How to correctly extract triangles and vertices with Blender 2.8 for exporter using Python?

There are many ways to access mesh data in Blender and I'm curious if this is a correct way to extract separate triangles from meshes in Blender 2.8: ...
0
votes
1answer
18 views

Typerror: 'vector' not callable

I am tying to make a go-kart game in blender. Im not even halfway completed but, my code doesnt seem to work. please help. this is the code: ...
0
votes
0answers
10 views

Blender Python Bmesh Shapekeys

I'm currently trying to create an importer, and i'm trying to create the meshes completely via the BMesh module. Adding vertices and faces works perfectly fine so far, but for some reason, after ...
0
votes
0answers
19 views

can we rotate a cuboid in Python?

My question is that can we rotate the cuboid that was defined below with the euler angles in python? ...
0
votes
0answers
10 views

How to add a 3D importer to the UI via Python

Just wondering whether it’s possible in Blender to code a file importer UI so that users can preview a set of 3D objects and add it to the 3D viewport? I guess something sort of like this from Daz ...
0
votes
1answer
35 views

If else function

I have two objects "ObjectA" and "ObjectB". Object A when selected extrudes up in the z direction. Object B when selected extrudes down in the z direction. Currently I have two different buttons each ...
0
votes
0answers
10 views

merge and create convex full on every frame

I'm attempting to visualize a form of 3d printing using blender. I was hoping to use a primative such as a sphere and just overlap them, but this causes some strange highlights, shadows and dimpling ...
0
votes
0answers
16 views

Texture change on each new object

I have a lot of objects (more than a hundred pieces, they are the same in models) I have material with texture. The texture should change on each new object. Example: for cube1 there will be texture ...
0
votes
0answers
10 views

Blender (BGE) crashes when I open a socket

I am running this script on my BGE... I had issues receiving the socket information inside a while True loop. Then realised that the ...
1
vote
1answer
21 views

Select coordinates without a given z ? by using KDTREE

Would it be possible to use the KDTree without taking into account the z-coordinate? According to the documentation, find(co) necessarily requires a vector (x,y,z) but what interests me is to find the ...
0
votes
0answers
16 views

Link collection instance from external file using python

I am trying to write a simple addon that converts highpoly objects to a vertex cloud representation (more accurate display than bounds) using collection instances to create a kind of "proxy" version ...
0
votes
1answer
23 views

Different output image when I set “use_borders = True” - in python script

I try to split render process (by python script) to several tiles and after finishing render process, join sub-results into one image. I set use_borders to True and I set min_x, min_y, max_x, max_y: <...
0
votes
1answer
15 views

BGE Mouse Look Min and Max Bounds Changing?

I have written a script in python that successfully saves and loads the position and rotation of my player cube and camera for use between scene transitions. However, something is going wrong with the ...
0
votes
0answers
13 views

How to update a function when render engine change? (Blender 2.8)

Probably wrong to search and I can't find an answer. I need to execute a function when the context changes from ..eevee/cycles/eevee...(I would like to avoid the "Update" button)
1
vote
1answer
33 views

Select multiple vertices using a list of coordinates with KDTree

I want to select (or to put into active selection) some vertices using their coordinates so I've seen an answer there : Automatic select vertices by given coordinates But it only works when I'm in ...
0
votes
0answers
9 views

To which array does `mesh.loop_triangles[dx].material_index` point? (Blender 2.8)

I'm writing an exporter and wondering where material_index points in e.g. this loop: ...
0
votes
0answers
14 views

Way to set directory (in addon preferences) and store it in stringproperty only on the first time 2.8

I'm trying to figure out a good way, easy to set a path for a folder containing my asset. I wish it could run in the context ...
0
votes
1answer
18 views

Interactive Web Application

Is it possible to use Blender for creating an interactive Web App, so that you can change some values in HTML form and by clicking a button, apply them to the script /model? I downloaded Blend4Web ...
0
votes
0answers
16 views

Convert Blender rotation to Unity Y-Up left handed

As the title says, i'm writing an exporter for my Unity game and i need a way to convert rotations to Unity's left handed Y-Up coordinates. I've been looking it up but it either doesn't give a correct ...
4
votes
0answers
23 views

official name and meanings of properties (Custom, RNA , ID etc)

I sometimes feel difficult to call type of properties which user (or add on) added. and choice of them.(set driver etc) I know there are clear difference and how to add new properties, but I still ...
0
votes
1answer
47 views

Animate wireframe slider Blender 2.8

Is it possible to animate the wireframe slider in the viewport overlays using Python?
1
vote
2answers
50 views

How to select all faces within a square with a certain length and at a location (x,y)?

I have seen this : Selecting faces within a given radius But it's a circle, I'd like to do the same but with a square So is there a way to select a face from a coordinate point (x,y) and then ...
1
vote
1answer
41 views

How to set active 'Scene Collection'

How to set active 'Scene Collection'? bpy.context.view_layer.active_layer_collection = bpy.data.collections['Master Collection'] not working.
0
votes
1answer
23 views

Animating a Bezier Curve to Music

I'm trying to animate a bezier curve to music to create an visual equaliser type effect. I am not an experienced blender user, but I have some experience with python. So far I have managed to put the ...
0
votes
1answer
6 views

How do I access a Rigify Control by name (Grouped and linked into scene) with python in 2.79

I used rigify to generate a control rig over a Basic human Armature. I then grouped the Armature+Control rig so I could link it into a scene. In the Scene where it is linked I made the rig a proxy so ...
0
votes
2answers
54 views

Get previous value of updated property

I have a UIList with a "name" string property, it has an update function, but I need access to the name before and after the update, but as you run name_update() the name has obviously already changed:...
0
votes
0answers
22 views

Particle system edits are not preserved in rendering

I am trying to manually change particle information so that I can use it to control the color of individual particles. Here is my setup for a minimum example: Add an Icosphere (subdivisions=1, so ...
0
votes
0answers
22 views

How to have a real-time feedback in a menu/panel/pie?

In the code below, I'm invoking a custom property that redefines itself every 1 second inside of a pie menu, but in the pie, nothing is in real time, it's "stuck in time", is there a way to make it ...
0
votes
0answers
22 views

Blender python subdivision problem: mistake or bug?

I've been working on a python script in Blender (2.8) and so far everything's been going fairly smoothly, except for an infuriating problem I encountered yesterday. It seems that the 'bpy.ops.mesh....
1
vote
1answer
25 views

Is there any way to silence the reporting in the 'Info' window when deleting objects with a script?

I'm working on an addon that adds or deletes objects. Sometimes this can be hundreds of objects. The problem is upon deleting 100 objects, the Info editor is filled with 100 lines of ...
0
votes
1answer
29 views

Importing fonts with python script

I would like my users to select a font, essentially opening a folder, so they can choose. My fonts will be loaded in a special folder, such as C:/myfolder/fonts. Is there an easy script to do this?
0
votes
0answers
16 views

How to wright a script to import mutiple objects with position and roation data

i have aquired a script that imports mutiple objects with postion and object data, the only problem is that is for 3ds max, i have 3ds max but im more of a blender man and i have no idea how to code, ...
0
votes
0answers
11 views

Accessing MeasureIt data with a script

I’d like to dimension and measure corner angles of objects with MeasureIt and then access them with a script so I can output a list of the objects with their specs. At this point I'd just like to know ...
0
votes
0answers
10 views

How to create a triple click shortcut?

I'd like to select the whole line of text by triple clicking in the text editor, and not by hitting "Shift A" but i don't know how to do a triple click within blender, the option isn't there (yet?) i ...
1
vote
1answer
20 views

Finding grease pencil erasers via python in 2.8

I'm writing a script to index through the grease pencil brushes but I would like to filter out eraser brushes. I can determine if the brush is used for grease pencil by ...
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
20 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
30 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
23 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
158 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
90 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: ...