Stack Exchange Network

Stack Exchange network consists of 174 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

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

How to randomly pick a node from a set of nodes to use?

Sorry if the title is confusing, or this has been answered before. I have a bunch of mapping nodes, all with different values. I want to randomly pick one of those to use so that each of the particles ...
2
votes
1answer
18 views

Transform Vertices by Matrix around Custom Point

I need to scale the vertices to 0 around the median point as here. Should get something like this I use Mathutils and multiply the Matrix.Scale(as Axis I take the average of all vertex normal) by ...
0
votes
0answers
12 views

How can I set log level in UI-Less rendering in blender?

I have try UI-less rendering in blender use --background parameters in terminal, but this will print something like this ...
0
votes
0answers
14 views

How to get cursor location to update with redo using a Python script?

I am trying to toggle restoring the cursor location using redo, but it isn't working as expected. Any help? ...
0
votes
0answers
12 views

How do I add a new material to each individual face in python code?

How do I "diffuse_colour" on individual faces of an object in a python script for a Blender addon?
0
votes
0answers
21 views

Custom Render Stamp, Principled BDSF values

I am trying to do a material study, and I would like to print the Principled BDSF values onto the render. Previously I had found this: How to show render-stamp for arbitrary values? It had worked, ...
0
votes
0answers
9 views

Opengl blf text - No module named 'bge' ( Blender 2.79b )

So,I wanted some Opengl text in the 3d viewport (in Blender 2.79b )and decided to run the python script from blender's website which comes in the blf module (https://docs.blender.org/api/2.79/blf.html?...
-1
votes
0answers
8 views

Make a auto opener app with python

i want to make a auto miner, My script will pack with a miner app. i want to do these : 1.when task manager closed app, script reopen miner. 2.if pc is going to restart, script reopen miner. My ...
0
votes
0answers
23 views

How to make a comet's tail in a better way?

I have an astronomical assignment about comets. I have modeled my comet with Blender, but the problem is ... I'm still confused about how to make the comet's tail. Can anyone help me ... I've tried ...
0
votes
2answers
24 views

BPy Funtcion long to short?

i have a question. it is possible this function in any way to shorten ? ...
0
votes
0answers
11 views

Swapping objects from different layers at key command realtime

I am creating a game where you click to spawn balls that bounce on a keyboard to play melodies/notes. Currently there are two types of balls, one which spawns on click in a certain area, and one which,...
1
vote
2answers
34 views

Network Decode with Modal Operator

I am working on a script that reads network packets to modify the emission strength of lights. In order to use the UI at the same time as reading from the network, I have created a modal operator: <...
2
votes
1answer
32 views

Decimate only “bad” objects in a scene

I'm working for a company and they have to optimize 3d scenes to be rendered in virtual reality. The problem is that the people who are modeling the scenes are really bad at doing that. I've seen ...
0
votes
1answer
24 views

Accessing keys() of objectcollection in custom menu

So, I was creating a custom menu (in 3dview) of active greasepencil colors, for switching between them when coloring my 2d animation, I wrote a script which was to invoke the ...
0
votes
0answers
5 views

Calling bpy.ops.wm.revert_mainfile() operator multiple times in one script

I have a script which iterates over objects in the scene. Each iteration removes the rigid body property from the given object (bpy.ops.rigidbody.object_remove()), ...
1
vote
1answer
18 views

Changing MakeHuman mesh vertices by scripting

how can I change the mesh in MakeHuman from script? For example, I want to change the geometry of the nose, given that I have the desired coordinates values of the nose vertices, how can I assign ...
1
vote
1answer
46 views

Smart unwrap using script

I am stuck. I am trying to smart unwrap objects individually using script. I tried this code but it fails. Any help is appreciated ...
1
vote
1answer
37 views

How do I split the edges on all objects in a scene with a script?

I want to create a script that opens a blender file and splits the edges of all objects in it, perhaps ignoring those that are specified as smooth. This is for a custom renderer that takes in blend ...
1
vote
1answer
19 views

Installing Python 3.6 on any version of Blender

I am trying to install Python 3.6 on any of the recent versions of Blender. I cannot use Python 3.5 because I need to use the python package mne. Upgrading to Python 3.7 as in Blender 2.8 results in a ...
0
votes
0answers
13 views

Blender Motion creation

Is it possible for math function to be created in python, that could be used in the designing of animation? For example using sin or cosine for the motion of the bones . Is this what most animators ...
1
vote
2answers
19 views

How to make a Text File dependent of an Armature object so that it appends with it to other projects?

If you ever used BlenRig, you may have noticed that it pops up a text file in your text editor called "generate_customprops.py". This is a python script that the rig uses for various purposes such as ...
1
vote
1answer
25 views

How to apply transformations to an object using the world matrix?

I'm taking a computer graphics course. In one assignment I had to check if a matrix transformation maps points to another set of points I thought that the best way to learn how this was to use ...
1
vote
0answers
17 views

Extract face data from polygons

I'm trying to extract face data from a blender file. I extracted vertices using bpy.data.objects["Main:Body"].data.vertices, and then in a ...
0
votes
0answers
9 views

Displaying a modal dialog

I'm new to Blender development and I would like to display the equivalent of a Qt QMessageBox.question dialog box to the user. If someone has an example UI using ...
1
vote
0answers
34 views

Blender 2.8, how to access UV coordinate data

Question: How to access UV coordinate data through specific material in Blender 2.8 when using material nodes? Detailed explanation: When creating custom export addon for Blender, I would like to ...
1
vote
2answers
24 views

Vertex count increases drastically when exporting to .FBX

