Questions tagged [python]

Python is an object-oriented programming language. In Blender, it is used as a general purpose scripting language and to create add-ons to extend Blender's functionality.

Filter by
Sorted by
Tagged with
0
votes
0answers
6 views

How to delete a face using BMESH.OPS?

Sorry if the question is asked before, but I tried using the examples I found on StackExchange and it still didn't give me the right mesh. I am trying to create a tube that has a shape of cylinder at ...
0
votes
0answers
5 views

How to edit blender file parameters + settings from command line or python?

I'm currently rendering a Blender scene using Colab. The problem is that I have to constantly upload a new file to my Google drive with altered settings if I want to alter settings. Is it possible to ...
0
votes
0answers
7 views

Blender openvdb python extension

Blender uses OpenVDB 7.0.0 and version of Python 3.9. But the python module extension (.pyd) for OpenVDB needs version 8.0.0. Do you plan to upgrade openvdb? Or do you have any advice how can I make ...
0
votes
0answers
5 views

How to make object appear in certain frame (scripting)? [duplicate]

Im learning how to use scripting in blender. I would like to know how could I make a certain object to appear only in a certain frame. I have been searching this for a long time and I still can´t ...
1
vote
1answer
13 views

Draw in a region not found in space type

I'd like to create a footer where there's no "FOOTER" bl_region_type for example in the 3D view, it seems impossible to do in python? is this hardcoded in C++? ...
2
votes
1answer
16 views

How to render objects only with their materials diffuse color or without lighting

I am currently trying to write a python script with bpy and Blender 2.9 to render images of a couple of thousand wavefront objects with material information. I only need the "true colors" of ...
0
votes
0answers
18 views

My object becomes darker during animation

I have made this animation: https://i.imgur.com/qXzYD8o.mp4 Each frame consists of an object that has been generated independently using python. These objects are isosurfaces of a function at ...
2
votes
1answer
21 views

Getting edges of the camera's view on the scene XY plane

I need to place objects randomly into a scene so that they are consistently within the camera's view. I have a script which randomly places a perspective camera pointed at ...
1
vote
0answers
12 views

Having trouble properly adding object to collection using Python script

I want to put some objects in a separate collection in my Python script. However, when I add an existing object to a new collection, it seems to exist in both the new collection and the main ...
1
vote
0answers
17 views

How to get my node in the update function of a BoolProperty?

How to find the node referenced by the update function of this BoolProperty property? I usually use self.id_data for other types of PointerProperty, but in this case I get the node_tree this node is ...
-1
votes
0answers
35 views

Copy a material and store it [duplicate]

I need to copy a material with all of its nodes and store it somewhere (like a variable for example). Then, even after purging all of the data and deleting the original material, that variable would ...
0
votes
0answers
17 views

Copying Group Instance Computation Expense

I am pushing into the scene around 38k to 50k cube instances using Python, however, I am reasonably expecting to finish the execution of the code within ten minutes or so, I am OK with an hour at most....
0
votes
0answers
19 views

Why can't I add pip to the version of Python that comes with Blender 2.91.2?

Short version: I need to install external modules for use within Blender, but can't for the reasons given below. I'm on macOS 10.14.3 with Blender 2.91.2, which includes Python 3.7. I want to be able ...
-1
votes
1answer
38 views

Is it possible to make a scrollbar? [duplicate]

How to make a scrollbar in the tabs in the 3D view sidebar using python ?
2
votes
0answers
32 views

How to create a dynamic UI-list similar to the outliner

I'm currently trying to create sort of a "navigation" UI list with the parent/child concept like the outliner or any classic folder navigation. But I'm stuck at the part where I need my ...
1
vote
0answers
35 views

Is it possible to permanently corrupt a Blender file through BPY?

How careful do I have to be when modifying a Blender file through bpy? Is it possible, through any part of the the Python API/console, to permanently alter a file's ...
1
vote
0answers
20 views

