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
0answers
5 views

Where to store reference to a class in add-on

I want to have socket server in my add-on so I can control Blender from other software. I am able to get the server set up in the register-function but the issue now is that where to store the ...
0
votes
0answers
5 views

What sculpting shortcuts should I use for sculpting?

I am a blender beginner, I have some basic experience with blender and I want to sculpt. I bought a graphics tablet and it has 12 shortcut key. I was wondering what it would be best to program them to....
2
votes
0answers
13 views

How to get one UIList to control the contents of another UIList?

I have two dynamic lists. One is for strings and another one for objects. When the string changes I need the other list to show the objects assigned to the string in the first list. So I would need ...
0
votes
0answers
8 views

Can't Import an Addon that I wrote

Let me just get straight to the point! I use visual studio code to write my addon. If I open it through visual studio code, it works fine, but when I try to import it into Blender by loading the init....
0
votes
1answer
23 views

Driver scripted expression problem

Hello fellow blenderers. In my recent work I try to create procedural football stadium using array modifiers. For that to work fluently I need to set up drivers and this is the point where problems ...
1
vote
0answers
8 views

Buttons on a custom properties dialog

I made a simply addon for myself that shows a property editor dialog. I wonder if it's possible to add several buttons on it that'd change value for Index property? ...
1
vote
0answers
11 views

Question Related to Python and Camera View

I've recently been developing a rig that uses Python for UI buttons, etc. I was wondering how to make a button that would put me into a face rig camera. (something that would only be used for ...
0
votes
1answer
53 views

How can I create an advanced addon with a GUI and multiple settings for Blender 2.8x? [duplicate]

How can I create an advanced addon for Blender 2.8x that is displayed in the n menu (right panel of the viewport) with multiple settings. What are the most important GUI scripts, how to add settings, ...
0
votes
0answers
21 views

Where should I start in programming for Blender? [on hold]

I have quite some time since I discovered Blender but I just used it for modeling and rendering and I wish to start learning about about this software in a deeper layer. I saw Linear Algebra at ...
1
vote
0answers
30 views

How can I make a 3D model out of a set of vertices, UVs and faces using a script?

