Skip to main content

Questions tagged [scripting]

Questions concerning scripting in Blender using the Python programming language. Also use this tag for questions about scripting in OSL (Open Shading Language).

1,954 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
49 votes
1 answer
3k views

Custom trackpad pan/zoom/rotate behavior add-on

I'm trying to write an addon to customize the trackpad panning, zoomimg, and rotating gestures, but can't find a way to read the actual trackpad parameters for position and so on. The properties in ...
rraallvv's user avatar
  • 4,551
10 votes
1 answer
730 views

How can I get a list of currently running modal operators?

Here I found a working solution using ctypes which allows to find out if any modal operator is currently running. I am not good in C and don't understand how it works. But I'm sure someone does, so is ...
Andrey Sokolov's user avatar
9 votes
0 answers
246 views

Play/animate images, spritesheets or video files in 'template_icon_view'

I want to "play" some animation in this UI space, the template_icon_view: I can load all the images I want, for example: I know that the gif format is ...
yhoyo's user avatar
  • 2,285
8 votes
0 answers
367 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 ...
Wouter Vandenneucker's user avatar
7 votes
1 answer
271 views

How to display an image in my custom node

I have a custom node and I want it to be able to display an image. I know that the node has a parameter show_preview and if you enable it, no image appears.
user78950's user avatar
  • 169
7 votes
0 answers
639 views

Update function for NodeSocket?

How do I set a callback for socket input change (value or link change) when having a custom node? I have a socket defined like: ...
Hitokage's user avatar
  • 207
6 votes
0 answers
469 views

How do I change the width of the Adjust Last Operation panel?

I've done this simple operator taken from templates. How can I change the width of the Adjust Last Operation panel? I tried scale_x and ...
Kosmos3D's user avatar
6 votes
0 answers
1k views

Can Blender automatically reload external script files when they are changed?

I came across this question: Is it possible to run a script from an external editor without reloading the file? Which also was asked over here in a similair format: Workflow for developing add-on/...
user007's user avatar
  • 536
6 votes
0 answers
3k views

How to change animated object's origin without ruining animation?

For example: I have a character and a spoon which he is holding and moving thanks to child of constrain. My character releases the spoon a little bit above a plate. So I came up with idea to use rigid ...
Branskugel's user avatar
6 votes
1 answer
2k views

How to update compositing nodes via script?

I create some nodes in compositing via python script: ...
Korchiy's user avatar
  • 179
6 votes
0 answers
738 views

Add custom textures and vertex attributes

I'm a new user of Blender, but I have 10 years experience of 3d development (mainly C++/OpenGL, but I know Python pretty well). Now I plan to use Blender as a replacement tool for the "good old ones ...
Orel's user avatar
  • 61
6 votes
0 answers
682 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 ...
PHEDev's user avatar
  • 703
5 votes
0 answers
133 views

The documentation says frame_change_pre is NOT the ‘before the frame changes’ event. What exactly is it then?

I would have imagined that frame_change_pre is the event that happens, well, before the frame changes. Silly me! The documentation states (emphasis mine): Called ...
jwrush's user avatar
  • 792
5 votes
1 answer
228 views

Finding which addon an operator belongs to

A recent question / answer involves what looks like an overridden operator: bpy.ops.object.align() Differing from the documented default, how do we find which ...
batFINGER's user avatar
  • 84.5k
5 votes
0 answers
194 views

Object Picker Modal Operator?

I saw this question this morning and i'm also quite interested in a Picker modal operator, so I did tinker a bit and achieve a somewhat beginning of a working code but I encountered some problems ...
Fox's user avatar
  • 1,932
5 votes
1 answer
113 views

How to check if the collection is selected in outliner?

How to check if a collection is selected or not in the outliner using Python? Here I've selected the following collections: "scene 1", "scene 2" and "scene 3".
Korchiy's user avatar
  • 179
5 votes
0 answers
536 views

Removing space draw callbacks after losing the handle?

