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.

13
votes
0answers
536 views

Property Panel Custom Popup Menu when user presses hotkey over an input field

is it possible to trigger this kind of menu: in the property panel when I press a hotkey over a button/input field? I want to specifically,when the user presses a specific hotkey when over an input ...
12
votes
0answers
352 views

How to make a dynamically expanding menu in Blender?

Say we want to navigate a tree structure without knowing all the data ahead of time, is it possible to do this in Blender? For example, a menu which dynamically loaded a directory hierarchy from the ...
10
votes
0answers
2k views

How to create macro/record actions while modeling

I'd like to record my actions and create a macro. I've tried allready two things: 1) copying actions from Info panel and pasting them to text aditor. Then adding the lines: ...
8
votes
0answers
110 views

how to configure facility wide configuration files

We'd like to integrate Blender into our pipeline. With other software packages, we usually have cascading configurations: facility (eg configuring temp folders and common plugins) project (eg project ...
7
votes
0answers
216 views

Blender on Windows is skipping python script. (brenda on windows)

We've been using Brenda for quite some time now for rendering architectural stills. Since our editing stations are doing nothing at night, I started making a desktop app that allows you to pick jobs ...
6
votes
0answers
225 views

How to call original operator from operator's override?

I would like to amend functionality of an existing operator with a condition check and then "proceed" with the original operator (if condition check allows it). It is essentially what is done in ...
6
votes
0answers
399 views

Save screenshot (bge) without writing to disk

This is a little odd but I need to save a screen-shot as an array (numpy array for eg) without writing to disk. The idea here is to create and then call the array once per frame in an external script ...
5
votes
0answers
78 views
+100

Copy scene node tree to other scenes

I have a Blender file wih many scenes and I want to copy the node tree of one of them to the other scenes. From Blender interface it is a very simple task, in python I have tried using bpy.ops.node....
5
votes
0answers
383 views

PyOpenGL and VBO Indexes

Long story short, I'm trying to do a modal handler that draws using OpenGL into the viewport. Immediate mode through BGL works fine, but is dog slow. I tried using VBOs through BGL but there seems to ...
5
votes
0answers
95 views

What do all of the mode enums mean?

What do all the various mode constants in blender operators documentation do? bpy.ops.object.duplicate(linked=False, mode='TRANSLATION') - Duplicate selected objects Parameters: ...
5
votes
0answers
180 views

Killing Blender processes

So I'm currently using Java's ProcessBuilder to run Blender Python scripts for rendering in the background and that's working fine. However, I would also like to abort Blender at any time, and unless ...
4
votes
0answers
24 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 ...
4
votes
0answers
30 views

Add Red Text in Tooptip?

is it possible to add a custom red text in tooltip ? here is an example:
4
votes
0answers
77 views

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 ...
4
votes
0answers
61 views

Programmatically changing UV/Image Editor Image

For a school project, i am trying to combine openCV and Blender and for this very spesific reason, i would like to use Blender's internal Image Editor to show my frames instead of cv2.imshow() ...
4
votes
0answers
64 views

What is the appropriate way to write and distribute an addon that works with both blender 2.80 and 2.79?

I have written a python addon which is compatible with both 2.79 and 2.80. When setting the "blender" key in bl_info to the appropriate version, the code works otherwise unmodified in both versions, ...
4
votes
0answers
162 views

ATOM : setup blender python environment in my IDE

Anyone using atom here for developing blender addon etc ? How can i setup the blender environment (autocomplete, lib access etc) in Atom ? Tried to googling it but can't found any help. Some tutorial ...
4
votes
0answers
378 views

Viewport widgets with draw handler

Is it possible to create viewport widgets with draw handler? I have an operator which produces simple mesh geometry, I use operator redo properties panel to edit the result as shown in animation ...
4
votes
0answers
759 views

Controll cube with arduino + mpu6050

So i have an arduino with an mpu6050 attached to it. It is currently set up to send the raw data from the imu sensor to my computer. I would like to use this data to control a cube in blender with ...
4
votes
0answers
1k views

How to convert image pixel values from 8bit to 32bit properly? - answered.. but why byte image buffer is stored with non-linear color values?

I'm testing code from this question: `` import bpy ...
4
votes
0answers
222 views

How does 'Align Active Camera to Selected' decide where to place the camera?

Thanks to this answer, I'm using bpy.ops.view3d.camera_to_view_selected() to automatically place a camera so that it frames the selected object for rendering. But ...
4
votes
0answers
182 views

Is there a low level alternative for bpy.ops.object.convert(target='CURVE')?