I have 1 UV .png, and 3 numpy arrays that I will describe below: Vertices: An array that has many triplet float values eg. [1.1, 2.1, 3.1] Faces: An array that has many sextuplet integer values. eg. [...
0
votes
0answers
13 views

Proportional Keyframe editing

Hey guys I've been trying to get a script going for Proportional moving of keyframes to set values on a given frame (to help correct captured data). I've got an action in my scene I've started poking ...
1
vote
0answers
12 views

Scrollable interface?

is it possible to create a scrollable interface in blender UI ? let say in this code below ...
0
votes
0answers
32 views

Create a simple UI list procedurally?

i'm trying to implement an UI list feature in my addon, so let's take the case of creating a UI list of all 'DISPLACE' modifier, for testing purpose let's try to ...
0
votes
1answer
26 views

Blender Rotation [duplicate]

I have an object in blender that I am trying to rotate by importing values from a csv file. The values are in rows 4-6 of the csv file and they are in degrees so I want to use euler rotation. However, ...
0
votes
1answer
18 views

How should I update a script to 2.8 that uses the removed 'scene_update_pre' handler?

so I'm having trouble with this script: ...
2
votes
1answer
39 views

Why this script doesn't run as expected?

I want to have a function which deselects currently selected objects, selects a passed object, runs a callback function and then restores the selection. For example in my scene I have two objects Red ...
-1
votes
0answers
16 views

Create an UI list with possibility of selecting multiples items?

hello, it it possible to create an ui list where we can have multiple item in the selection ? so in short is it possible to override it's behavior ? maybe the code of this UI list is written in ...
1
vote
0answers
18 views

Make object follow path and collide with other object

My goal is to create a two objects collision while the moving object(1) won't move in a straight line before it hits object 2. In order to make a realistic collision turning off animation's property ...
0
votes
1answer
16 views

About the version of blender written in bl_info

When developing an add-on, I write bl_info as follows. ...
0
votes
0answers
18 views

I need to play all my actions

my problem is the following: I have 3500+ actions in one blend file. I want to play it all to render without going to the NLA and handling manually 3947 actions in sequence. There's a way that I can ...
1
vote
1answer
41 views

Rotate object's mesh so it matches another object's rotation

Suppose we have two cube objects: Obj1 and Obj2. Let's say Obj1's Euler rotation is Vector((0,0,0)) and Obj2's rotation is ...
0
votes
1answer
39 views

How do I attach a few cubes via script. Blender 2.79. Pic =>

How to attach a lot of cubes to the nearest vertices of a certain object using a script? I want to attach red cubes to the nearest vertices of yellow objects using a script. Suppose red cubes belong ...
0
votes
0answers
11 views

Installing custom Pie Menu, Restricted Context Error

I am having issues creating a custom "Add Mesh" pie menu, Ive made a script, sampling from a number of different sources of code, that functions well enough from the text editor, However when i try to ...
-1
votes
0answers
35 views

Make object follow path after animation turned off [duplicate]

I'm trying to make an object follow a path which is quite a simple task but the problem is that in some point during the animation I want to turn the animation off to achieve physical collision. ...
0
votes
0answers
17 views

Clamp object to curve path

I'm trying to make two objects collision with complex movement. The movement curve was created and what was left is just to animate the moving object (cube). This is the scene's setup: plane --> ...
0
votes
1answer
23 views

Creating path curve using python script

I'm using the following script to create path curve: ...
0
votes
0answers
14 views

Select all vertices at a defined distance

I want to select all vertices at a defined distance from the border of an object. It's easier to explain with an image: For example, I would like to select all vertices at 10mm distance from the ...
0
votes
0answers
11 views

How to delete the half of uv sphere in edit mode using python

I wan't to delete the half of uv sphere and keep it half how to do that using python ...
-2
votes
0answers
16 views

How can I create this type of UI panel using python [duplicate]

How to create this type of panel (in blender 2.8) which blenderguru has created in pro lightning skies add-on In Place of the sky hdr i have some images and for every image i wan't that the ...
0
votes
0answers
12 views

Create complex object movements

Let's say I have two objects and I want object one to collide object two but instead of moving in a straight line object one will move on curvy course (like sin/cos wave). How can I do it using ...
0
votes
1answer
25 views

How do I make a script for adding modifiers?

I have made a script for adding VertexWeightMix modifers to a selected mesh. However, when I run the script, it adds tons of modifers, but only changes the first one it adds. How can I fix this? I don'...
0
votes
0answers
8 views

adding texture to a material node in luxcore blender 2.8 using python script

I found this code for creating a new material and assigning a texture image. But I quite do not understand how to apply it for another material type like "matte". ...
1
vote
0answers
14 views

Sorting Collections Aphabetically in the Outliner

I have numerous objects categories that I used to organize in Groups through a script in Blender 2.79. I'm now trying to switch to blender 2.8 and use collections, but in the outlier the only ...
0
votes
0answers
18 views

Specifying modifier valus

This might be a weird question but is there any way to specify a range of values in the modifiers tab specifically the edge split modifier it has a value in degrees which specifies the types of edges ...
0
votes
0answers
17 views

Blender 2.8 UI layout hide rows

I can't figure out how to achive something like this in my custom blender panel. I mean a group of properties that can be hidden.
1
vote
1answer
22 views

Transform matrix on a scaled object

I have to create boxes, cylinders and spheres, to scale them and to rototranslate them in space by using a matrix transform. This is the code for a box: ...
2
votes
0answers
20 views

Create object speed vector blender 2.8

Trying to create a speed vector of moving objects in the scene using python script. I'm aware of the possibility to create a delta location vector but is this the only way? I thought there will be a ...
0
votes
1answer
23 views

Shader script nodes have no parameters

I am trying to do my first OSL shader script. No matter what I do, even when using all the examples, when I add a node for my shader none of the parameters show up as node inputs/outputs as I have ...
0
votes
0answers
15 views

how can I import fbx and apply shader to each node

I plan to use Blender to render CAD project, so I have the .fbx file exported from CAD, how can I do the following by a script? Import the .fbx file into Blender 2.8 scene, and position it. Apply ...
0
votes
1answer
11 views

Single key input property in UI Panel

How to capture a single key user input in the UI panel of the add-on? The UILayout documentation mentions an event parameter in the ...
0
votes
0answers
16 views

Pack images when saving the blend file

I'm trying to create a script to pack and save all images when saving the blend file. This is what I have right now: ...
4
votes
0answers
30 views

How to redraw status bar in Blender 2.80

I've added my own progress bar to the Blender 2.80 status bar (the footer of Blender) with the following abstracted code: ...
1
vote
0answers
23 views

How to set the Euler angles(XYZ) of an arrow, from its components? [duplicate]

Given a vector(an arrow object) say $\vec A\,= \,P \hat{i} + Q \hat{j} + R \hat{k}$ , how to determine the corresponding Euler angles (XYZ) to be assigned to the vector so that it points in that ...
0
votes
1answer
29 views

UV mapping texture get sliced? in some area

I have a flat face (created by bisect fill) that I have to unwrap for using with image that must be pixel perfect(no compress or shear). What I have done are: Select bisect filled face UV>Unwrap it ...
0
votes
1answer
20 views

Splitting an addon in modules vs having everything in one file?

Im wondering the pros vs cons of having an blender addon in a large python script (let say 7 thousands lines) vs splitting everything in different thematic modules ? I think that In the end having ...
0
votes
2answers
55 views

Set background color without effecting scene colors

When changing the background from it's default value to gray (0.5,0.5,0.5) I saw that the other object colors were effected (been brighter). I must say that I didn't use nodes to change the background ...
3
votes
0answers
42 views

What's the algorithm used in 'tris to quads' (Alt+J)?

Does anyone know the algorithm used in 'tris to quads' function in Blender or the script containing this function? Thanks!
1
vote
1answer
23 views

Importing LEGO scenes add-on error

I am following this tutorial to create my custom LEGO scenes & characters and render them out in blender but I am getting some errors. Basically, I have downloaded this software (Studio by ...
1
vote
0answers
23 views

How to make custom list panel like “Vertex Groups” list

Does anybody know how to create panel like this? (I am new to programming.) Items of this list should have several data points ["name", value1, value2, ...] "+" ...
0
votes
0answers
20 views

Addon for animation library pose

Blender 2.79 can do a lot. But not all. I need help with the poses library. I am trying to find a way to make the value of position which is can be animated and can work with drivers. I tried to do ...