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

Object Respond to it's own Driver

I have a situation where I am using my driver tool rapidSDK but when I rotate my character, I have no expression or other buttons allowing it to respond to the driver akin how when the driver was ...
user avatar
  • 75
1 vote
1 answer
35 views

How to assign a material through Python

I have an .obj file that contains hundreds of materials. These are however not correctly named. The vast majority of them are duplicates of the original materials. Somehow every instance of the ...
user avatar
0 votes
0 answers
11 views

How can I read .anisotropicbsdf

I have a BSDF file ending with .anisotropicbsdf. I saw that blender can render based on this format. However, I would like to use blender to somehow convert the file into a human-readable file format. ...
user avatar
  • 1
0 votes
1 answer
33 views

Map to influence light speed

Question: Does anyone know if there's a way to have a texture map use multiple colors or a color's values to control the speed of reading the light of a toon shader? For example: When the light ...
user avatar
  • 75
0 votes
0 answers
27 views

object.select_set(True) makes item active, not selected [duplicate]

I'm trying to add a simple triangle to a scene (with Blender demo BMW) using python script. I then want to enter edit mode, select a vertex and then move 3D cursor to that vertex, exit edit mode and ...
user avatar
0 votes
0 answers
27 views

Importing .obj files and rig info file with script

I have .obj files(mesh) and corresponding rig info .txt files. rig info files have information of joint, root, skinning, and hierarchy of joint. I want to import mesh and rig info to a Armature and ...
user avatar
0 votes
1 answer
16 views

Shortcut to Rotate 60 degree via Script

I have an object that's a hexagon tile and for quick editing I am trying to make a shortcut key to rotate the object 60 degrees along the z axis, direction doesn't matter. Could someone show me a ...
user avatar
3 votes
1 answer
77 views

Raycast-influenced Shapekeys

Are there any possible geometry node setups (even if scripts are needed) that may allow Raycast to trigger multiple shapekeys based on rays touching whatever faces/vertices each shapekey is ...
user avatar
  • 75
0 votes
0 answers
24 views

Exporting a material+mesh list

So I'm working on a long term project which consits a file with over 100+ Meshes. Each mesh has number of different mats assigned to it. Is it possible to export a list from Blender which provides the ...
user avatar
0 votes
1 answer
15 views

How can I speed up this bake script I wrote?

I wrote a script that handles baking objects textures into an image node that is then attached back to a bsdf node. It works well for the most part. It's just really slow. Like 45 seconds - 90 seconds ...
user avatar
  • 183
0 votes
1 answer
55 views

Blender 3.0 and above does not recognize shader node created by 3rd party addon

The addon is used to export .x and .mdl files for use in Microsoft FSX and Lockheed Martin P3D flight simulators. It is open-source, created and modified by various people over the years. There isn't ...
user avatar
  • 121
0 votes
0 answers
16 views

Is there a way to select blender project inside python script without being in blender console? (Just python script without blender console)? [closed]

I was wondering if there is a way to select blender project with just only python script.(I dont have a script and I been trying for weeks now and no result.) Like for an exmaple I have an python ...
user avatar
0 votes
1 answer
30 views

An array of 3D arrows (python in Blender)

I am new to Blender and I want to create an array of 3D arrows; the array itself is 2*2 (constant space between each object) but the arrows are 3D. I hope to write a python code for it but I don't ...
user avatar
  • 1
0 votes
0 answers
12 views

How to add item to object parent popup menu in Blender >= 3.0

I am able to add an operator to the Object > Parent menu in the 3D Viewport, however; I would like to add the operator to the ...
user avatar
1 vote
1 answer
15 views

Need help with script that loops through a collection and bakes objects

So I'm having some difficulty with a script I wrote that should loop through a collection of objects and bake the materials for each object. I feel like I'm pretty close, but the script is failing at ...
user avatar
  • 183
0 votes
0 answers
16 views

zipimport.ZipImportError: can't decompress data; zlib not available when running script in Blender 2.43

when I try to execute an export script using Blender -P C:\Code\Code\Testing4Flt\Testing4.py in the cmd on Blender 2.43(Python 2.4), I get an error: ...
user avatar
2 votes
1 answer
89 views

