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
0
votes
0answers
12 views

When using layout.prop, is there a way to limit which elements of the property get displayed in the interface?

I'm making a small, custom popup menu that'll have all my commonly used brush options. Here's how it looks: The important bit is the list of curves at the bottom. The code for that is: ...
0
votes
0answers
14 views

Find out rotation values for rest pose of armature

I'm trying to write some python code to read the rotations of an armature imported via a bvh file. Thought I had it sorted with this, but as it turns out it still reads the pose in the animation track ...
0
votes
0answers
13 views

Bend mesh along a path/series of points with custom Python transform code?

While I have some basic knowledge regarding Matrix Transformations and have a lot of experience in Blender Addons, i've been unable to find much information or guidance either in Blender or on the ...
-1
votes
0answers
9 views

Scripts Failing to Run But Not Outputting Error Message

I'm trying to make every object in a collection move to a random Z location using a script but I am receiving a message that says that the program failed, yet I am not receiving the specific error. ...
0
votes
0answers
6 views

How to specify a scripts directory using Python or Environment Variable for all users?

At our studio the art team is using Blender and I am trying to figure out a way to specify a shared folder as a source for scripts/addons so that everyone has access to the same tools. I was able to ...
0
votes
0answers
12 views

Script for loading an OpenEXR MultiLayer image from disk

I am using Blender 2.83 and I have an OpenEXR MultiLayer image, image.exr, generated using Blender. This image contains 3 ...
1
vote
0answers
14 views

Change variables in drivers with a Python script?