A small edit of test code from GPU Shader Module (gpu) "Mesh with Random Vertex Colors" to save the handle to the driver namespace ... ...
batFINGER's user avatar
  • 84.5k
5 votes
0 answers
511 views

Can I measure the UI font size with Python in order split text into multiple lines?

Is there any way to get the size of UI text, such as when using layout.label(text="message")? I'm trying to create a simple message box popup that displays ...
Robert's user avatar
  • 1,315
5 votes
0 answers
150 views

is there any way to get to velocity of a fluid and use it in the cycle material editor

I'm trying to use flip fluids to make lava is there any way to use the motion blur vectors, or get the velocity to mix a material. or in the script editor is there anyway to drive that.
stair case to heaven's user avatar
5 votes
0 answers
407 views

Rendering to Viewer Node in headless mode

I'm running Blender 2.79: /path/to/blender -b empty.blend -P script.py With script.py: ...
ebsddd's user avatar
  • 151
5 votes
0 answers
1k views

How to triangulate a polygon using Python?

I often meet the following problem: mapping a point on the surface of a polygon in 3D coordinates to the corresponding polygon in a UV map. To do that, the only way I've found is to: Triangulate the ...
lemon's user avatar
  • 60.4k
5 votes
0 answers
246 views

How can I derive from an existing Operator in Python?

When creating a new Blender Operator, you'll derive the class from bpy.types.Operator, like this: ...
aliasguru's user avatar
  • 11.2k
5 votes
1 answer
618 views

Is possible to generate a preview material from python?

I would like to generate the preview of a list of materials. I could create a sphere and apply the material, render and save it in a loop, but what I would like is to use the internal functionality of ...
Antonioya's user avatar
  • 492
5 votes
0 answers
709 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 ...
fjg3d's user avatar
  • 113
4 votes
0 answers
56 views

Python access Bevel Custom Profile handles

We can access the profile points via obj.modifiers["Bevel"].custom_profile.points[1].location But how to get the handles location at that point?
X Y's user avatar
  • 5,883
4 votes
0 answers
425 views

How to detect if Blender is currently rendering

I would like to hide certain parts of the UI automatically as soon as the user hits the Render Animation button. I'm looking for something similar to ...
zeffii's user avatar
  • 39.7k
4 votes
0 answers
125 views

Is there a way to make an object not-deleteable?

I'd like to have an object that has some sort of special property so that it can't be deleted by accident. for example: if I press X, it will not delete this object but will instead deselect it or ...
Zophiekat's user avatar
  • 769
4 votes
0 answers
231 views

Enable show keyboard-shortcuts in Toolbar?

Is there a way to preview the keyboard shortcuts of a common command in the standard toolbar much like this? I've been told I should use the F3/spacebar search options but retrieval adds time to ...
Osaka's user avatar
  • 41
4 votes
0 answers
2k views

How to create a new node type to be used in shader editor?

I am trying to create a new node type (NOT a node group). For example a node that takes two floats as inputs and returns another float as output, and I can do whatever with python in between. I saw &...
previous_developer's user avatar
4 votes
0 answers
334 views

How to split unconnected splines into separate Curve Objects without bpy.ops?

The following code separates unconnected splines into individual curve objects just fine (as far as I can tell). ...
Armored Wolf's user avatar
4 votes
0 answers
257 views

context is incorrect error in async method probleme

hey guys i'm trying to use some blender commandes inside a async methodes, but it seemes like blender commands don't work insisde async methodes, i will apreciate any help: ...
Ramzi Boufaa's user avatar
4 votes
0 answers
433 views

Recover python script after blender crash

When writing a script and Blender crashes I lose the changes in my script? If blender crashes, I can only get the scripts I've saved manually saved (via Alt+S or Edit > Save). Often I will do Run ...
remi's user avatar
  • 141
4 votes
0 answers
2k views

Custom Renderer as an Add-on