GLSL: 2D space transform matrix of Custom Shader

Here is a template of build-in shader to draw a 2D Rectangle in viewport and that is good. ...
user avatar
  • 2,122
1 vote
1 answer
27 views

Select/Unselect collections through python script

I am new to blender, I have a bunch of collections say parent collections ( each collection has one or more sub collection say child collection) What I want is , I want to select only one of the child ...
user avatar
  • 13
4 votes
1 answer
36 views

Create a Disjointed Curve Using a Python Script

I'm trying to create a curve with a python script but I want some of the edges to not be connected. This is what I have so far ...
user avatar
0 votes
0 answers
31 views

How to change the way Blender shows me measurement information?

Hello everybody! I remember reading somewhere that, the Blender API that shows the measurements in the interface (see left of the gif image) is not exposed. Does this mean that there is no code that ...
user avatar
1 vote
1 answer
18 views

change a word in armature bones names with a script

I have an armature with some of it's bones names has a prefix like "_cloth_bone-name" . i want to change it to "[cloth]bone-name" , I can do a simple rename but there is a lot of ...
user avatar
0 votes
0 answers
15 views

Camera locations not updating before render (Python)

I am updating the camera position and rendering frames 1 at a time, however, for the render the camera position is not changing bpy.context.view_layer.update() is not doing it I've checked the ...
user avatar
  • 1
1 vote
0 answers
30 views

How can i programmatically create a hierarchy of collections?

I have this code that works nicely, but, I have no idea if this is the correct way to write it. The idea is to have a main Scene collection and all other sub-collections inside but some of them also ...
user avatar
0 votes
0 answers
29 views

Search Box for Custom CollectionProperty

When you have 'particle effects', or 'sounds' or 'actions' (among others), there's a dropdown like this: It lists all items of a data type, and allows you to create a new one, change the active one, ...
user avatar
  • 310
0 votes
1 answer
28 views

Exporting Mesh + Material does not work with error message "NO NODES!"

I have the following simple script that draws a cube and color it in red. ...
user avatar
1 vote
2 answers
44 views

If there is any way in Blender I can use a mathematical formula to control particle density?

I'm trying to visualize something in physics. I have a formula that determines the density of particles at each point in 3D space. How can I visualize this? For example: density=1/r^2
user avatar
  • 11
4 votes
1 answer
102 views

Set collection color in outliner with Python

I have this script that creates the collection, but I have no clue where to add the color_tag to it that it works. Thanks for the help. This is the code or at least a piece: ...
user avatar
0 votes
0 answers
11 views

How to transfer shape keys with drivers applied?

I'd like to select a shape keyed object and transfer these shapekeys selected objects with their value and drivers. https://github.com/fblah/ShapeKeyTransferBlender Using this addon to transfer Shape ...
user avatar
2 votes
2 answers
25 views

How to delete a keyframe of an object at a specific frame with python?

Say I have an cube that has keyframes baked already. Using python scripting, is it possible to do something like object.delete_keyframe(frame=1), which deletes all keyframes of that object at frame 1?
user avatar
  • 33
0 votes
0 answers
15 views

Customizing colourramp node to have individual slider location and colour inputs

I have some python experience but not in blender. I am trying to customize the colourramp node so that each slider's location and colour can receive inputs. Like this: when new sliders are added the ...
user avatar
0 votes
0 answers
13 views

bpy not valid Win32 application error

I've built Blender as a python module on my windows 10 64X bit pc. I've then uploaded the 3.2 folder, bpy.pyd, and all .dll files to a github repo. After I download these files onto my remote windows ...
user avatar
0 votes
0 answers
14 views

Animating Blender Poses with scripting

I am thinking of animating my pose library with blender scripting for that i been searching for video solutions but could not find something helpful. If there was any it was only moving a single bone ...
user avatar
1 vote
1 answer
19 views

Batch set orientation of local axes on multyple objects?

