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
1answer
17 views
0
votes
0answers
4 views

Link Armature to body in command line

I have my own script with armature only and want to link the armature to my object body through command line. My object can be two cubes and this is my armature script : ...
1
vote
1answer
20 views

Element indices messed up after switching from Edit to Object Mode

I encounter the following problem. If, somewhere in my script, I switch from Object mode to Edit Mode and back, the indices of the elements in my object become messed up. To recreate the problem: ...
2
votes
1answer
19 views

How to add a custom panel to particle properties?

I'm trying to add a new panel to show up in the particles section of the Properties Editor. ...
0
votes
1answer
28 views

Creating complicated models using scripts

I'm new to blender and 3d modeling in general, but I have a python background. While searching I found models created via scripting. These models were good, but the general idea was creating ...
0
votes
0answers
11 views

Creating keyframes and dealing with bone constraints in Python script for export to fbx?

Working with blender 2.8 : I'm using constraints on my bones (COPY_LOCATION and STRETCH_TO) in order to parent the heads and tails of the bones to animated empty objects. Every time I export to an ...
0
votes
0answers
6 views

undo history export using bpy in Blender 2.83

I am trying to export the undo history using bpy in Blender 2.83. Currently I am able to record the undo history after each action I took using python script. Anyone knows how to export them? Or any ...
1
vote
2answers
36 views

How can I unsubdivide regions of flat faces with Python?

First: I have a very detailed mesh (16M tris) but there are many regions where lots of faces have the same height and angle. An optimization approach (real time rendering is the goal) is to select a ...
0
votes
0answers
14 views

Assign a datablock to an existing object

For example: camera_obj = bpy.data.camera.new("Camera") obj = bpy.data.objects.new("Camera", camera_obj) works as expected. But is it possible to create ...
2
votes
1answer
34 views

Unexpected result setting a shear matrix as transform

I am doing a visualization where I need to transform a sphere with a matrix. Easiest solution would be to just set the matrix as local transform but this gives me unexpected results. I was trying ...
1
vote
1answer
22 views

Why does my add-on work from the 'Add' menu in the header but not from Shift+A?

My modal addon is using raycast, I've taken a function from Blender python templates: everything worked fine. However when I try to add my addon to ...
0
votes
0answers
17 views

How do I place editable curves in Custom Bevel Profile panel?

Can anybody tell me how I can place editable curves in a panel and how can I reach their points?
0
votes
0answers
8 views

making a blender addon (in python) that has a keyboard shortcut and works in edit mode (not object mode as per example)

I am trying to make a blender addon using this template (last example on page): https://docs.blender.org/manual/en/latest/advanced/scripting/addon_tutorial.html I have successfully got my addon to ...
1
vote
0answers
7 views

How can I use blender's python API from a Ipython terminal or Jupyter Notebook?

I would like to have a python notebook running on my localhost:8000 that i can execute bpy scripts with... and see the resulting change in my other monitor which is ...
0
votes
0answers
13 views

edges.new - Edges Not Adding Correctly (black not solid orange)

I'm using a python script to create edges. For some reason, my script is recognizing some edges, displayed in solid orange. Others are not recognized the same and are displayed in black. (see image) ...
0
votes
0answers
22 views

Texture painting modal fills up the memory

I have a texture painting modal which uses bpy.ops.image_paint(). The issue is that it the memory usage goes up incredibly fast when painting with it. This is ...
0
votes
0answers
8 views

How to Test OptiX with GTX 16 Series?

so, i see this https://developer.blender.org/rB58ea0d93f193adf84162d736c3c69500584e1aef#change-e67uUgRJWMjZ . and then how to implement it to our blender?
0
votes
0answers
5 views

Blender Startup script won't run when opening file