(Note: Somebody asked there nearly the same question as me and got a very nice answer. However, this was to convert an object to a mesh. I have exactly the same context as this person but I want to ...
4
votes
0answers
334 views

How to bring the context “back” after running read_homefile()?

When I run import bpy bpy.ops.wm.read_homefile() and then I replace the above with this (in the same text data block) ...
4
votes
0answers
2k views

Real time script execution

Trying to make a modelling tool that can update geometry in the 3D view as the user interacts with the scene. To do this the script needs to loop continuously so it can check for changes caused by the ...
4
votes
0answers
330 views

get radius of mesh primitive

I would like to ask whether there is a way of getting the radius of a sphere (mesh primitive) after it has been added. In other words, does Blender somehow distinguish between different shapes? What ...
4
votes
0answers
166 views

Disabling “use frame rate” slows logic/animation/etc?

I've recently solved an issue to remove my frame-rate cap, but it caused another issue. I have my animation tic rate at 60, my framerate at 60, and that's always been working only when I have "use ...
4
votes
0answers
141 views

Mesh Extra Objects - operator panel is empty when using api instead of gui

I am using the Add Mesh Extra Objects Add-on. If I add a regular solid via gui I can set stuff in the operator panel like source, size, vertex truncation, ... If I use ...
4
votes
0answers
523 views

How to get cycles bake progress in Python?

I can bake to textures using bpy.ops.object.bake(). But because this function waits until completion, I then use this: ...
4
votes
0answers
52 views

Find the largest piece in UV-editor in Blender 2.73

Is there any way of finding the largest UV-section in the UV-editor without manually comparing each piece next to each other? I want to select the piece that is the largest on either X, Y, or both ...
4
votes
0answers
483 views

Adding sliders from UI to pie menu

I've seen some sliders working in pie menus but the one I'm trying to add to my pie script isn't showing up. Its the 'autosmooth normals' slider from the Object Data tab, under Normals (in the ...
4
votes
0answers
156 views

Differences between the internal and blender players

I have a script that I borrowed from the companion files that came with the book, Game Development With Blender (it's a creative commons script). It looks like this: ...
4
votes
0answers
209 views

Hide filter options in UIList

I want the UIList to not show the filter options (inkl. the plus button). I've use following flag: self.use_filter_show = False The flag disables the filters ...
4
votes
0answers
123 views

How to know when object are deleted?

I use blender as a network client. I'm able to know when objects are updated (via handlers). But I would like to notify the server when a object (or mesh, animation, etc.) are removed, how can I do ...
4
votes
0answers
468 views

Blender and MBdyn

I was looking for aerodynamic simulation possibilities in blender and after some research landed to this page: http://blenderartists.org/forum/showthread.php?139557-Multibody-Dynamic-Simulation-...
4
votes
0answers
679 views

Converting an obj sequence to a .bobj fluid sim cache?

I'm wondering if there is any way to accomplish turning an obj sequence exported from realflow into a .bobj fluid cache that I could then trick blender into loading as a native fluid sim cache. So far ...
3
votes
0answers
32 views

Kd-trees .. do you really need to balance before every find()?

The API documentation on mathutils.kdtree.KDTree says: KDTree.balance must have been called before using any of the find methods. and it also says of ...
3
votes
0answers
18 views

When a Driver is being evaluated are the final positions of objects finished evaluating?

When a Driver is being evaluated are the final positions of objects finished evaluating? Does the Dependency Graph take into account references made in a Driver for a topological sort? The Blender ...
3
votes
0answers
32 views

Getting Color Values Produced by Dynamic Paint

I am having trouble with the python code to get the colors of vertices when using Dynamic Paint. If I try painting a cube using the Vertex Paint mode I can get the rgb values of the vertices using the ...
3
votes
0answers
57 views

Setting particle color with generated m x n image texture

I have a large particle system in which the particles (stars) are colored according to a generated image texture. The image texture was originally 119,617 wide and 1 px high. No matter what I did, ...
3
votes
0answers
253 views

How to use bgl?

I want to render simple lines on the 3D viewport through a modal operator but not using glBegin/End because those commands are deprecated in opengl 3.3 and will not be avaliable on 2.8 leaving me ...
3
votes
0answers
76 views

How to access Normal and Tangential force values of objects during physics simulation?

I have a couple of soft body objects that collide with each other as shown below. My goal is to get information on the Normal and Tangential forces for the selected shape. I wonder, is it possible to ...
3
votes
0answers
252 views

What is the fastest way to get pixel data out of the camera?

I'm trying to speed up a script that has to generate a black and transparent object (those are the only two RGBA colors), and use the pixel data coming from pictures of it shot from multiple angles. ...
3
votes
0answers
597 views

A working guidance for building blender as bpy python module?

There are informations on how to build a bpy python module from blender source but, it does not work (for me) using Ubuntu x64 16.04LTS. We need a working guidance !? Building it up with: https://...
3
votes
0answers
277 views

Getting the results of a rigid body simulation via Python

I'm trying to run a physics simulation with a single rigid body (cylinder) launched randomly on a flat surface. I want to know using python on which side (or edge) did the cylinder land. The ultimate ...
3
votes
0answers
231 views

Drawing mathematical functions using the Blender API - drawing a line

I want to represent the line y = 4x + 2. I suppose it has something to do with a function in python that gives pairs of values x-y and another that matches the ...
3
votes
0answers
411 views

Creating a list selector in a popup/dialog

For an import/export plugin I'd like to create a long list of objects to select from. This is fairly easy to do in a panel with a template list, but it's not quite what I want - it's too small and ...
3
votes
0answers
723 views

Calculating / Estimating the normal at any location on a face

In a recent answer I employed Object.ray_cast which returns the location and normal of a ray hitting a face. The normal is needed to calculate the rays reflection, ...
3
votes
0answers
376 views

I want to convert my Diffuse Shaders to Principled Shaders

I just barely imported a scene from an .obj file, but all 83 materials defaulted to Diffuse Shaders of various colors. To make for a faster workflow, could I use a python script of some sort to ...
3
votes
0answers
119 views

Python - Making a “character” jump to another object's x, y ordinates while facing the 'go to' objects front

I know little of code so this is a bit difficult to me. This is just the set up for a 'player' to grab a crate and pull it back and forth. I have 4 empty triggers set up so the crate can be grab from ...
3
votes
0answers
222 views

Camera pose estimation by matching edges

I've a camera at known location and rotation from where an image of a model is rendered (Top left of the figure). The camera is randomly translated and rotated to a very close unknown location and ...