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).

Filter by
Sorted by
Tagged with
1
vote
2answers
583 views

How can I make a dropdown box of materials and run code when one is selected?

How would I go about making a property box that contained all the materials in a scene (in a Toolshelf (T) panel for example) and is able to pass the material in the list to another operator that ...
3
votes
1answer
115 views

Can I animate something with the Transform Panel, without keyframes?

I’m animating a watch. And I would like to make the arm for seconds jump 6 degres every second/30 frames (in 30fps). I could animate it for a minute in the timeline and add a cycles modifier. But I ...
1
vote
0answers
8 views

How to load custom icon into 2d gizmo in Blender?

I would like to load custom icon for a button displayed on 3d View (GIZMO_GT_button_2d) in my add-on. Looks like "icon_value" way does't work here - it works only in panels. Is there any ...
1
vote
1answer
23 views

Is there a way to pull data from bpy.ops without putting the model into Edit Mode

I want to pull data from a bpy.ops command, something like ...
1
vote
1answer
25 views

How do I define a command for each of the options?

I created a dropdown using dynamic property. How can I set it so that, for example, I can apply that modifier to the name of one of the modifiers selected in the list, but unfortunately I can not get ...
0
votes
1answer
476 views

Is there any way to make multiple objects convex hulls?

Is there a way to make multiple objects become convex hulls using python and applying the operator to all selected objects?
6
votes
1answer
370 views

Not able to add node sockets to an existing node using python scripting

I am trying to add a new input NodeSocket to an existing node using the below code: ...
0
votes
0answers
21 views

Script to regex match pattern from text file

So I'm trying to create a script to create a panel in the UI. In this panel there should be a user input box for the user to select a file. Both of these functions work. From there the user should be ...
-1
votes
0answers
30 views

Enum for image in UI panel script not working

I am making a Enum for displaying image in UI panel for my add-on. Here is my script ...
0
votes
2answers
559 views

How can I have Screencast display keys pressed during transform operations?

I'd like for the Screencast to display keys that are pressed after a transformation is begun. For example, after I select this cube and press S to scale, I then press Z 3, but neither the Z nor the 3 ...
2
votes
0answers
65 views

Is there a way to render depth buffer into a texture with GPU/bgl python modules?

I need to render depth buffer of Blender's scene into a texture to further use it my shaders. I tried using the common OpenGL recipes for doing that, but none of them worked as it seems there is ...
0
votes
1answer
16 views

How to include files like images and others to be installed with an addon in its folder?

I already know how to load an icon for an addon operator. I know that I can manually put that icon in the addon location so it loads. But how to package images and other files that will be used by the ...
0
votes
1answer
65 views

Change status in status bar

I want to use bpy.context.workspace.status_text_set(text="HelloWorld") The problem is it is working just in draw, modal, execute methods of my operators, ...
1
vote
1answer
451 views

Animate Text bpy.ops.transform.translate

I am trying to find the right code to animate text that follows a bezier curve in python blender api. I can add the keyframes, and they appear to be working when I drag through the timeline, but when ...
6
votes
4answers
563 views

Automatically generate 100 animations, each with a different texture input (BLENDER)

Problem to solve: Automatically generating 100 animations using the same animation base, just using a different texture every "pass" I come from the Adobe world, where things like Automate -&...
2
votes
1answer
30 views

How to calculate what percentage of the area of an object appears in the render view?

Take the pictures below as an example, I want to calculate how much of the jersey number on the tshirt of the human model is visible on the render view. In the first case the jersey number is totally ...
0
votes
0answers
20 views

Automate an animation of a moving person from 3D locations

Is it possible to write a python script that uses 3D positions of body landmarks and connects respective points to animate a human frame moving? I have the points although I don't have experience in ...
0
votes
0answers
14 views

Instantiating object of a certain type [duplicate]

Complete beginner to Blender here so here goes an amateur question. I am a bit confused by the syntax of Blender and why you can't just create an instance of a mesh class and assign it a name. Anyway, ...
0
votes
0answers
15 views

Is it possible, to assign the execution of a script to an hotkey? [closed]