so I have this script that I placed on \2.82\scripts\startup folder in a Blender daily build. When I start Blender, the script does run, however, when I open a .blend file (outside of Blender, ...
0
votes
0answers
9 views

Operator : bpy.ops.object.proxy_make()

I've got some trouble with bpy.ops.object.proxy_make(). To resume: my script import a character who has a rig. this character is imported as a link then I make it ...
0
votes
0answers
21 views

Save blender scripts from command line [closed]

I want to convert Blender scripts to blend files in object to convert these blend files to videos files from command line. Convert Blender scripts to videos files from command line. I ask that ...
0
votes
0answers
8 views

save() works but save_as() doesn't

I defined the following: image = bpy.data.images["my-texture"] image.file_format ='PNG' image.filepath = "//my-texture.png" This works: ...
0
votes
1answer
20 views

I need to export a list of particle coordinates

This code was built for Blender 2.78, but I trying build the code in 2.8. Blender doesn't show any errors, just opens a new empty text file. I'm using the code from here: ...
0
votes
0answers
12 views

Find out Сompositor node tree active output (Python)

Let's say for some reason I have 5 "Composite" nodes in Compositor. How can I find out through API which one of them is active render output? ...
1
vote
1answer
16 views

How to stop the timer when the ESC key is pressed

I'm testing the following add-ons. This is an add-on that will print 'test' every 0.1 second. ...
1
vote
0answers
22 views

Procedural stairs driven by a curve

The idea is to create procedural stairs that are driven by a 2 point curve (or just 2 empties if possible). The curve/distance between empties controls the amount/length of stairs and the angle. I ...
0
votes
1answer
18 views

What datablock should I use to store properties?

I'm using Scene data block to store properties and use them later in my script, e.g.: ...
0
votes
2answers
27 views

Using object's printed name in script

I am trying to write a script that will end up baking materials from a high poly object to a low poly object. The problem i am having is that i will never know the object names beforehand, as my ...
0
votes
0answers
14 views

check if texture image node with designated image already exist

to bake multiple materials into one, I must add an texture image node with a designated image into each materaial of an object. ...
0
votes
0answers
15 views

How to access render result pixels from python script

I am trying to do what a lot of people here already asked before. I want to have a pixel array from a renderer output directly in python, without saving it to the disc first or changing the source ...
1
vote
0answers
18 views

Problem with bpy.ops.object.origin_set [duplicate]

I wrote a script that is attached to a button in the addon. Works perfectly, up to the code line, where is bpy.ops.object.origin_set (type = 'ORIGIN_CENTER_OF_VOLUME'). The previous command works ...
0
votes
0answers
19 views

Splitting keyframe into separate animations by darkspots in the time line

So for a project I'm working on I have hundreds of models in FBX format(including animations) These FBX files were originally DAE but due to issues with the Y-Axis being up, the animations got all ...
0
votes
1answer
13 views

How to make constraint permanent once disabled?

I have got a beautiful bone constraint: I would like to be able to enable and disable this constraint without the bone reverting to the original position. By default, the bone appears to return to ...
0
votes
0answers
10 views

How to add another option into current menu

I'm totally new to scripting/python and I can't find a way how to add another option ("both"/"vertical" /"horizontal" list) into subdivide menu - menu that appears when you subdivide your mesh. How ...
0
votes
0answers
18 views

Event for Selection Mode

I'm just starting to learn Blender and I'm trying to make a toolbar where I would display different set of buttons according to which selection mode you are in. At the moment I can switch the button ...
0
votes
1answer
18 views

The volume of an object resulted from a boolean operation is “sometimes” a negative number. Why is this happening?

The volume of an object resulted from a boolean operation is "sometimes" a negative number. Why is this happening? If I export this object as an STL file and import it back, the volume of the imported ...
-1
votes
0answers
25 views

removing or deleting all objects matching a string in blender with python [closed]

this code works. But.. are there any glaring issues, or stuff that could be smarter? ...
0
votes
1answer
19 views

How to add keyframe for data value with script?

I have the following script: ...
1
vote
0answers
32 views

How to remove or join two areas with python?

I’m trying to remove a specific area from the screen. There doesn’t seem to be a simple .remove, so I looked for other options. I found this (How to join two areas using python?) which would have ...
0
votes
1answer
36 views

Trouble with getting correct context

I am brand new to both blender and python, so i apologize in advance if i'm missing something simple, but i'm having trouble with my script. The purpose of my script is to hopefully delete the default ...
0
votes
0answers
13 views

Export shader nodes from Blender to Unreal Engine or Unity

I would like to know if there is any way to export the shader nodes I created in blender to Unity or Unreal engine. Thank you in advance
0
votes
1answer
20 views

How to Change Image Saving Options with the Python API? (Color, Color Depth)

In my script I create an image, generate the image and then save it like this: ...
1
vote
1answer
72 views

Spiral array but with fibonacci sequence

I am trying to make a sunflower. The seeds in a flower grow in a spiral. Whenever I add an array spiral and make it follow the curve, it doesn't seem to look quite right. This is because it doesn't ...
1
vote
1answer
21 views

Is there a way to set the radius of the new circle select tool by python script

I know a little bit of Javascript but don't have a lot of experience scripting in blender or Python. I've tried to set the Radius of the new Circle Select tool by code as it's not possible to use a ...
0
votes
2answers
31 views

How To Convert Imported Identical Meshes to Instances (Duplicate Linked)?

I was wondering if there is a way (or python script) to convert multiple identical meshes into instances? - where all other identical meshes are referring (instanced) to the first identical mesh e.g., ...
0
votes
0answers
29 views

How to Run Code After Baking With 'INVOKE_DEFAULT' Has Finished?

bpy.ops.object.bake('INVOKE_DEFAULT', type='DIFFUSE') save_image() Does not work because the bake uses 'INVOKE_DEFAULT' and ...
0
votes
0answers
41 views

How can I get pixels from multiple render passes through Python and store them to generated multilayer image?

First of all I know that the easiest and probably the most efficient and the fastest way would be to add File Output with different inputs, but as far as it is possible I'd like to avoid writing ...
0
votes
0answers
23 views

headless (or non-UI) mode for non-rendering purpose

Recently I am working on some projects that I want to control blender modeling outside blender. Currently, I am able to do this with the UI version, and running on a computer with X-window, so the UI ...
0
votes
0answers
13 views

Creating a project with multi language support

Imagine I have a project or set of projects with many (and partly same) text elements. What I need are versions of the imagery Blender outputs in different languages. How to manage translations ...
0
votes
0answers
56 views

Python Multiprocessing Does Not Work With “concurrent.futures.ProcessPoolExecutor()”

As you can see in the image, baking textures, apparently is mainly a single-cored task. Thus I'd like to use multiprocessing to run many bakes in parallel. Which ...
0
votes
0answers
20 views

Import and export from command line [closed]

iam newbie to command line and to python. I have more than 100 Millions of fbx files. I can not export its one by one. So can i Import fbx models and export its to blend files from command line? ...

1
2 3 4 5
78