Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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

Debug Blender scripts in VSCode [closed]

I'd like to be able to edit and debug Blender python scripts in VSCode. I found this tutorial (https://youtu.be/YUytEtaVrrc?t=633), and somewhere around 10:30 he explains that you just add a ...
G.H.'s user avatar
  • 343
0 votes
1 answer
15 views

Blender 4.1 how to correctly use "#Frame"?

How to correctly use #Frame to rotate camera around object? Parent camera to empty. select Empty. Rotation Z: #Frame/30 Syntax ...
CountQuadula's user avatar
0 votes
1 answer
31 views

How to reload UI without restarting Blender

I'm writing addon which edits default UI. To be specific - it works with VIEW3D_MT_mesh_add The functionality I need goes beyond standard ...
Yaroslav's user avatar
  • 431
0 votes
0 answers
17 views

Modify face orientations in bulk

I wrote a script for batch change orientation. Here is a script I wrote: ...
LIN's user avatar
  • 1
0 votes
2 answers
30 views

Set Origin to a specific vertex

I need some help with my script. The main task is to move the origin to the position of a certain vertex. In theory this works quite well, but unfortunately the meshes are always moved after i run the ...
Knudsen's user avatar
  • 37
0 votes
0 answers
21 views

How can I make this script not get exponentially slower?

I'm trying to linked-duplicate an object with nested sub-objects. I've rewritten bpy.ops.duplicate_move_linked() as a function without ...
mugwortz's user avatar
2 votes
0 answers
26 views

Text in reflection

I'm new here in this blender world and I really need your help with a college project. I'm sorry if anything is written wrong as I'm using Google Translate. I am from Brazil How to create a script in ...
bbd studio's user avatar
1 vote
1 answer
19 views

How to Align Icon to the Right in Blender Panel Header using python?

I’m trying to customize a panel using python in Blender 4.1, and I want to align an icon to the right side of the panel header. (like this) I’ve tried a few approaches, but I can’t seem to get it ...
VxQtW-1's user avatar
  • 13
0 votes
0 answers
19 views

change modifiers values ​with a gizmo

I see a lot of potential in gizmos, yet there is very little info on it. For example, I want to modify the properties of the modifiers or geometry nodes of my object with a gizmo. How to do this ? ...
André Ruf's user avatar
0 votes
0 answers
16 views

How do I convert camera's rotation from Z-Up to Y-Up?

So I have this script that exports data on the location and rotation of the camera every keyframe to a json file, and this is working great but the problem is that I need to convert the rotation from ...
The Batman's user avatar
2 votes
1 answer
17 views

Print out list of Asset Browser Items including their tags

I have a giant asset browser with over 2000 items. Some of the items have tags (product numbers), but not many. I would now like to output all the names of the items and their stored tags so that I ...
Erdorano's user avatar
  • 117
2 votes
1 answer
18 views

Python way to setup the Menu Switch default value when exposed to the modifiers input

I need to setup the default value in the geometry modifiers which is from a Menu Switch node. I tried two ways, neither worked. ...
baby boss's user avatar
  • 125
0 votes
0 answers
15 views

How can I create a custom geometry node that runs a Python script? [duplicate]

I'd like to create a completely custom geometry node (not a node group) that for example, takes some input string, reverses it using a Python script, and then returns the output as a string in that ...
J S's user avatar
  • 1
0 votes
0 answers
17 views

Placing an object along an edge over another

I want to place an object along an edge over another, but keep the same angle betwen faces. My English is not good so I hope a couple pictures can show what I want. I put manually a pyramid over a ...
Víctor GV's user avatar
5 votes
1 answer
111 views

How can I get the `session_uid` used by the Bake geometry node using Python?

I need to bake a part of my node tree via the bake node for an add-on. This requires a correct session_uid to press the button with Python. I already tried ...
Quisque's user avatar
  • 53
2 votes
0 answers
28 views

How to include created Geometry Nodes in addon?

I created Geometry Nodes group that I want to include with my addon so I can use it with other projects and/or share it with someone. How can I link Geometry Nodes to my addon?
Veeran's user avatar
  • 33
0 votes
0 answers
30 views

Camera-Based Value Driver

Does anyone know how this is working: Goal: I'm trying to achieve this ability with drivers: I notice it has what I call the "feedback loop", where if you angle the object and/or angle the ...
FIndTheFix's user avatar
0 votes
0 answers
18 views

Separate selection with python