I have a structure composed of many separeted cylenders (maybe later it will be more complexe mesh). And the local axes orientation of each cylender is wrong (based on global). I know how to set (...
user avatar
  • 11
1 vote
2 answers
33 views

Python: Check data path is valid of driver variable

Need a function to check the data path is valid of driver variable target ...
user avatar
  • 2,122
0 votes
1 answer
20 views

Blender Script - How would you copy all modifier settings like Collisions from an active object to other selected objects?

So the issue im trying to solve is how would you copy all modifier settings or attributes (like Collisions) from an active object to other selected objects? I have many objects I need to copy settings ...
user avatar
0 votes
1 answer
31 views

Is there any reason anyone would prefer appending/removing external parts over excluding/including collections in an object generator? [closed]

I bumped into this NFT generating script where a guy just keeps on deleting everything->adding new random objects from external files->rendering->deleting everything->repeat. And I started ...
user avatar
  • 194
0 votes
0 answers
13 views

Enum Property Callback(s) on scroll ? on click ? on release?

So there is my question today : I'm working with an enum props for my addon. This enum contain X Meshs. I want to be able to update the mesh on scrolling then update the enum (for example removing the ...
user avatar
  • 85
1 vote
0 answers
21 views

How can I change the active item in Asset Browser with Python?

I'm trying to highlight different poses in my Pose Library(Asset Browser) with Python. The same way like when you just click it once—but this time with code. I need it to execute ...
user avatar
  • 194
4 votes
1 answer
32 views

Apply copy transform constraint using script

I'll try writing this the best I can. I want to be able to apply a copy transform on Rig 1 so it can be controlled by Rig 2. Both rig has the same bone names etc. Instead of manually going to each ...
user avatar
  • 43
0 votes
0 answers
25 views

Project camera image onto mesh in background mode using Python

I am simply looking for a way to project camera image onto mesh in background mode with Python bindings but the constraint is that I must do this in background. I can do it with Python, simply ...
user avatar
  • 1
0 votes
2 answers
34 views

Replace image in blender using script

It seems to be easy but as a beginner, I can not configure it. I have four blocks with a different images. I add all four images using "images as planes". Now I want to replace all four ...
user avatar
  • 21
2 votes
2 answers
25 views

Offset an animation fcurve in python?

I want to offset an entire range of keyframes (all) in an individual animation fcurve using python. Is there an operator or function that will do this without needing to iterate through the keyframes ...
user avatar
  • 159
2 votes
2 answers
23 views

How do I grab the header in an area?

I want to delete a context of an area except the header but there's no header method inside of bpy.context.window.screen.areas. ...
user avatar
2 votes
1 answer
19 views

How to put a keyframe on render visibility through python on blender

I'm trying to automate an application that involves a lot of objects appearing and disappearing, then a thought in using python to do this bot I don't know the specific command to create a keyframe ...
user avatar
3 votes
2 answers
37 views

How to delete point from spline

for my script I need an empty spline (with no points), but when I create a new spline, blender creates a new point within the spline. How can I remove this point, so I am left with an empty spline? ...
user avatar
2 votes
1 answer
36 views

How to generate images of model components using python?

I am new to blender but wonder if it is possible to programmatically position the viewport and then render images of each visible component. Pseudo code below: ...
user avatar
  • 123
0 votes
0 answers
40 views

How to convert Blender as a Python module into an easily downloadable package?

I have successfully converted Blender 3.2 into a python module on Windows 10 and can import it into my Python 3.10 scripts and run bpy commands. As described in Building Blender as Python Module on ...
user avatar
4 votes
1 answer
28 views

Unable to toggle multiple snapping options at once using blender pyhton

The thing is I am trying to toggle on/off multiple snapping options ( like enable snapping ,enable align rotation to target , enable scale ,enable rotation) with a single button created in my cistom ...
user avatar
  • 55
3 votes
1 answer
103 views

How can I transform my coffee cup into a torus as seen on wikipidea?

I'm animating the coffee mug torus homeomorphism. I want my animation to match this gif as closely as possible. The gif above, along with the POV-ray code used to create it, can be found here:https://...
user avatar
  • 372
0 votes
0 answers
22 views

How to trigger on shader node update?

I've been trying to create an add-on that should execute a function when I update anything on a shader node but I haven't managed to do it. I thought it may not be possible and was about to give up ...
user avatar

1
2 3 4 5
108