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

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

Blender in ElementaryOS installed from most recent 2.79 build

I installed most recent blender from ppa:thomas-schiex/blender to get the most recent blender version. Starting blender now results in crash. Running blender inside terminal from directory /usr/lib/...
0
votes
1answer
21 views

How to add and use renamed Mirror modifier with Python?

In this code for 2.8, that works, I am creating a mirror modifier assigned to a cube. ...
1
vote
1answer
15 views

python: removing vertices from mesh but still can access them from data

I'm trying to understand what's going on here: ...
0
votes
2answers
20 views

Using python to change the settings of all subdivision surface modifiers

I found this python script to add a subdivision surface modifier to all objects ...
0
votes
0answers
14 views

How to create an object from part of a mesh in the same location(like saparate) using Python in Blender?

Knowledgeable people of the internet! I’m working on a script, that at some point, using bmesh module and being in Edit Mode, creates verts and edges which are then used to generate a mesh via ...
1
vote
1answer
43 views

Blender 2.8 - Modal Operator: How to change modifier settings?

I am trying to change a the "ratio" within a "decimate" modifier with a modal operator, but cannot get the value to update (my guess is I am not passing the right value?) ...
0
votes
0answers
17 views

Cut and Seal Mesh (python script)

Following on from this thread, I would like to be able to cut a mesh into smaller objects, while sealing off the cut (with a plane) so that my particle system works as intended. Both objects created ...
0
votes
0answers
23 views

Blender 2.8 script crash on Armature select in Object mode

Okay so I'm trying to update a script I have been working on for Blender 2.8. I've gone through the API changes and that was relatively straightforward but now I'm getting crashes on my operators for ...
0
votes
1answer
17 views

How to detect if a vse strip is used in conjunction with an effect strip with python?

Moving strips which are used in conjunction with an effect strips will cause errors if moved(with python) without the effect strips, and most of the effect strips can't themselves be moved because ...
0
votes
0answers
18 views

Which api/data structure does blender use to represent its meshes?

I am wondering which underlying data structure blender uses to represent its meshes. I tried going through the source code but answering that question myself is harder than expected.
1
vote
0answers
16 views

Using Python to read an audio file that controls animation?

I've done a lot of web searches but I must not be asking the right question -- what I'd like to do is use an audio file to control animation. Specifically, I want the volume of the file to make the ...
1
vote
0answers
27 views

How to make a simple Format Conversion Script?

I am a newbie in Blender and have only basic knowledge of Python scripting. But I thought I could make this script on my own - but failed. My basic idea is to import the file with ...
0
votes
0answers
8 views

How do I apply a texture to each 'Part' in my model via python script

I have imported a .obj model into blender, which contains a long list of individual parts making up the model, and I wish to iterate through each part and apply the same texture to them. How do I ...
0
votes
0answers
8 views

How to get a Bone id (that is shared with the vertex group)?

I'm making an exporter for a 3D renderer of mine and am implementing a simple static armature exporter. Currently all of the bone IDs are the value of group in ...
0
votes
2answers
38 views

How can I view and edit modifier properties in the viewport in Blender 2.8?

I've just recently started playing around with Blender 2.8 after years of modelling in different software packages. I've memorized the most used keyboard shortcuts and customized most of the stuff, so ...
1
vote
1answer
21 views

Convert Cycles depth/z to distance to image plane

I want to simulate a depth sensor with Blender Cycles, but the z-pass returns the length of the sight ray and not the distance to the image plane. Here is a formula to convert the depth map, but I am ...
0
votes
2answers
31 views

How to bind a series of commands to a custom hotkey (scripted macro)?