I'm trying to separate mesh in two parts with a script, I want to "cut" the mesh in a midpoint plane with bisec and than rip the vertices, this part of my script works fine, the problem is ...
Vincenzo Casillo's user avatar
1 vote
0 answers
28 views

Blender script distorts large object

I am creating coin using cylinder and adding text on it. I am using blender script and calling script via command line. Sizes of coins ar 45mm, 60mm,, 75mm, 90mm and 105mm. It is working fine for ...
Tarlok's user avatar
  • 21
0 votes
0 answers
10 views

Set up Flamenco to support multiple Blender versions?

I have some older workstations that are not supported by the latest versions of Blender, but I still use interactively. I want to send jobs from these workstations to my Flamenco/Blender "farm&...
Doug Wegscheid's user avatar
2 votes
0 answers
42 views

Change Outliner area size via python

Looking for a way to write a toggler to quickly compress and expand the Outliner to the right edge of the screen and back. It seems that "bpy.ops.screen.area_move()" operator can be used for ...
Andrew's user avatar
  • 31
1 vote
1 answer
17 views

Is there a way to create a colored text box for StringProperty in addon UI, like the overwrite warning in Blender save-as window?

To store a user setting, I managed to access a StringProperty in my addon popup window like this: But i want to add an overwrite warning as same as the blender file save window: Is there a way to do ...
Trantor's user avatar
  • 13
0 votes
1 answer
45 views

code that works in blender 3.5 but not as expected in blender 4.1

premise The code below is intended to duplicate an object and change the vertex color of the duplicated object. Select the object called "ic" and run it. Ultimately, I want to change the ...
shimiken's user avatar
1 vote
1 answer
27 views

AttributeError: 'NoneType' object has no attribute 'modifiers'

So I've been trying to add Geo Nodes modifier to a created cube through custom UI panel, even though it works as intended, Blender shows me AttributeError. How can I fix this? (I'm new to coding so ...
Veeran's user avatar
  • 33
3 votes
1 answer
48 views

How to hide/unhide objects in a particular ViewLayer?

I am trying to hide/unhide objects in a particular ViewLayer but it's hiding in the current view layer only. ...
Karan's user avatar
  • 2,311
0 votes
0 answers
26 views

How can I prevent operator from blocking Blender Interactions during execution?

I'm new to Blender Python programming, and for a personal project, I'm experimenting with creating a Blender Python addon. I aim to execute an asynchronous GET request when I select a button in a ...
kernage's user avatar
1 vote
1 answer
40 views

Scene optimization on a material level?

How can I properly optimize a scene at a material level? For example. I have 2 different versions of the same rock texture in different resolutions, 1k for the background and 8k for the foreground. ...
elistuff's user avatar
0 votes
0 answers
27 views

How can I add a FloatVectorProperty to my addon layout? [duplicate]

How to properly register a FloatVectorProperty? When I do: box.prop(self, "amb_day_color") where ...
Oleg Kivasev's user avatar
1 vote
1 answer
58 views

How to select only deformation bones?

Is there a way to select all bones from the vertex group of the mesh? I have too many overlapping bones that are very tedious to work and some are non-deformer which I wanted to hide and only work ...
Wissam Seaifan's user avatar
1 vote
1 answer
33 views

Can Particle System caches be accessed directly by Geometry Nodes?

My goal is to instantiate objects on the points of a particle system. Right now, my workflow is: tweak the parameters of the particle system export it as an Alembic cache (point cloud?) import it ...
andycepi's user avatar
2 votes
2 answers
15 views

How to read and change value of edge crease in blender 4 via python script (MeshEdge.crease property has been removed)

as MeshEdge.crease property has been removed in blender 4, how can I check and change the value of an edge crease ? I used to do this to check edge crease value and set it to 1 if the value was over 0....
cscholl's user avatar
  • 183
-2 votes
0 answers
17 views

How can I give custom image texture for my cuboid in blender python?

I have created a cuboid using the below code. I have 6 images with me, I want to apply one of image to one of the face of the cuboid. ...
TARZAN SUDHAN's user avatar
2 votes
1 answer
24 views

Python: canvas-flip action is merged with the next user action in undo history

I wrote a simple add-on to enable canvas flipping in Blender (for Grease Pencil) with a hotkey, as well as a menu button. All it does is multiply the camera's local X scale by -1: ...
Latin1's user avatar
  • 23
0 votes
0 answers
22 views

