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
1 answer
374 views

Custom pie menu: shift in my hotkeys toggles multiselection mode between vertex edge and faces, how to toggle off previous mode?

I work as a professional Alias modeler for the automotive industry, i love Blender but after 8 hours using the same program it always take me some time to switch habits and enjoy modeling on blender. ...
1 vote
1 answer
11 views

Operator in import category working but showing as invalid syntax when accessing bpy.ops.import

I have several operators that import different file types like this example: ...
0 votes
0 answers
17 views

Getting to know Blender scripting [closed]

After a few days of trying to learn Blender scripting, I am wondering what the best method is for me to get started.
3 votes
1 answer
375 views

Run Python code from blank file every time

I am wondering whether it is possible to run a Python script in Blender 2.82 from the text editor, such that each time the script is run, it reverses everything that was done in the previous run. In ...
1 vote
1 answer
291 views

glTF export: setup for consistency for blender to Game Engine

currently, glTF appears to need textures directly setup with the principled bsdf except for baked ambient occlusion(AO) node. This is problematic because it doesn't allow for a consistency in ...
0 votes
2 answers
740 views

How do I make a bone active using Python?

How to make a selected bone active in POSE or EDIT mode? Thanks!
1 vote
1 answer
469 views

How to "refresh" variables / selected components for an operator in python script?

I'm working on an addon changing selected verticies per keyboard. It collects data: ...
3 votes
1 answer
870 views

Setting/overriding context for rigid body bake

I have a script that generates a tower of blocks, and I want to simulate this tower's collapse, tracking the position of each block as the tower collapses. (And then do this again and again for ...
3 votes
1 answer
106 views

Wait for compositor to finish before saving image to file - Python Scripting

I'm trying to write a script that will tweak some settings in the compositor, then save the resulting image. However, The resulting image is NOT receiving the changes that are being made in the ...
1 vote
4 answers
333 views

Python print object volumes with the 3D-Print Toolbox

Using the 3D-Print Toolbox add-on you can obtain object volumes. I have a lot of objects in my scene that I would like to print the volume value from and I was hoping I could do this through python. ...
1 vote
1 answer
38 views

Duplicate armature and mesh through API

I have a character that consists of multiple meshes parented to an armature, and I am trying to duplicate it using a script. Basically, I am looking for the script analog of ⇧ Shift + D, like in this ...
0 votes
0 answers
16 views

okay...im getting a scripting error when trying to port a map from a game to blender

I'm getting an error stating, " Error: Python: File "\Text", line 9 base_dir ="G:\umodel\game\assets" ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes ...
0 votes
1 answer
300 views

Driver Expression: Bind "Visibility in Viewport" to self.parent > hide_render?

I need to setup a driver to bind the "Visibility in Viewport" property of on object to its parent "hide_render" property. I want to use an expression only. So I did lots of ...
1 vote
0 answers
156 views

Accessing MeasureIt data with a script

I’d like to dimension and measure corner angles of objects with MeasureIt and then access them with a script so I can output a list of the objects with their specs. At this point I'd just like to know ...
0 votes
1 answer
347 views

Copying and rotating object via Blender Python API

I'm new to the Blender API, so I've been doing a lot of playing around with it. I'm having some issues trying to do something that should be simple. My goal: make a copy of a "base" object, ...
6 votes
1 answer
2k views

How to update compositing nodes via script?

I create some nodes in compositing via python script: ...
2 votes
1 answer
1k views

Texture from .png>dds

Is there anyone of you who knows if this question is maybe already answered. All my textures in my .blend file are now .png is there any way i can change them from format with a little script to .dds ...
0 votes
0 answers
5 views

Align vertices of two objects after aligning the 2nd object to the normal of the 1st using python

I have an object "pl" that needs to be aligned on to the 2nd object "cube" such that the end vertices of both objects align with each other currently i aligned pl along the normal ...
0 votes
0 answers
15 views

Where to find tutorials/guides on how to create more advanced operations?

I am interested in learning more about how to create Blender Plugins. So far I have made basic operations and panels however I am unsure how to make more advanced plugins that execute operations based ...
0 votes
0 answers
11 views

Import externally generated keyframes [closed]

I teach Digital Signal Processing. I am planning to assign to few students (the bravest ones...) a project where they take some recorded speech and estimate the corresponding shape of the mouth and ...
0 votes
1 answer
358 views

Rendering on GPU cluster

I'm trying to render a scene on a remote server with GPU cluster, this is the used setup: Centos 7 Blender 2.8 4 Nvidia 1080 ti while rendering I can see that all the GPUs take part in rendering but ...
1 vote
0 answers
37 views

Defining location on X axis for a parametric 3D model

Building a parametric 3D shoe sole and can't find a way to set the location for the start of the toe spring. Despite scripting a start of the spring at 10% of the surface length, the spring starts in ...
5 votes
2 answers
2k views

How do I run a script on multiple .blend files from the command line?

Problem: I have a bunch of .blend files that I want to make the same changes to as quickly as possible. Solution: Run a python script on each file from the command line? Here's the python script I'm ...
0 votes
0 answers
8 views

how to use baked fire smoke fluid data in scripting

i am creating a fire and smoke simulation using the bpy scripting , to avoid the baking fluid again and again , i baked the fluid manually in another blend file with modular and openvdb , now i want ...
2 votes
1 answer
90 views

How do you correctly add UI elements to adhere to the typing spec?

Here's my understanding of bpy.props.BoolProperty which offers additional functionality and integration with Blender's UI and data system. Using ...
0 votes
0 answers
29 views

Automatically Camera animation (jumping from one object to another)

I was wondering if there is a script or automation for the Blender Cam to automatically jump from one object to the next. The background is as follows: I am in the process of creating a photo show in ...
0 votes
0 answers
104 views