Is it possible to let a script been executed, when pressing an hotkey? For example a script which I want to use frequently: It should be executed each time I press "F6". (I‘m new to Blender ...
0
votes
0answers
22 views

How to previews blender scripts [closed]

How to previews more than one blender scripts simultaneously into blender? I was want to give my scripts but haven't my laptop near. The script Can be animations files or physics files. Somebody Can ...
0
votes
1answer
38 views

How to change the texture of an object after a few frames?

So my question is that I want to change the texture of the object after a few frames. For example, after every 100 frames, the texture changes to the next texture. I have this little bit of code, so ...
2
votes
1answer
22 views

Curve from selected vertices/edges using low level api

I want to convert selected vertices/edges into curves. I can convert them using bpy.ops functions. But is there any alternative using lower level api preferable using bmesh. I can get all spline ...
0
votes
1answer
15 views

How do I make a bone active using Python?

How to make a selected bone active in POSE or EDIT mode? Thanks!
0
votes
0answers
18 views

Clarifying UIList - Using parameters in list_template() and draw_item()?

I may have gotten some misinformation or have crossed wires from reading a number of different demos on UIList. I'm trying to clarify what I don't understand. To place a UIList in a panel, according ...
0
votes
1answer
35 views

Input script of Mix Shader node for create link? [duplicate]

I am scripting an add-on and I need to create link between Glossy BSDF node and Mix shader node's "shader" ...
0
votes
2answers
31 views

Can you access the distance values from the numeric input?

in my Blender 2.92 scene file, you can find the numeric input in the top left corner of the viewport (important, the numeric input only shows when transforming an object). what i'm inquiring about, is ...
0
votes
0answers
21 views

Can I use a UIList class twice on one panel?

I know a UIList class is not a big deal to write, but for multiple reasons, I'd like to write one class and use it for handling two PropertyCollection lists. So if I have a class for a UIList like ...
0
votes
1answer
15 views

Timeline Area Type

Does anyone know why TIMELINE doesn't show up in Area Type? bpy.context.screen.areas[0].type = 'TIMELINE' throws a TypeError. It is however available in the Editor ...
0
votes
0answers
8 views

Add a background image and save it using Python scripting

I have a cube and I want to add it on top of a background image using Python scripting ...
0
votes
0answers
12 views

Separating each object into a blend file

I got a kitbash recently, But the kitbash has a problem, all the models in the kitbash are saved in a single .blend file. Is there a script I can use to separate all the objects in the .blend file ...
19
votes
4answers
33k views

How to get Python multiprocessing module working on windows?

I am trying to run a script within Blender that utilizes multiprocessing module. According to documentation it is possible to use it ( see note at the end of "...
0
votes
0answers
6 views

bpy add object in game

is it possible to add an object inside the game engine with upbge 3.X.X while having game physics work properly ? What I'm doing is: ...
0
votes
1answer
76 views

Pie Menu simple script condition

I've been using Pie Menu Editor and I'd like to create one that activates only in object mode when nothing is selected. I did a lot of research but since I have no background in coding it makes it ...
1
vote
1answer
133 views

Do plugins/APIs exist to edit blender-python-scripts in Intellij IDEA?

I find the code editing environment on blender pretty stiff and it makes my development slower because I have to type every piece of code letter by letter so to say. I was just wondering if it were ...
0
votes
1answer
34 views

What is the script of Glossy BSDF roughness value?

This is the script I am working on ...
0
votes
1answer
62 views

How to Join All the Trees Together?

My object consist of many trees. So if I "bake" any of the tree at the end I have many pieces and I have to use Ctrl+J to join them. Is there a way to join all the trees together into one ...
1
vote
0answers
28 views

Installing pythonnet in Blender

I tried to install pythonnet in Blender (v2.83) using Windows Power Shell: ...
1
vote
0answers
16 views

enum property drop down with labled columns

Examples in the UI are the Math shader nodes Operator drop down (Also similar, but not an enum is the Add Modifier drop down). They have columns with headings and the items grouped under them. How is ...
0
votes
0answers
43 views

Error on displaying an image in UI script

I want to make an image display in UI panel so I find this how to display an image in blender UI with python? but when I run script of this which provided in how to display an image in blender UI with ...
-2
votes
1answer
60 views

How can I know scripts of what I am editing on mesh? [duplicate]

I do some edit on a mesh, but I want to know the script of what I am editing on the mesh for scripting an operator.
1
vote
1answer
26 views

problem during script execution

hi I wrote a simple script to take screenshots, but the frames are not updating in the screenshots i.e all screenshots are the same image (a single frame). I introduced a time delay in case blender ...
0
votes
0answers
13 views

Script to import .obj and export decimated .glb

I'm trying to create a script to individually import several files as .obj, decimate them and then export each one in a separate .glb file. Here is what i managed to put toghether till now using code ...
-1
votes
1answer
40 views

How to make a button to add mesh that has been edited? [closed]

I want to make a button in my panel to add mesh that has been edited. I have edited the mesh with modifiers and some others things. When I press that button, it would like to add a mesh that I have ...
0
votes
0answers
34 views

Is it possible to add a dialog box which can change or open font for text?

I want to make a text button in my add-on panel. When I press on it, it needs to show a dialog box which I can change or open font in computer Not only changing extrude, scale of text, like an example ...
1
vote
1answer
42 views

Scipy Function as Node (sverchok addon)

I am trying to use the scipy.interpolate.interpn function within blender. I assumed the only way to do this is to utilize the sverchok addon, so my first attempt at using this function is with the ...
0
votes
0answers
12 views

How would you keep a cached nested dictionary to use in an operator? [duplicate]

I'm wonder if it is possible to have saved globally accessible dictionary variable without creating a property.
3
votes
1answer
135 views

python - How to color accurately convert from rgb 0-255 format to values in 0.0f-1.0f

The color accuracy is completely wrong when you convert from byte rgb to float. 13/255.0, 105/255.0, 171/255.0 = R: 0.050980, G: 0.411764, B: 0.67058 While if you ...
4
votes
1answer
349 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 ...
0
votes
1answer
45 views

How to let people see message in add-on preference?

I want to type some message for people to see when they just installed the add-on. I need a message to them in add-on preferences. How can I do it?
1
vote
0answers
9 views

Duplicated vertices created by bmesh.ops.bisect_plane

I want to get a mesh's bisected surface's vertices and edges. I tried to bisect a sphere using bmesh.ops.bisect_plane. ...

1
2 3 4 5
97