Is it possible to make a script or GeoNod so that all the empties become children of the vertex where vertex and the same coordinates with empties?

Is it possible to make a script so that all the empties become children of the vertex where vertex and the same coordinates with empties? Its not Hook - need vertex are parenting for Empty. Whether ...
user avatar
0 votes
0 answers
6 views

Alternative to create non-object elements like gizoms

I want to create a dimension like in autocad. So there is the dimension object which is visible and two small points which only appear when I want to edit my dimension. How to create your little ...
André Ruf's user avatar
0 votes
0 answers
14 views

How to customize a cube-shaped gizmo

I'm interested in gizmos. I saw that it was possible to create a custom gizmo, as shown in the gizmo_custom_geometry.py template. I want to try making a cube shaped gizmo. However, this does not ...
André Ruf's user avatar
1 vote
1 answer
24 views

Is it possible to toggle Blender's built-in Boolean command state temporarily by pushing keyboard shortcut?

Is there any way to toggle blender's Boolean command state while pushing keyboard shortcut? I always enable weight paint tool's Restrict mode but sometimes I need to disable it. I would like to ...
Yokomizo's user avatar
  • 405
4 votes
1 answer
103 views

How can I expose Geometry Nodes properties in my addon panel?

I came across this question and learned that I can actually expose properties from the Blender UI in my addon panel. So I was experimenting on exposing properties of modifiers like for example the ...
Harry McKenzie's user avatar
3 votes
1 answer
78 views

How can I pass an object (like a bmesh) to an operator or should I not do that?

I have an operator that creates a certain mesh but I want to keep things modular so I separated each operation into its own operator. Like for example, I have an operator that removes vertices that ...
Megan Love's user avatar
0 votes
0 answers
12 views

How can I align the object's or 3d cursor X, Y and Z-axis to tracking together with face normal

...
Rabia Islam's user avatar
0 votes
0 answers
18 views

How to determine returned geometry component types by a node group using bpy?

Example: This node group returns a mesh, curve, point cloud, volume and an instance. Is it possible to determine which geometry components are returned by any node group, using python?
00004707's user avatar
1 vote
1 answer
27 views

ENUM_FLAG EnumProperty OverflowError when trying to use 1 << 31 as a flag value

I have an enum.Flag defined as so: ...
Jill Nesbit's user avatar
5 votes
3 answers
280 views

How can I select all edges that form part of a square without a face via python?

I have empty squares (those with exactly 4 edges only) in my 2D mesh and I need to fill them with faces via python but I don't know how to automatically select these edges. Is it possible to select ...
Megan Love's user avatar
0 votes
0 answers
16 views

How To Capture Mouse Movements During Blender Operations

I'm looking to capture mouse movements while using specific Blender operations, such as ...
Axel Olsson's user avatar
3 votes
2 answers
202 views

How can I remove a point of junction and reconnect 2 meshes via python?

I have a set of problematic meshes that have junction vertices (those with 4 edges). And I have to remove these via python and connect those vertices marked in green. Is this possible? Basically I ...
Megan Love's user avatar
0 votes
0 answers
17 views

Why is blender crashing with this code line: bpy.ops.gpencil.convert(type='CURVE', use_timing_data=context.scene.transfer_gp_timing_data_toggle)

I selected a grease pencil scribble that wasn't too complex, and the convert tab grease pencil to mesh works very fast on my computer. Blender crashes when executing this line: curve_obj = bpy.ops....
Stavros Piliaris's user avatar
0 votes
0 answers
53 views

Render liquid fluid simulation scene with low disk space

I have a fluid simulation with particles enabled Each frame of fluid simulation takes about 3 GB of disk space at a low domain resolution, with the majority caused by ...
xgjxcxzk's user avatar
  • 173
2 votes
2 answers
29 views

Some operators don't appear in operator search F3 despite being Registered and Developer Extras enabled

I found this thread and I already have Developer Extras enabled but I noticed that sometimes some operators don't show up in the F3 menu search despite ...
Megan Love's user avatar
2 votes
1 answer
34 views

Adding Smooth by Angle to an object with python

I want to add the "Smooth by Angle" modifier to a list of objects. So far I have figured out the modifier is a NODES modifier, aka Geometry Nodes, and that it uses a node_tree called "...
Radiant2024's user avatar
1 vote
2 answers
30 views

Use 3D view context in python console

Very often I only want to execute a line of code which can only be executed in the 3D view, for example this: ...
André Ruf's user avatar

1
2 3 4 5
129