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.

13
votes
0answers
502 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
310 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
200 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 ...
7
votes
0answers
99 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
208 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 ...
5
votes
0answers
336 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
345 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 ...
5
votes
0answers
167 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 ...
5
votes
0answers
386 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 ...
4
votes
0answers
43 views
+50

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
44 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
144 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
422 views

PythonScript to load data as colored point-cloud

Background I want to render 3D points with color information for scientific visualization. I have several hundred thousands of points up to 2 million. For each point I have [xyz] coordinates and two ...
4
votes
0answers
707 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
4
votes
0answers
90 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: ...
4
votes
0answers
169 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
274 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
1k 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
277 views

How to update image preview(icon)?

I have a UIList with a property that uses the preview icon of an image as its icon. It works, but it doesn't update, unless the icon is updated somewhere else first, i.e. in the texture paint slots or ...
4
votes
0answers
317 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
159 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
138 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
494 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
51 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
471 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
153 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
198 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
121 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
462 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
672 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
17 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
26 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
63 views

How to set the path for userpref.blend file?

After compiling Blender as a Python module I realized that userpref.blend does not exist in ~/.config/blender/2.79/config. I ...
3
votes
0answers
52 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
66 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
227 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
548 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
230 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
59 views

How can I access the values set via normals_split_custom_set()?

I use a variety, of, methods to set the loop normals but want to read them to do some raycasting. I thought I had to call calc_normals_split() then match up ...
3
votes
0answers
202 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
374 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
660 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
337 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
108 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
203 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 ...
3
votes
0answers
77 views

Help with understanding the addon enable process in blender

I’m trying to make our add-on work when its enabled from blender starting up (safe as enabled in user prefs). But for some reason this doesn’t work. It works fine when enabled after blender has ...
3
votes
0answers
155 views

Update viewport after toggle of cycles shadows for all objects

I wrote this little script to toggle the visibility of the shadows of all objects. It works quite well, but at the end of the script, I'd like to update the viewport. I tried the "hack" with the ...
3
votes
0answers
97 views

Is there a good way to visualize progress for the end user?

I'm currently working on an addon that renders animations at many different angles. Think isometric sprites. Currently Blender just hangs while it's doing its work. Is there a loading bar, or some ...