I am trying to export FBX file from Blender so I could use it in my OpenGL app, but when I export it, the vertex count increases from ~6k to ~25k. I wouldn't really mind it, but I additionally have ...
0
votes
1answer
22 views

BPy Image_Editor - remove Image completely problem

i have a big problem in the Image_Editor/UV to remove completely a Texture. her a screen: I don't think I have to say anything more about that. i hope anyone can me help.
1
vote
2answers
20 views

How to remove dead BMVerts from a list?

I am trying to fix a bug in my script that happens in rare instances. I believe the bug occurs due to the very last thing the script is doing, which is: ...
1
vote
1answer
33 views

F12/devtools like JavaScript in browsers

I'm mostly a JavaScript developer and I enjoy to explore objects and quickly write new source code via F12/devtools in browsers like Chrome/Firefox. The browsers even allow to set breakpoints and ...
0
votes
0answers
10 views

Unsmooth connection when adding skin to a skeleton, any reasons and solutions?

what I am trying to do is to: 1) read in a list of connectivity; 2) created skeleton in Blender, here I connected all the edges based on the connectivity ; 3) wrapped the skeleton with a layer of skin ...
0
votes
1answer
61 views

How to run physics simulation frame-by-frame using Blender's Python API?

In my scene, I drag some of the objects and move them around while the physics is running (Alt+A). This means that the physical interactions could be quite different every time I do start the physics (...
3
votes
1answer
32 views

Is it possible to export a program created with the animation node as a python script?

Is it possible to export a program created with the animation node as a python script? I would like to convert an animation node into a python script. I am not familiar with Python script, so I ...
0
votes
1answer
36 views

Rendering a cube as png file using Blender's Python API

I am new to Blender. I create a cube and want to render it. Since, we are later going to do this for large number of shapes, we are working with Blender's Python API. I want to save this rendering as ...
3
votes
1answer
56 views

How to join two areas using python?

I'm working on a script which should add a trim mode to the sequencer. The preview area is split into two preview areas, until the trimming has finished and the two areas are joined again, but I can't ...
0
votes
1answer
27 views

Permission Errror

when I try to export my objects via a python script: ...
0
votes
1answer
14 views

How to extrude a bone using Blender's Python API?

Assuming that I have selected a bone in the scene, how can I extrude it either from either tail or head and position the new bone somewhere in the space using Blender's Python API? In Edit Mode, I ...
1
vote
1answer
14 views

2.8 Python Outliner Collections

Im trying to make a script to add a set of collections to the outliner as I often setup the same or very similar hierarchy for each my projects. In Blender 2.8 if you right click in the outliner and ...
1
vote
1answer
49 views

Save every object in scene as individual .blend files via python?

There is an excellent example here: https://blender.stackexchange.com/a/63000/37272 which saves all objects as .fbx files, but how do I get the script to save to .blend files instead? EDIT: This line ...
0
votes
0answers
16 views

How to convert pose bone's global position to bone's location or bone's matrix?

When I try to set pose bone's head in keyframe, I knew that the bone's head is just read only, so I have to convert the bone's head to bone's location or matrix, after searching a lot of information,I ...
0
votes
1answer
29 views

How to write a script that executes a list of commands only if a specific object is already inside the scene: Easy question I think!

I was wondering how to write a conditional in a script so that a list of commands runs only if an object IS NOT inside the blender scene currently. For example if "Cube" is already in the scene I ...
0
votes
2answers
23 views

How to determine whether my bm.select_history.active is a BMVert, BMFace or a BMEdge?

I am trying to write a conditional statement for my script. If the user has one Active Edge Selected, then the script will run. Otherwise it won't. I know that if I have an active edge, then bm....
1
vote
0answers
13 views

Mark seam and clear seam in one button

I have been looking for a way to do this for a long time (mark_seam (True\False) and mark_sharp (True\False)) with one button in ...
1
vote
2answers
34 views

When I subdivide a face, how do I get each face from the result in Python?

For example, if I subdivided a square face so there were now 4 faces, how I do iterate through those 4 faces in a Blender add-on?
1
vote
0answers
52 views

How to match points on rendered images?

I have several rendered images of object from different views. I take one rendered image. Every point on rendered image (2D coordinates) is matched to point in world (I call point of image as "...
0
votes
0answers
21 views

How would one code a pie menu with an additional traditional menu beneath it?

What would be the nicest way to code(in Python) a pie menu in Blender 2.79 or 2.8, that would have another menu as an addition to the standard 8 pie menu choices? After playing with it for some time ...
0
votes
1answer
36 views

How to find out which modes (object, edit, weight paint, pose etc) is activated using Blender's Python API?

There are buttons for switching to object mode, edit mode, pose mode and others. How to make sure which of these modes is active using Blender's Python API? Any information would help! Preferably with ...
1
vote
1answer
24 views

NET_RENDER keep getting RuntimeError: Error: [Errno 32] Broken pipe

I'm trying to make a net_render render farm on a cloud platform and I keep getting "RuntimeError: Error: [Errno 32] Broken pipe". code dump: ...
2
votes
1answer
30 views

Need a faster way to loop all frames and set keyframing data on properties?

I currently have a file that contains animated blendshape information: ...
3
votes
2answers
65 views

How to use Python script to generate many lines in Blender and then animate line color and thickness?

I'm very new to Blender and to writing Python scripts for Blender. For the project I'm working on, I'd like to be able to create 10,000+ straight lines (see image below) and animate them so that their ...
1
vote
0answers
13 views

Is there any way to register a callback for a bpy.prop undo event?

Is there any way to register a function that gets triggered on a property undo event ? Just like you can register a function for property update, get, or set events. And btw, why properties ...