Render to a Python list

I'm trying to get my renders to output to a python list or NumPy array. Currently, I'm doing this by rendering the image to disk (with a script), then using a separate python script to read the image ...
0
votes
1answer
31 views

Is it possible to make a scrollbar? [duplicate]

How to make a scrollbar using python ?
2
votes
1answer
29 views

How to rotate UV and preserve the correct aspect ratio?

Based on this answer, Rotate UV by specific angle e.g. 30deg in Python script in backgroud mode you can do a rotation of the UV mapping, then enter the rotation angle, so far everything is ok. The ...
-1
votes
0answers
34 views

Need Python support (Blender API): How to find all occurences of one “thing” in the hole Blender file? [closed]

I need to find all appearances of a certain "thing" (anything with a name) in a blender file. I start with haveing no Info about that "thing" and no name. I have no clue how to ...
1
vote
0answers
18 views

Locked track Camera error [closed]

Locked track object to camera x axis is very strange When camera is on z axis(rotation) x axis of cube turn up Is python can change it?
0
votes
0answers
18 views

Porting Python scripts for an automated animation pipeline to Unreal Engine

I am using a Python script consisting of various sub-scripts to implement a cluster-based face animation pipeline. After importing cleaned motion capture markers into Blender, which all have uniformly ...
1
vote
1answer
26 views

How to recalculate bone transforms/constraints to originate from armature origin point?

I'm trying to make an export script, and I need all the exported bones to be positioned at the armature's origin point. The trouble is that I would like to be able to position the bones anywhere in ...
0
votes
2answers
92 views

Exporting UV Layout with only outlines

newbie here. I have a very specific question. I’ve done a ton of research and didn’t find anything useful. So, as the Title suggests, I’m trying to export UV layout without all the edges inside of the ...
1
vote
1answer
23 views

Cancel addon registering

I am developing an add-on, which only works if some specific conditions are satisfied (e.g. some other add-on is installed). Hence, I want the user to be unable to register this add-on if the ...
0
votes
0answers
8 views

Creating and moving mask in Sculpt Mode

I'd like to create a mask(in sculpt mode) that would move, up/down with a custom slider. The first problem I have is Blender crashing down after i run this simple script. ...
2
votes
1answer
66 views

What is the coding alternative for double edge loop select?

Suppose I want to select the entire mesh boundary. Alt + RMB on a boundary edge would select one edge loop (left image), while Alt + double RMB yields the desired result (right image). How would I ...
0
votes
0answers
23 views

How does python bundled interpreter work, and why am I getting thees crashes?

I have experimented quite a bit with extending the modules that come with the blender bundled python. It is confusing to me, and seems not well documented anywhere how it actually works. A folder ...
4
votes
0answers
46 views
+50

How to dynamically load a .dat icon (toolshelf icon)?

Using documentation here 2.80/Python_API/UI_DESIGN, I've managed to create a custom .dat tool shelf icon for use with an operator in my addon. The icon will display from my addon when registered from ...
0
votes
0answers
15 views

If I have a math expression, how can I apply it to an objects origin using python? [closed]

I have just the default cube: I added a boolean modifier to cut the cube-like this: I also have a math equation that I want to try. The equation will set the origin to this part of the cube: I don'...
1
vote
1answer
27 views

Invoke the File Browser inside an Add-On but wait with the rest of the script until it's closed

I'm writing an Add-on in which I create a new Collection and then invoke the ImportHelper to load an FBX file. After that I would like to process the loaded data. My Problem is, that my script doesn't ...
1
vote
0answers
9 views

How to position a GreasePencil Stroke via scripting?