Python temp_override() takes no positional arguments [closed]

Good afternoon I get this error temp_override () takes no positional arguments when I want I press the letter E to export an image from Blender Gis thanks for ...
-1 votes
0 answers
26 views

Accessing 3d-print toolbox via a script

Warning, Potential AI generated content⚠️ This post is suspected to have been generated with the help of an artificial intelligence, chat bot, or other language model tools without proper attribution. ...
49 votes
1 answer
3k views

Custom trackpad pan/zoom/rotate behavior add-on

I'm trying to write an addon to customize the trackpad panning, zoomimg, and rotating gestures, but can't find a way to read the actual trackpad parameters for position and so on. The properties in ...
0 votes
0 answers
27 views

row.operator() pass an argument to the called function [duplicate]

I had this working for Blender 2.x long ago but I'm unable to get that old script to work in 3.x and 4.x. All I want to do is create a panel with buttons. The buttons, when clicked, do execute the ...
1 vote
1 answer
271 views

Draw window and swap doesn' work

I'am writing python script that uses data from IMU sensor and changes armature structure position. To visualise movement I use ...
0 votes
1 answer
21 views

How to call Operator inside another Operator

I am working on script/addon that will run bake operator every frame before rendering. The main purpose of the script is to bake diffuse shadows and color to an image so that I can use it in the ...
0 votes
0 answers
10 views

Addon or Script to Cycle Snap Type via Keymap?

I have been doing a lot of work recently in blender where i am constantly cycling between Face, Edge and Vertex Snapping, i wondered if there was a way to Cycle through the 3 options with a keymap (...
2 votes
1 answer
1k views

How do I set the bone length after setting a new bone matrix?

In version 2.77a; the docs show that the edit_bone.matrix is no longer read only, but a note warns "does not include bone length". Luckily, ...
1 vote
1 answer
21 views

Replacing elements in the selected object's material name

I am trying to alter the filepath of a material's texture and then also alter the name of said material. However, I would like to limit the name change it to the selected object's material only, so as ...
1 vote
0 answers
13 views

Is it possible to detect when a Operator preset is loaded prior to execute()?

Hello folks I have an operator that has the 'PRESET' bl_option for being able to save the properties as a preset. I'm using a ...
0 votes
0 answers
20 views

How can I execute an operator only when it is confirmed by the user via popup?

I found this nice popup script by @CodeManX that works like a charm. I am trying to get an operator to only execute when the OK button from a popup is pressed. I have this simple setup, but I cannot ...
0 votes
0 answers
8 views

Custom keymap not loading, I isolated Vaughan Ling's HEAVYPOLY setup's shortcut and put it in the 4.1\scripts\startup folder

What could be the reason for causing the keymap not to load? I already enabled the checkbox to run scripts automatically. ...
0 votes
1 answer
28 views

Is possible to execute an operator (OT) from code and SHOW its UNDO panel?

Hello folks I'm trying to execute an operator from code (like calling bpy.ops.my_operator()) and I'd like to show its UNDO-REDO panel. (The OT's panel is showing as ...
1 vote
0 answers
26 views

Creating Macro for Asset Browser Thumbnail Creation - Need Event for selecting the next Object once current selected Object Has Updated

I am creating a macro that will update the thumbnail using the plugin thumb mate, it creates a custom thumbnail for each object in the Asset Browser, because there are so many assets to update their ...
0 votes
1 answer
82 views

Batch processing scene render and a shadow not being bast

> ### Warning, Potential AI generated content⚠️ This post is suspected to have been generated with the help of an artificial intelligence, chat bot, or other language model tools without proper ...
0 votes
0 answers
33 views

How do I move a Pose Bone on its local axis?

All I want to do is move the active pose bone on its local z axis with a line of code. I tried many things, but no matter what I can only get it to move in world space or move the whole armature in ...
0 votes
0 answers
39 views

Showing (and modifying) a Color Ramp in addon's menu?

I've seen this post from 9 years ago and I'm asking it again because is possible that things have changed (I hope) when it comes to work with color ramps. I'd like to display and modify a color ramp ...
1 vote
0 answers
410 views

How do I import multiple .py files to my main.py file

I have a folder structure like this: C: |_Blueprint │ main.py │ └───toolbox blueprint_tools.py When I run this code in Blender's scripting text page: ...
1 vote
0 answers
30 views

Is setting the freestyle edge parameter via geonodes possible?

I have found this question that addresses the reverse problem. But how do I set the freestyle parameter for my generated geometry? I tried looking in the spreadsheet for any additional attribute that ...
0 votes
2 answers
1k views

How to stash all actions to current armature?

I just imported a bunch of actions from different files into one blend, but the GLTF exporter can't locate them without them being in the NLA stash. (There used to be a plugin that would export all ...
2 votes
3 answers
289 views

How to calculate object's location after rotation around a pivot?

I'm trying to create a capsule object in Blender, which consists of two half-spheres and a tube between them, and i need to be able to move it around as if it was a single object and adjust the ...
0 votes
1 answer
4k views

Installing module to blender's python (Mac)

I'm trying to install modules (one of them is open3d) with pip command. From 2.8+ it should be easy as pip install open3d (...
0 votes
1 answer
23 views

Fix Blender's script to link two mesh objects and keep the UV mapping each one has

I want to link two mesh objects and keep the UV mapping each one has and I've found solution here, but for me script doesn't work. I'm getting error: AttributeError: bpy_prop_collection: attribute &...
0 votes
0 answers
34 views

The script only works once in UPBGE

the solution (if it helps someone) just remove space in ray2 (thanks musikai in blenderartists) if ray(): own["key"] = " " cont.owner.state = 1 to if ray(): own["key"] = &...

1
2 3 4 5
127