I have been writing a custom raytracing renderer in C++ and I would like to natively integrate it with Blender 2.8 as a custom renderer. I know that this is possible, as I have seen many projects (for ...
eclmist's user avatar
  • 141
4 votes
0 answers
220 views

sending Data or Values to linked Objects in Blender 2.80 / 2.81

I work a lot with linked data and library objects or linked collections. Is it possible to send values or variables between the different hierachical structures ? So for example: SCENEFILE (var = ...
Master Heavy's user avatar
4 votes
0 answers
433 views

How to check if mouse is in View3D Window from modal operator (2.80)

In the context of a modal operator, I would like to perform an operation when the left mouse button is clicked in the VIEW_3D area, ...
Christopher Gearhart's user avatar
4 votes
0 answers
409 views

Is there a way to get a node's dimensions without displaying it in the Node Editor?

The aim of the question is to calculate a node tree layout for a generated node tree. Nodes have height, width and ...
lemon's user avatar
  • 60.4k
4 votes
0 answers
128 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() ...
Baycosinus's user avatar
4 votes
0 answers
544 views

Garbage collection in Blender leaks memory

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 ...
Mahmoud S. M. Shaqfa's user avatar
4 votes
0 answers
207 views

Detecting mesh overlaps of objects inside another object

How can we detect the overlap between two objects one has been placed inside the other? I'm writing a placement algorithm and it seems regular BVH mesh overlap doesn't work for this case. Is there a ...
Mahmoud S. M. Shaqfa's user avatar
4 votes
0 answers
468 views

Any ideas for "slow parent" alternative in new depsgraph?

Alright, so I noticed that slow parenting doesn't work in new depsgraph And I really need something like slow parenting to create a trailing/delay kind of motion for a bendy bone Do you guys know ...
Alumx's user avatar
  • 419
4 votes
0 answers
607 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 ...
StackOverflowToxicityVictim's user avatar
4 votes
0 answers
424 views

Is it possible to define the width of a dialog popup?

I am currently working on some Blender python exercises to expand my knowledge, my first project is to get a dialog popup to apply modifiers to specific object groups to speed up my workflow. ...
J Sargent's user avatar
  • 19.3k
4 votes
1 answer
290 views

What does the use_local_location mean for bones

To test this, I run a test to show the difference of use local location or not. C.object.data.bones['upperArm.R'].use_local_location = False C.object.data.bones['upperArm.R']....
Sergius Liu's user avatar
4 votes
0 answers
2k 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 ...
Bjarke's user avatar
  • 41
4 votes
0 answers
88 views

how to retrieve movie clip details with a script?

I primarily use blender as a video sequence editor for existing movie clips. Generally I want to remove a few frames and then render the movie with the same output format as the movie clip that I am ...
Chris Snow's user avatar
4 votes
0 answers
4k views

What is a missing dna block error?

I have recently run into some trouble with my project files. What happened is that the sd card I had them on got corrupt somehow (my computer did not crash and it stayed plugged into my desktop). When ...
Cornelius Jordan's user avatar
4 votes
0 answers
272 views

Blender bone.matrix API changes from v249 to v277

I've been using an old script for a long time to import a custom format which contains a 4x4 matrix for the bone transform (inverted) and 4x3 for the bone animation (3x3 rotation matrix + 1 location ...
majidarif's user avatar
4 votes
0 answers
307 views

How to define own snapping points?

can someone tell me if its possible to define own "snapping points"? I know the poissibility to snap to Volume, Face, Edge, Vertex and Increment - but what i need is the following: I made a small ...
Jafix's user avatar
  • 43
4 votes
0 answers
1k views

Undo in script does not work?

I am trying to undo an operation in a script but the bpy.ops.ed.undo() does not work. The exactly same sequence of statements run in Python Console works as ...
spacer's user avatar
  • 901
4 votes
0 answers
1k 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 ...
Kirjain's user avatar
  • 177

1
2 3 4 5
40