How would I go about creating a hotkey that would operate as follows?: With an object selected in the modeling viewport: Press Shift + D (this would be the custom shortcut to trigger what follows ,...
1
vote
1answer
16 views

Python script to make all adjacent keyframes have constant interpolation

I made a Cycles animation with motion blur enabled. Whenever the camera "cuts," the rendered frame is a big, blurred sweep. How do I write a Python script that changes the interpolation mode of all ...
1
vote
2answers
53 views

bl_idname requirements for 2.80

The python api change notes for 2.80 give new requirements for bl_idname. I'm getting an error telling me that "MAPLUS_OT_changetypebaseclass" is an invalid name: ...
1
vote
1answer
27 views

Make a Blender script run an external program

I'm making a script to share data between Blender and After Effects: i created an addon in Blender which exports a .txt file in the After Effects directory (or a custom one) and I created a After ...
0
votes
0answers
13 views

Python - how to 'get' an object after creating it

If I create an object... circle = bpy.ops.mesh.primitive_circle_add(radius=size, view_align=False, enter_editmode=False, location=(x, y, z)) What is returned (<...
0
votes
0answers
5 views

Python: How to remove all shape keys after copying?

I am very new to python in Blender and have done some searching around and have spent a too much time for this without any result, what am I missing? Below is the code for blender 2.8 beta, which ...
0
votes
0answers
9 views

Change object position depending on resolution

How can I using the console change the objets position on viewport? For example 1920 the object it's on a position: But if I change the resolution to 600: The viewport cut the elements, how can I ...
0
votes
0answers
14 views

What is the difference between bpy.context.object and bpy.context.active_object?

I recently came across this question, which has an interesting detail in the accepted answer: Also be aware that sometimes you should be checking for ...
0
votes
0answers
11 views

How to track an object to a specific property in the Blender Game Engine

I make a game with the Blender Game Engine. I would like to make a cube (Enemy) which moves inside a Navigation Mesh. This cube should follow all the objects with a specific property. The cube also ...
0
votes
2answers
45 views

Select an object with Python in 2.8

I'm new at scripting. I know that it's a basic question but I tried everything I could and nothing works. So here's my problem: I want to create a shortcut that automatically sets up a mirror ...
0
votes
0answers
22 views

Asset Management (addon): How to add all materials in the scene to the library?

How to add all the materials in the scene to the library in the Asset Managemnt addon? There is any python code to do that?
0
votes
0answers
23 views

How to get to work with the image of the camera with python

I'm moving the camera around an object all with python script. Now I want to get the image from the camera and work with it (some image processing) and then save it..Etc Now I'm just rendering the ...
2
votes
0answers
13 views

Getting object has no attribute 'startFrame' when trying to export animation using a script

Hello I am trying to get a simple script to which will import an rtm file(animation file) > do a few actions > export rtm file. In my script everything works except for the last of bit code which ...
1
vote
1answer
26 views

Can't get the active_object in Operator

I try to get the active object by "bpy.context.scene.objects.active" in my operator, but I receive a error 'Context' object has no attribute 'objects', what's wrong?My scripts is as follow: ...
0
votes
0answers
14 views

Calculate 2.5D point cloud from scene

Ich would like to generate a 2.5D point cloud of a scene from the camera's perspective with python. Let's say the camera has a rosolution of [n,m] pixel and as a result I want to have n*m 3D vectors ...
0
votes
0answers
21 views

Select adjoined handle in Sequencer with python?

How do I select the adjoined handle in the Sequencer with python? I believe that the code actually should do this, but it doesn't? ...
0
votes
1answer
30 views

Blender Python: Running multiple timers

I have a bit of a weird problem that I simply cannot seem to get around. I want to run 2 timers, each set to a different interval. The problem that I'm having is that both classes receive each others ...
1
vote
1answer
18 views

How to script blender to quit after rendering is complete Mac OS10.13

I've got a script that automatically renders and saves the render, but I'd also like to have Blender quit when the render and save is completed. Since I will be running renders overnight, I'd prefer ...
0
votes
1answer
27 views

link collections in python

As simple as it is to link a collection with another one just by drag and drop I can't manage to find the way in python. ...
0
votes
0answers
18 views

Sure UVW Panel - properities display

I am trying to adapt old Sure UVM Box add-on to Blender 2.80, but I have problem with displaying the parameters panel in 3D Viewport ( do not know how to name it ). When I run it via PieMenuEditor ...
1
vote
0answers
18 views

Garbage collection in Blender

I'm working on an iterative process for optimizing the placement of some objects. This iterative process seems to leak the memory (I use numpy matrices). I do destruct the lists and matrices after ...
0
votes
1answer
24 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 : ...
0
votes
0answers
8 views

How to create Modal Operator that extrudes, moves and rotates selected in Edit Mode?

I'm trying to learn about modal operators in blender. I'm a complete novice and I'm struggling with the idea of how to correctly map the mouse movement onto the bmesh operators. I'm essentially ...
0
votes
0answers
24 views

“bpy.context.scene.object_bases” not working in 2.80?

The 2.8 documentation for the context override is found here: https://docs.blender.org/api/blender2.8/bpy.ops.html?highlight=object_bases ...
0
votes
1answer
11 views

How to read a pixel from an image texture with Python

My Python script needs to read RGBA values from a specific pixel of a texture bitmap. How can I do this in Blender?
0
votes
0answers
37 views

How to split object by plane via script

I have a single complex 3D object. I would like to cut this object at regular intervals along the x-axis into separate objects. This is because I want to apply a separate particle system to each piece,...
1
vote
1answer
42 views

How do I access workspace areas in 2.80

In a previous script I made for 2.79 I could change properties on a particular layout area without having it active: ...
0
votes
0answers
13 views

How to use Blender to capture handmotion with a hand glove using flex sensor

I am doing a project that using a hand glove with flex sensor and I have to capture the hand motion of fingers and wrist. I don't know how to connect arduino with Blender, so I searched that we have ...
0
votes
0answers
24 views

Batch trimming materials to first 10 characters

I'm trying to go through all of my materials in Blender and trim material names to just the first 10 characters. This is so that on OBJ export I won't have hundreds of different names (materialX.001, ...
1
vote
1answer
24 views

Blender 2.80 where is the “interactive code panel” gone?

For a lack of a better term, please look at the following image. I have been trying to drag around 2.80 like a maniac, was it moved somewhere else?
7
votes
1answer
139 views

What do new bpy class naming conventions in Blender 2.80 actually mean?

What are the new class naming conventions in Blender's 2.80 Python API for add-ons? It says here: This constraint applies to the bl_idname of each class (or the ...
1
vote
1answer
46 views

Registering classes in 2.80

I would like to start developing in the new beta build environment. For that, I want to register classes the new way: https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Addons ...
0
votes
1answer
136 views

Blender 2.8 - Python - “active” removed from API - How to pick active object now?

I want to pick the active object in the scene to tweak some settings at this object. A camera. In Blender 2.79 and lower this could be done by bpy.context.scene.objects.active And it worked fine. ...
0
votes
0answers
11 views

Lock 3D view center to active object shortcut ?

i want to create a shortcut (possibly with the help of a script, i use custom pie menu) to lock the 3D view to the active object (lastly selected object) How am i supposed to do that ? thanks