I am trying to automate blinking animation via scripting. I can move grease pencil objects, but I need to move a stroke inside a layer (I am using masking, so I can't convert the strokes into ...
0
votes
1answer
28 views

Get parent from a collection that's already in a collection

Im really struggling with what seems to be an easy task, however Im not able to make this work. I need to get the parent inside of a collection that's already in a collection, with the code im using <...
1
vote
0answers
37 views

bl_idname convention

Blender Wiki notes the following about bl_idname convention. BlenderWikiAddon "For headers, menus and panels, the bl_idname is expected to match the class name (automatic if none is specified). ...
-1
votes
1answer
31 views

I need a code to get the current value of the waveform from an audio file at specific frame

I would like to build a function that does something based on the current value of the waveform of an audio. Inputs: An audio file: like a speaker object or a path on the hard drive or a track name ...
1
vote
1answer
32 views

How to get the base dimensions of an object (ignoring all of it's modifiers)?

I'm trying to code a function that gets the base dimensions of an object that has multiple modifiers applied. Sure, I can turn all the modifiers off, get the dimensions and then re-enable everything, ...
3
votes
1answer
35 views

Strange size when creating a cube using bpy.ops.mesh.primitive_cube_add

Just starting with scripting in Blender, and the simplest thing seems to not work as I would expect. I copied the code that creates the standard cube and repeated it, with a z scale factor of 4. I ...
1
vote
0answers
23 views

Rotation Euler in Constraints python

Transformation constrain have an Euler mode in Blender 2.9. I need it in Blender 2.79. Thank you in advance! https://developer.blender.org/rBS18d4ad5a59d32922f9d70b0412da0c830baceb17
1
vote
0answers
15 views

msgbus.subscribe_rna() to an operator?

I'm trying to find a way to get notified by the operator bpy.ops.object.transform_apply() so every time my users are applying an object scale I can re-calculate it's square_area property. But I have a ...
0
votes
0answers
17 views

How do I move an object using the script editor?

I have looked for a while and cannot find an answer to this simple question: What code do I write to make a cube go from anywhere to anywhere? I have a spaceship that I want a player to be able to ...
0
votes
0answers
15 views

Add-on hierarchy

I am trying to create a family of add-ons, all of which use the same asset library. That means, all add-ons will use the same path to the asset library, and I want the user to specify that path only ...
1
vote
0answers
23 views

How to subdivide and calculate volume of an object without using operators

I'm using Blender for an unusual purpose (research) so my issue is probably a bit unusual, and Blender was likely not designed with the flexibility that I may need. I need to calculate the volume of a ...
0
votes
0answers
14 views

visual studio code bmesh gives weird error

i started making scripts in visual studio code for blender a few weeks ago but i ran into a weird problem, when trying to use bmesh specifically bm = bmesh.new() it ...
1
vote
1answer
50 views

Use location and rotation 0,0,0 for all exported meshes

I would like to know how can I modify the location of the 3d model that I'm exporting without modifying the original one, I'm using this code: ...
-3
votes
0answers
23 views

How to make the player move meant and AI in blender? [closed]

Im working on a game called Leviathan Realms
1
vote
0answers
27 views

Cannot import nested Python module when writing an add-on

I am working on my first add-on, though I am pretty experienced with Python having written multiple apps using Django. My project structure looks like this: ...
2
votes
1answer
47 views

How to create cylinder with varying radius at different height

My goal is to create a imperfect cylinder with a script, where some randomness is added to the radius of the cylinder at certain intervals. I am very new to blender unfortunately, and am lost at the ...
4
votes
1answer
168 views

Import image to plane not exported in GLTF

I want to create a 3D object of an image to use in AR using the Blender Python API. I've added the image to the scene as a plane, this works perfectly. The image is also shown in the ...
1
vote
0answers
12 views

Blender Python Object Transform operations - return values / Thread lock?

I recently stumbled upon the following problem of the data/context object API layer. If one changes object values which are accessed by the scripting with ...
2
votes
1answer
46 views

How to import text data blocks as modules using the 'from/import' statement?

I practiced using text data as a module as below. And it works very well. # function.py def function(): print('hello') ...

1
2 3 4 5
184