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).
6,454
questions
2
votes
0
answers
18
views
How to get object evaluation time?
I want to get the time in milliseconds spent evaluating a particular object. I wrote the basic code, but it seems to me that it does not work correctly. I have code that measures the execution time of ...
1
vote
0
answers
18
views
Making a basic n panel template with working properties [duplicate]
I'm trying to display some different property types on a n-panel. I would like to level up from using operator buttons, but I'm having trouble figuring out how to make a panel with some properties.
<...
0
votes
0
answers
14
views
How can I run code whenever any object is added? [duplicate]
When I add an object, I want to run some initialisation code on it first.
How can I do that?
-1
votes
0
answers
18
views
How to access data (point_data, cell_data) written by meshio in Blender shader editor? [closed]
Conext:
I have a mesh (N points, M cells) in my Python script (outside Blender).
I associate to each point and to each cell a ...
2
votes
1
answer
31
views
How can I add a library override to a non-API custom property from a linked file with Python?
The question regards setting custom properties of a linked file via Python.
Because when setting the property like
...
1
vote
0
answers
36
views
Is there a way to restart a modified addon without restarting blender? [closed]
This was answered 10 Years ago. Unfortunately, it doesnt work anymore.
It should be a simple console command:
bpy.ops.script.reload()
However, it only reloads the <...
3
votes
1
answer
54
views
How can I instantiate a Simulation Zone input / output node's socket via python?
I couldn't find an interface like the node tree interface where I can add sockets using interface.new_socket(). In the documentation, the only method I found for ...
2
votes
1
answer
28
views
direction perpendicular to screen
I want to create a script that squeezes a curve along the vertical direction of the screen. Currently, I am using
`def get_view_direction():
...
1
vote
0
answers
38
views
Memory management batch file script not working
using the information from this exchange(When Blender crashes during rendering), I made a script that for some reason doesn't work. The script I made is just like the one in the example except for the ...
4
votes
1
answer
113
views
Scripting: Separate by loose parts and get created objects
I am looking for a scripting/code/api way to do a separate by loose parts and get a list of the resulting separated objects. There doesn't seem like there is a direct way to do this?
You can do ...
2
votes
1
answer
36
views
KeyError: 'bpy_prop_collection[key]: key "View Layer" not found' when launching blender with external script
When I execute the following code within Blender, it works well regardless of whether it's version 3.x or 4.x. However, if I try to use it by launching Blender with a specific argument to open a ...
0
votes
0
answers
13
views
is it correct to set the camera intrinsics in this way?
I have a 3x3 matrix inside a calibration file that has the intrinsics of my real room inside it. We will call them fx fy cx cy. I would like to know if the code I have written is correct, as I am not ...
2
votes
0
answers
25
views
Operator called by another operator does not trigger Adjust Last Operation panel
I have an Operator defined as ImportImageOperator which calls another operator ...
-1
votes
0
answers
23
views
Script for importing an OBJ file as Shape key for blender 4.1
I have blender version 4.1
I’m trying to adapt the script for my version
...
0
votes
1
answer
18
views
How to display images in Blender on a panel
I would like to know the script to display the image data in Blender on the panel. The only way I can think of at the moment is to convert the image once into an icon.
At first I tried to register the ...