I have a group of 108 light objects with emission channels. (Because this is Eevee they aren't actual light sources but just pretty props.) I want to be able to control both the brightness and color ...
0
votes
0answers
12 views

Python: select a object by mouse position

Goal: Input a mouse position(x, y), select the object that visible in 3D viewport. It has a teplate can do that in blender: Templates > Python > Operator Modal View3D Raycast But it doesn't work ...
1
vote
0answers
15 views

How to search through multiple Blender files and filter objects by collection?

This is similar to this question except I need to also filter my objects by collection. I have a large group of Blend files. I need to go through each one and check if all the objects (and their ...
0
votes
1answer
16 views

How do I set the step and soft limits of a Float input shader node socket?

I want to recreate a custom group nodes, which has this specular input (float), via script. I know that the bl_rna shows the soft_max/min and also the hard_max/min values, but bl_rna is a read-only ...
0
votes
1answer
28 views

B2.9+ Offsetting local rotation of object

I've been running through the forums and documentation, and would appreciate any help! I want to offset the rotation of an object by [Vector3(X, Y, Z)] I need to add or subtract the "radians"...
0
votes
0answers
13 views

Set scene/file as dirty through python

I have a simple addon that alow me to precisely tilt points of a curve through properties. However using them won't mark the scene as dirty and the user won't be prompted with the "save before ...
0
votes
0answers
33 views

Automatically detouring rendered items?

First of all, I hope this is the right place to post the question I'm about to ask. A little background about my problem : I am a data scientist / machine learning engineer / you name it (phd in ...
0
votes
0answers
26 views

How to select and automatically assign a material item of a custom UIlist?

I'm really struggling finding info or anything about this. I've made a an UI list with an imported list of material and displayed on the 3d view ui panel. So far a button 'set material' is changing ...
2
votes
1answer
37 views

Get Point Coordinates generated with Geometry Nodes?

Say you generate some random points using Geometry Nodes, how can you get all those point coordinates using the python api? The only hint I have is that the point coords are located under Point Cloud ...
2
votes
1answer
19 views

Are `.link_edges` and `.link_faces` guaranteed to be in counterclockwise order?

BMVert().link_edges and BMVert().link_faces seem to always be in counterclockwise order. For example, take this cube: ...
1
vote
0answers
11 views

StringProperty Operator embedded in panel for responsive textfield

I am stuck with a simple problem, which it does not seem to have a simple solution. All I want is to make a check for duplicate items by its name after entering a string in my UI. This was previously ...
0
votes
0answers
18 views

Can anyone convert this C4D script into Blender? [closed]

Basically I'm looking for a way to export my assets with the mapping data applied to it. And so far whenever I export an asset it deletes and ignores the mapping nodes from the original project. I ...
0
votes
1answer
25 views

Boolean Intersect Modifier doesn't work with triangular planes

I'm using Blender 2.82 and I'm trying to take body measurements from a 3d mesh of a human body. Right now I'm concentrating on measuring the perimeter of a certain body part, like waist, bust, hips, ...
0
votes
0answers
19 views

Make a popup dialog based on a conditional statement

I am writing a script to merge two scenes together based on the prefixes of their collections. I want the user to define the prefixes in a StringProperty ...
0
votes
0answers
23 views

Blender 2.93 API primitive_cube_add change

This script is able to run properly in 2.92, but 2.93 doesn't seem to output the same results for the created cube. ...
1
vote
1answer
33 views

How to limit select edge loops on seam?

Basically select edge loops will result like this: Is there any way (or script) to limit the select loop on seam quickly? so the result should be like this: EDIT: Bellow is example selection what i ...
2
votes
0answers
16 views

How to extract a value from the gui in python?

I'm trying to print that value (9%) on the commandline. How can I identify the progressbar's objectname?
2
votes
0answers
13 views

How to see the bake progress on the commandline?

After this python line bpy.ops.fluid.bake_all(), blender --background starts baking yet nothing is displayed until it's done and ...
0
votes
0answers
20 views

Changing Panel UI content based on user input

Is it possible to change the content of a custom panel based on user input? Let's say I have a panel with an explanation text (Label) and a button which starts the function. As soon as the user ...
1
vote
0answers
23 views

Can I check (in Python) if a pixel is visible to a particular camera?

I need to know if a pixel is visible to a particular camera. I don't need to know if it's blocked by another object (as is the case in this answer), so I'm thinking the answer might be simpler. For ...
0
votes
1answer
11 views

Delete armature and bake animation / boolean

I have an object parented to an armature that is animated with a series of movements. I need to perform some boolean operations to this object in different frames of the animation, but if I just add a ...
0
votes
0answers
9 views

What track and up axis. means when using the Vector.to_track_quat function

can someone please explain the logic of to_track_quat fucntion input parameters ? ( track and up axis ) https://docs.blender.org/api/current/mathutils.html?highlight=to_track_quat#mathutils.Vector....
1
vote
0answers
12 views

Change Focal Length on the fly (Scrool Wheel or Custom Shortcut) in The 3D View/Walk Mode/Fly Mode

I found no shortcut to change the 3d viewport focal length and I cannot create one by right clicking on the Focal Length bouton. I think this possibility exists with Python lines but I am having ...
0
votes
0answers
21 views

How to know if updating blender will consist this patch?

I have the same issue0 as this user whom apparently provided a patch. My blender --version is ...
0
votes
0answers
12 views

Rendering packaging files with other textures

I have created a packaging model and I have to render several packaging lay-outs on the same model. For example a 4 boxes of thee. 1 model 4 graphic designs in a directory How can I create a batch or ...
2
votes
1answer
21 views

How to load a mesh quietly? [duplicate]

I am using Python script to load a mesh from .obj format file. It output some information when it loading. I want to disable the output. How can I do?
0
votes
0answers
19 views

Sculpting for animation caveats?

I know to sculpt my characters with an A-Pose or T-Pose to save myself a lot of headaches later. As well as toes that point forward and straight fingers and a little bend on knees and elbows. What I'...
1
vote
1answer
10 views

Fluid not baked from script but only from gui

While baking from GUI perfectly works, I have no animation if baked using the script below. What else could I try? ...
0
votes
0answers
44 views

How to use bpy to import a .mat (MatLab) file into blender's python interface?

I looked around on Google, and found that python has support for this through the scipy module. According to this StackExchange page, all you need to do is: ...
0
votes
1answer
28 views

Can´t see the inputs in dialog box- blender 2.93

i worked in a dialog box in blender 2.92 and it worked fine, but in this release the dialog box doesn´t show me the input, here an example: Here is the code: ...
1
vote
0answers
19 views

These drivers are identical according to the UI. Why does the scripted one not work?

I have put a driver on the tilt attribute of a bezier curve, and linked it to a hook manually first to see if it would work. The result of this is as follows: And here you can see that the bezier ...
0
votes
1answer
57 views

How to access the data from a node socket, for processing it?

I am trying to create a custom node of my own, where I get the input from node sockets, process it (all in code, without involving node groups) and put that processed data to an output node socket to ...
0
votes
0answers
17 views

Preferences Panel list, I'm unable to get list items to save to the addon preferences!

I don't know why but I've tried to get the property group to reference through the addon preferences for the list and been at this for four days and cant get anything to work. I've used this link ...
0
votes
0answers
18 views

How to change to pose-mode when running a Python script

How can I change to pose-mode with a Python script while the whole program is running in the background? When I use bpy.ops.object.posemode_toggle(), it just shows <...
0
votes
0answers
11 views

Run operator on Dope Sheet event

I am trying to run a custom operator every time something changed in the dope sheet. I found a few handlers that can help me, (not as precise as i expect) and struggled with infinite recursion because ...
0
votes
0answers
18 views

How to extract animation details for export

I want to export all of the animation information from Blender to use in my application. I have written a Blender add-on in Python that mostly works, I am just missing one vital piece of data that I ...
1
vote
1answer
46 views

How to rotate past 180 degrees with python?

I need to rotate an object along arbitrary axis (local Z) in the range of 360 degrees. However, the rotate_axis method limits the angle value to 180 degrees and adds a sign (+/-) to allow for 360 ...
0
votes
1answer
25 views

Python: get driver value / calc driver expression

How to get driver value via python? dr = bpy.data.objects["Cube"].animation_data.drivers[0]
2
votes
0answers
30 views

Looking for a script that transfers shader attributes to custom properties

I am currently working on a project that requires me to input the attributes of a group node to the custom properties of the material. Some attributes include the color, blend mode, ignore base color ...
3
votes
1answer
127 views

Change node links based on which Render Layer is rendering

I am trying to make a setup where a different node is connected to a node group's output depending on what Render Layer is being rendered. For example, if layer 1 is rendering, then RGB is connected. ...
0
votes
1answer
34 views

Help unbind all materials from selected object

i hope someone can help me, is it possible in python to give object e.g. "Sphere" its own materials? (single-user option) I hope someone can help me. (Blender 2.92.0)
0
votes
0answers
19 views

Custom error message on addon enable?

I'm writing an addon (let's call it MyAddon) which depends on other addon (say DependencyAddon). If I install DependencyAddon first and then install MyAddon all works fine. Otherwise I get an ...
2
votes
1answer
74 views

Using Message Bus to trigger events based on custom property changes

following Blenders documentation from the following link: https://docs.blender.org/api/current/bpy.msgbus.html I am trying to adapt the example to add a subscription to a custom property as follow: <...
0
votes
0answers
22 views

STL file too slow to load

I'm new on Blender and I'm struggling with Blender's import operator for STL files. In my code, I try to load a file from the browser and then make some actions on the loaded object. I can get the ...

1
2 3 4 5
98