Skip to main content

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
2 votes
1 answer
32 views

trying to duplicate bones in edit mode with python

I copied some code from a similar thread but it seems my implementation is not working. ...
victoriaisabellaamos's user avatar
0 votes
0 answers
23 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
1 vote
1 answer
21 views

Driver Scripted expression showing the wrong value

So I have a basic driver that is supposed to divide 360º between the number of copies on an array modifier (count). This way the empty in the middle, which is being used in the array modifier of the ...
Cornivius's user avatar
  • 1,886
2 votes
2 answers
34 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
1 vote
0 answers
14 views

How to make Blender open Visual Studio on __debugbreak() instead of crashing?

Usually when I execute in system some python code that's using compiled .pyd module with __debugbreak() c++ command it shows window suggesting to open Visual Studio: But when I run similar code in ...
FamousSnake's user avatar
2 votes
1 answer
66 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
0 answers
32 views

Python API for Drag and Drop Events?

I am trying to create an add-on for Blender that uses a drag and drop event, similar to the Drag and Drop from the Outliner, and various other areas of Blender, however, I have no clue where to find ...
Sonario648's user avatar
0 votes
0 answers
34 views

Creating a Particle System based off a Probability Distribution Function

I am working on a project that involves setting up a particle system whose density is dependent on the density from the origin. The project involves using a probability distribution function (PDF) to ...
Pixel Pirate's user avatar
0 votes
0 answers
59 views

Exporting object with bpy.ops.wm.obj_export()

I'm trying to export a set object with bpy.ops.wm.obj_export() regardless of which objects are selected in the viewport. I tried temporarily overriding the context, ...
Tsybe's user avatar
  • 491
1 vote
2 answers
44 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
0 votes
1 answer
30 views

Change the context.area.type in Headless mode

I've want to run a script Headless and need to set the bpy.context.area.type but it's confusing. Some sources suggest that setting ...
Deniz Böttcher's user avatar
0 votes
0 answers
35 views

Programmatically access the overall average RGB color from the material icon?

Is there a way to programmatically access the overall average RGB color from the material icon?
Ryan Schultz's user avatar
0 votes
0 answers
36 views

NodeTree missing input attribute

I am using the super image denoiser and when I click create SID, an error happens. Here is the code: ...
Bryan's user avatar
  • 11
1 vote
1 answer
15 views

Automating F-Curve changes in Blender/Python to Match Song

I have a visualizer in Blender that can visualize songs. While I can change the songs using a script, I'm struggling to adjust the visualizer's f-curves to match the dynamics of the new songs. This ...
Deniz Böttcher's user avatar
2 votes
1 answer
108 views

Adding a Keyframe to a Specific Geometry Node in Blender Using Python

I am new to both Python and Blender. I am trying to add or change a keyframe on a specific geometry node within Blender. I found a code snippet that demonstrates how to keyframe a general property ...
Deniz Böttcher's user avatar
0 votes
0 answers
10 views

Respect the current "quad" when using transform.translate

