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

How to export the point cloud coordinates created by the geometry node "distribution points on faces "?

Tried everything I could but cannot find a solution to export it in python code!
Mr. H's user avatar
  • 1
0 votes
0 answers
12 views

How Can I Create Value Slider In Blender 3.6 With Python Api?

How can I create a value silder like dimensions panel in Blender 3.6 with Python Api. I can already access dimension value and change those value with python script. I have the code for my slider ...
nikhil's user avatar
  • 23
0 votes
0 answers
7 views

How to duplicate vertices and modify their uvs with script?

I'm trying to write something similar to the array modifier and am trying to modify the uvs of duplicated vertices, just like the modifier does, and add 1 on the X axis for every iteration. This code ...
gcs_dev's user avatar
  • 449
0 votes
0 answers
9 views

How2 keyframe & trigger (retrieve+play) an action incl variable transform values (custom attributes) as with an Action Constraint (no timeline)?

My goal is similar to interactively actuating a controller to drive action constraints, but where some keyframes include variables (pref. custom attributes) for transform & shape key (and shader ...
mediaman1's user avatar
0 votes
2 answers
20 views

How to move selected vertices along their normals in Edit mode by script?

I'm trying to write code to move selected vertices along their normals in Edit mode. It seems like such a simple thing, but I cannot get it to happen. I have searched this question and I keep finding: ...
gcs_dev's user avatar
  • 449
0 votes
0 answers
7 views

How can I enable individual bone xray instead of full armature xray?

is it possible to somehow make bones have individual x-ray / in front properties? I understand that this property is being held in it's parent data block for the Armature object but why can't it also ...
Zophiekat's user avatar
  • 754
0 votes
0 answers
11 views

bmesh.ops holes_fill vs edgeloop_fill vs edgenet_fill

Can anyone help me understand the difference between bmesh.ops.holes_fill, bmesh.ops.edgeloop_fill and ...
atb's user avatar
  • 131
0 votes
0 answers
7 views

Confusing results when trying to align viewport to camera with Python

I have a scene with a 40mm camera, for a reference I put some boxes that visually touch camera region borders. Viewport is close to 16:9 — just like the scene format. Then I disable the camera view ...
Sergey Kritskiy's user avatar
0 votes
0 answers
10 views

Baking from script on Blender 4.0

This is the code required to bake a particle system on Blender 3.6: ...
Jorge J González's user avatar
0 votes
0 answers
7 views

Drawing folding/collapsible sections in an Operator's Undo panel?

I'm making an operator that is getting big in terms of properties and options. I thought about separating those properties into different kind of tabs that depending the selection, X or Y properties ...
Ommadawn's user avatar
  • 508
1 vote
0 answers
26 views

Prevent that changing an Operator's property retriggers the operator?

I'm making an operator that has the bl_options = {'REGISTER','UNDO'} in order to call the undo menu. Since my menu's draw() is ...
Ommadawn's user avatar
  • 508
0 votes
0 answers
12 views

Custom Panel Ignores ui_scale and ui_units

i was using a pie_menu previously but decided to switch to a panel to make use of the "keep_open" property after converting the UI to work with a panel i noticed the ui_units and ui_scale ...
ValyArhal's user avatar
0 votes
0 answers
14 views

Python bmesh: Using selected edges on a curved object to create a face

I am creating a parameterised model of a segmental tunnel-lining ring using Python and I have managed to create all the appropriate vertices and edges for the 'num_segs' number of segments in the ring....
redblue's user avatar
0 votes
0 answers
16 views

Blender crashes when executing bpy.node.view_all(). How can I fix this?

When I try to execute bpy.node.view_all() within my code, Blender crashes. I'm attempting to override the Blender context to run bpy.node.view_all() or ...
Nattear's user avatar
0 votes
0 answers
14 views

How to make prop_search in call_menu automatically show all dropdown list

I'm creating a menu that lists all materials, but the dropdown list doesn't automatically show, and the user can't type in the search box straight away. I tried using 'activate_int,' but that doesn't ...
Riki maru's user avatar
  • 151
0 votes
0 answers
17 views

I don't know how to make add-ons that respond to renderings [closed]

Outline size changes with distance. Add-ons are created. We have created a behavior where you click a button and the line size changes and is rendered. However, I would like to implement a movement ...
Cow's user avatar
  • 1
1 vote
0 answers
21 views

Can't call a method inside a setter? (Operator)

I would like to understand what is happening here. I'm simply trying to call a method inside the setter of a property in an Operator (in order to not repeat code). But I'm getting: ...
Ommadawn's user avatar
  • 508
1 vote
1 answer
21 views

adding modifier input with python API in 4.0

I'd like to create a geometry nodes modifier and add an input parameter (in this case a material) using the python API. I am able to create the node group and add a ...
Linus's user avatar
  • 288
0 votes
0 answers
9 views

in bpy, using bpy.data.libraries.load, how can I access the remote scene object?

I made a bpy script to load a remote blender file with bpy.data.libraries.load I've been able to access remote objects, materials and keyframes associated to copy ...
Oscar's user avatar
  • 105
0 votes
1 answer
17 views

How to get or set UI region scale via bpy?

In Blender there is a way to control a scale of each UI region by holding Ctrl+Middle Mouse Button and dragging the mouse up and down while the mouse cursor is over the desired region: My question is:...
Andrey Sokolov's user avatar
4 votes
1 answer
232 views

How does a monkey head touch a cube

How does a monkey head touch a cube
ASD1 ASD21's user avatar
0 votes
0 answers
11 views

blender Geometric proximity deleting geometry [closed]

How can Blender be implemented using geometric nodes? After the monkey head moves to the cube, the cube always lights up, similar to when the monkey head presses a switch light bulb and touches it, ...
ASD1 ASD21's user avatar
0 votes
0 answers
29 views

Using python how can I get the rotation of a mesh when rotation has been applied?

I have several meshes in a scene, each mesh is rotated at random angles. I have then applied the rotation so it sets back the rotation value of each mesh to 0,0,0 In python how can I calculate the ...
SarahLee's user avatar
  • 149
1 vote
1 answer
27 views

blenderproc quickstart -- urllib.error.HTTPError: HTTP Error 403: Forbidden

I am getting this error in Ubuntu 22.04 which I believe in part is very related to Blender. ...
Mona Jalal's user avatar
1 vote
0 answers
8 views

Is there any none bpy.ops variant of bpy.ops.object.material_slot_move function that is faster?

I am currently working on a script where I sort my materials after an index list, currently most of the script is quit fast, 0.03 seconds for a few hundred objects, but there’s a major bottleneck at ...
DanGry's user avatar
  • 11
1 vote
0 answers
13 views

bmesh smooth property isn't set

I want to select all sharp edges using a script. I tried something like what's suggested here: https://blender.stackexchange.com/a/41352/177165 which uses a bmesh edge's ...
danilo's user avatar
  • 13
0 votes
0 answers
19 views

Animating Pointcloud Color

I am trying to animate changing colors in a pointcloud in python but I'm not able to get the keyframing right. I'm not sure my setup is super ideal but I am using https://github.com/...
communist_legend's user avatar
3 votes
1 answer
79 views

Python API - access operator's class for builtin operators

Is it possible to access operator's class for builtin operators? For addons, I can either import them from addon's module ...
FamousSnake's user avatar
0 votes
0 answers
14 views

How to accurately measure time in a simulation

I want to measure the time of the simulation. Basically, we are running the simulation at 24 fps, so we think 24 frames is 1 second. However, there was a large error when we measured the time and fall ...
imagine020's user avatar
0 votes
2 answers
34 views

How to Set Selected Edge Bevel Weight in Blender 4.0

I have code that sets the bevel weight of selected edges in an object like this in Blender 3.3 LTS: ...
Christopher Gearhart's user avatar
0 votes
1 answer
6 views

Moving an EditBone along a local axis in Python

I'm attempting to write a script that helps automate rig creation for a specific type of armature, and the current minor issue I'm having is that I would like to create a pole target with as minimal ...
N-cognito's user avatar
0 votes
1 answer
49 views

Minimal object add-on UI with sub-meshes

I finally have this working UI, after exploring many rabbit-holes, so wanted to share it in the hope of improving its performance. Follow-up to this question (yes, last Christmas!). Background ...
koober's user avatar
  • 51
1 vote
1 answer
42 views

Is it possible to update image texture by using image buffer pointer?

I want to know if it is possible to pass bpy.data.images["image"].as_pointer() to a C function to update image pixels directly, instead of using ...
VSB's user avatar
  • 463
0 votes
0 answers
15 views

UPBGE error. Why can't I run my script via Logic Node Editor?

Why does an error occur when running a script using a "Run Python Code" node? For some reason, in the error description my script is called a module
Давид Сировский's user avatar
1 vote
0 answers
19 views

Python: Access preset of curve bevel custom profile

Is there a way to use Python in order to select one of the presets for profiles of curve bevels?
Peter Hilgers's user avatar
3 votes
1 answer
123 views

Indent Guideline in Text Editor

Does the text editor have a feature that shows the indentation of the code? If it does, that would be nice to know.
Riki maru's user avatar
  • 151
1 vote
0 answers
61 views

How to get backface state for faces in view?

Is this value somewhere? I can only calculate faces that are not aligned to a view. But this method is not accurate. Here is my simple method to select faces that not aligned to view ...
APEC's user avatar
  • 570
1 vote
1 answer
31 views

Python API - run commands before / after .execute of the operator with file selection

I can start an operator with file selection by adding "INVOK_DEFAULT" to it's call, e.g. ...
FamousSnake's user avatar
2 votes
1 answer
30 views

Iterate through list of files & run script

I created a script that runs on an individual file, but I want to automate it to run on a long list of files. Essentially, I want to automate this: Import file from list Various script steps Export ...
MikeSmo's user avatar
  • 21
0 votes
1 answer
27 views

where is stored the data of the projects? [closed]

good evening. I am developing a little program with Python, and I need the coordinates of every vertex in a project written somewhere, since making it manual would take a lot of time. Since blender (...
Emilio Canuto's user avatar
0 votes
0 answers
44 views

How to calculate pose bone values (pose_bone.matrix_basis)?

I tried to write own importer for custom model, but have some troubles with it: i don't understand how values of pose's B-bone are calculated. I have a skeleton with 2 bones: parent bone - A, and ...
SWR's user avatar
  • 1
0 votes
1 answer
49 views

How to Set Handles Correctly for Bezier Curves

I'm toying with Blender's bezier curves and I'm trying to make the following spline: I believe I've coded everything correctly, but it seems like I'm not setting the handles correctly. The curve ...
fny's user avatar
  • 101
1 vote
1 answer
12 views

How to add a driver to a shape key and modify the fcurves through Blender python?

My question is how do I reference a the fcurve modifier on a shape key driver in Python? I have the following code at the moment: ...
John Smith's user avatar
0 votes
1 answer
49 views

Why does this tiny script not work in 4.0? [duplicate]

This script works till 3.6, but not 4.0. ...
Mrfas's user avatar
  • 47
1 vote
0 answers
17 views

How to run an operator on UILayout.prop changes

I have a UILayout.prop(object, 'rotation_euler') to rotate the active object, a UILayout.prop(object, 'rotation_quaternion') and an operator to update the object rotation_quaternion property. ...
Antonio's user avatar
  • 325
0 votes
0 answers
16 views

ray_cast normals misalignment with respect to face normals

I'm trying to code an add-on that creates instances of an object on the surface of a target object, having the instances aligned with the normal of the face of the target. I can't use Geometry Nodes ...
Antonio's user avatar
  • 325
0 votes
0 answers
25 views

Create instanced "linked duplicate" of mesh respecting selected meshes location, rotation and scale

I am using the below code to create an instance "linked duplicate" of the last selected mesh in the location, rotation and scale of the previously selected meshes. However the below code ...
SarahLee's user avatar
  • 149
0 votes
0 answers
17 views

Pose nodes in blender [closed]

i want to create an addon that can access poses through nodes. So that animation be created procedurally. But i dont have knoledge of python Can anyone tell me how to do that
Suhail Prorex's user avatar
1 vote
0 answers
27 views

How to know if the active node in a node tree change?

I need to know if the active node of a node changes. I have found this example for the active object, that works very well: ...
frantz's user avatar
  • 11
0 votes
1 answer
36 views

Calling view_all() operator from another context is not working specifically on 4.0 [duplicate]

I have this code in my addon. It just runs view_all() operator from another context. ...
Fatih's user avatar
  • 3

1
2 3 4 5
257