I have a modal operator that calls bpy.ops.transform.translate('INVOKE_DEFAULT') as part of its code. Having written code that adjusts the position of the mouse cursor (before transform.translate is ...
Candle's user avatar
  • 302
0 votes
0 answers
16 views

How to turn off the (auto)terminal output while rendering blender file in headless mode?

I'm using blender rendering with my own python script in headless mode. Some how when blender rendering in headless mode, it automatically print the rendering process it went through. The terminal ...
miaomiao's user avatar
0 votes
0 answers
18 views

Blender not booting after addon installation attempt

I tried installing this addon through its python script in Blender's text editor: https://github.com/ChicoEevee/Pokemon-Switch-V2-Model-Importer-Blender?tab=readme-ov-file#readme There wasn't any ...
RisingSerperior's user avatar
0 votes
0 answers
26 views

Get edges with subdivision modifier active?

I'm trying to get edges when subdivision modifier is active. Using depsgraph method gives the result as if the modifier had already been applied. ...
APEC's user avatar
  • 590
1 vote
1 answer
33 views

How can I select and remove excess loops from an edge outline using python?

How can I select these vertices in this weird loops encircled in red using python? In this example I only have 5 vertices excess but it's possible for more or lesser vertices to be junctioned like ...
Megan Love's user avatar
1 vote
1 answer
31 views

How to add initial values to the UI list

I have not been able to figure out how to add initial values to the UI list until now, but now I know the answer. I will note the code for the answer in the answer.
mml's user avatar
  • 642
0 votes
2 answers
34 views

How select key frames on the curve where the value < 0?

How select key frames on the curve where the value < 0?
user avatar
1 vote
0 answers
38 views

How to set parent (keep transform) in Relations on the Object panel?

I have an empty at the centre of all of these and I want to parent one of the smaller objects on the outside to it. I cannot click on the empty due to the number of overlapping objects on top of/...
HullBreaker's user avatar
0 votes
0 answers
88 views

Yaw Pitch Roll of camera in local coordinate system

I retrieved camera properties from a bunch of Unreal scenes that I want to reproduce in Blender. The Unreal coordinate system is quite different: it is a left-handed one, cameras face +X instead of -Z ...
David Pagnon's user avatar
1 vote
1 answer
73 views

UIList with checkmarks (one on all others off)

I have an UIList in which I display a PropertyGroup defined like this: ...
Steve's user avatar
  • 440
0 votes
1 answer
66 views

How to add geometry nodes using Python

Help please. I want to add geometry nodes using Python. I assume/guess the steps are Create a primitive bpy.ops.mesh.primitive_plane_add() Add a new geometry ...
Paul St George's user avatar
0 votes
0 answers
18 views

Can you use scripting to save the intensity of Light reaching a Face to a CSV file?

As depicted in the photo, I have placed a Light Object below and a Face above. The Face is divided into 16 sections as an example. In this setup, each of the 16 Faces receives a different light ...
Black Su's user avatar
1 vote
1 answer
127 views

Blender 4.1 AttributeError: 'ShaderNodeTree' object has no attribute 'output' [duplicate]

I am using Lucas Roedel's pixel art addon. (https://lucasroedel.gumroad.com/l/pixel_art) I am encountering a problem that says: AttributeError: 'ShaderNodeTree' object has no attribute 'output' Here ...
Bryan's user avatar
  • 11
0 votes
0 answers
18 views

I want to reset the position of the Group Output node of a Composite

Reset the position of the Group Output node of the material that has been moved to its initial position. Then calculate the difference between the current position and the reset position And then ...
InamuraJIN's user avatar
1 vote
0 answers
59 views

Script Help for overlapping edges between objects

I am working on a project that involves drawing grease pencil edges using the "mark freestyle edge" feature on edges that do not intersect with edges from other objects. I am using RBDLab to ...
FunnyKnowledge's user avatar
5 votes
1 answer
135 views

How can I do some sort of limited dissolve of useless vertices at the edges?

Is there a way to do some limited dissolve either through the built-in Blender tools or perhaps through scripting (if not possible through Blender tools) to remove these types of vertices? Or do I ...
Harry McKenzie's user avatar
0 votes
1 answer
142 views

How to apply a Texture to an Object with Blender Python?

I try to combine random 3D Models with random Textures. I know the results will probably will look sketchy but that is fine. But now to my problem: It seems like it doesn't work applying a texture to ...
xXAI-botXx's user avatar
0 votes
0 answers
19 views

Handle save unsaved changes user choice

I need to handle result of standard "Save unsaved changes" dialog (I want to send some signalr messages on "Yes" and on "Cancel" dialog results). How can i do it in ...
 THE KONDRAT 's user avatar
0 votes
0 answers
42 views

Add icons (properties/operators) to Blender's Outline?

I'm trying and wondering if its possible to add new icons (to trigger properies or operators) in the Blender's Outline showing all the objects in the scene. I mean adding new properties/operators in ...
Ommadawn's user avatar
  • 648
0 votes
0 answers
18 views

How to Accurately Retrieve Camera's Linear and Angular Velocity per Frame in Blender?

Hello Blender community, I am a complete beginner with Blender, working on generating synthetic data for a computer vision project that requires the linear and angular velocities of a camera for each ...
Arunbhaarathi's user avatar
0 votes
0 answers
34 views

Force Viewport Visibility to Respect Render Visibility

I use the viewport render to do all my look dev, and lighting, so I make things enabled or disabled based on what I need for that render layer/scene. But of course when I go to actually render the ...
timdan's user avatar
  • 23
0 votes
1 answer
52 views

Variable length list in Preferences (displayed as UI List with a selection checkmark)

I would like to have a list in the preferences of my Add-On where the content of the list is read from a file. (And therefore the length of the list is not known.) In this list I would like to have a ...
Steve's user avatar
  • 440
0 votes
1 answer
52 views

Is it possible to get the velocity of raycasted points?

Ok, so to all the Python Blender wizards out there, I need help. I want to create a LiDAR simulator in Blender. I already have the basics working great (basic point cloud generation, noise, variable ...
Hugo Delasnerie's user avatar
2 votes
1 answer
59 views

(Addon) check if exists an update for an addon?

I'm trying to implement a system that notifies the users when an update for my addon is available. In this case my addon is uploaded to gumroad. My thoughts about approaching this was: I thought about ...
Ommadawn's user avatar
  • 648
0 votes
0 answers
34 views

blender crash randomly on animation with link/unlink script

I have a simple script that spawn and delete object from a collection every X number of seconds, triggered on frame_change_pre/frame_change_post registered handler. ...
diramazioni's user avatar
1 vote
2 answers
1k views

AttributeError: 'Mesh' object has no attribute 'use_auto_smooth'

When I attempt to import an image as a decal, I get this Python error: AttributeError: 'Mesh' object has no attribute 'use_auto_smooth' Traceback (most recent call last): File "C:\Users<...
WilburPost's user avatar
  • 1,077
1 vote
0 answers
27 views

Why does a script that runs on a Blender primitive cube not run for an imported stl file of a cube?

I was trying to recreate batFINGER's answer to this question How to get data and edit it on UV map edges? The code looks like this: ...
Ciara's user avatar
  • 11
1 vote
2 answers
47 views

How do I customize the draw_item method in UI List

I created a ui list in which each item in the list has 3 properties--name, type, and number. In the list in my panel, I would like to have the type and number, but not the name. Here is my Python ...
SJK's user avatar
  • 181
0 votes
1 answer
21 views

How to determine the "Type" of an fcurve?

The official blender documentation for the type "FCurve" includes this: driver Channel Driver (only set for Driver F-Curves) However, it does not ...
user1071914's user avatar
0 votes
0 answers
81 views

Creating a Custom Node for Materials through Python

I'm trying to create a custom material node in blender using python. For instance, in the example below (which I found here and modified a bit): The node is supposed to take two colors multiply them ...
O. Shehab's user avatar
0 votes
0 answers
12 views

passing a custom camera view to gpencil mesh convert

I am trying to learn how to use the Python API for Blender, and have been wanting to see if I can make some kind of gpencil to mesh convert tool to see if i can make it do consistent conversions ...
user3696118's user avatar
0 votes
1 answer
80 views

panel_prop Boolean Property from property group resets automatically to default value without throwing errors

the goal was to simply have a bool value to change whether or not to show a custom panel with additional settings or no, it is modifier specific the first thought was simply register it on ...
user avatar
0 votes
1 answer
43 views

How to override context area using script when running Blender using Command Line

I use this command for running (open) Blender blender --factory-startup --python path_to_script script.py In script.py i tried ...
CheatPekalongan's user avatar
0 votes
1 answer
66 views

How to use Blender's internal Python version/libraries with PYTHONPATH env in use

I am using a system environment variable PYTHONPATH to use some Python libraries in Houdini. However, this seems to conflict with Blender. For example, I have ...
acc3d's user avatar
  • 3
0 votes
0 answers
24 views

When combining obj files, one of them gets weirdly distorted

I am trying to convert two obj files: a generic head without a face and a rudimentary face. When I display the face by itself (in its own file), its fine. Same for head. But when I combined the 2, the ...
Sammy Medawar's user avatar

1
3 4
5
6 7
266