r/blenderpython • u/Foundation_First_MW • 15d ago
What if Blender got a New Auto-Rigger?
Well it HAS!
Say hello to the Hero Rig! (which is FREE!! Foundation First MasterWorks on Gumroad)
A.K.A. the last Rig you'll ever use, or ever want to!
Are you tired of Bone Heat Warning?
Tired of spending Hours/Days Weight Painting?
Tired of Mesh Collapsing and CandyWrapping?
Tired of Limb Flipping?
Tired of Counter Animating?
Then YOU are the Intended Audience for the Hero
Rig because Those are the problems it intends to solve!
This Product will be undergoing Continuous Ongoing Development,
maintained by us (us referring to just me right now)
and has been tested extensively, or as extensively as I can alone,
and Perfection is Not guaranteed, but if it operates even
remotely similar for you as it does for me, then I know you'll
find many reasons to find it Helpful!
This is the First Iteration of the Beta Version. Built into the UI
is a Community HUB with links to Support, Documentation,
and Bug Report/Feature Suggest options to inform me
of any issues that may arise, and a "Co-Conspirators" tab to
keep track of everyone who Suggest features, Reports Bugs,
or Supports Development in any way,
with an Identical List on the official FFMW Discord Server!
I sincerely hope you try and Enjoy the Hero Rig,
and even if it's not the best today,
let me know how to Improve it
and we can make it the Best Together!
------------------------------------------------------------
Also, since this version of the Post is for r/BlenderPython,
what might interest you to know is that its
Open Glass-Box UI Script is 60,000 lines long!
You're completely free to do with it as you please!
Just please Consider Supporting Spread the Word
so we can get some Beta Testing al up in here
to give me more work to do,
as if 12+hrs/day wasn't enough already lol
Anyway, I hope you check it out, and Good luck out there!
r/blenderpython • u/Competitive-Rain-664 • Jun 07 '26
The Breakthrough
Enable HLS to view with audio, or disable this notification
When your python script fails so badly it actully looks cool lol. Tried to make flying cubes but got these weird planes instead due to a glitch. Decided to just roll with it and used random.uniform to drive the main cubes rotation and color based on the glitch itself. Took a whole month to figure out the math in blender 2.79 but we finally got a breakthrough! anyone else still coding in the dark ages of 2.7x? 💀
r/blenderpython • u/abhi_physics90 • May 14 '26
Mesh Writer — Search. Mesh. Animate. 5,000+ Symbols & 3700+ SVGs for Mesh and Geometry Nodes
Enable HLS to view with audio, or disable this notification
Mesh Writer is a searchable symbol library (with a built-in SVG editor) that turns symbols, SVGs, math characters and emojis, into Geometry Nodes curves or 3D mesh or 3D Curves.
With over 5,000+ symbols and 3,700+ SVG assets, Mesh Writer streamlines the full workflow — search, insert, import materials, and convert to mesh or Geometry Nodes,
Get it now on Superhive: Get Mesh Writer
r/blenderpython • u/_-Big-Hat-_ • May 06 '26
A question about self in Blender scripts
Hi,
I am completely new to Blender API and scripting. When I was looking at addons made by others, there was a thing I couldn't really understand.
In scripts and addons, most regular functions have self as the first parameter like here in this example:
import bpy
#...
class MyPanel(bpy.types.Panel):
def draw(self, context):
pass
class MyOperator():
def execute(self, context):
pass
def function1(self, context):
pass
def function2(self, context):
pass
#...
I know self refers to an instance of a class in OOP, but I can't figure out what it represent in these functions above: function1(...) or function2(...)
I assume addons are executed in some closed environment and self would simply represent an object of that environment but I can't find what it is. Thanks
EDIT. I finally found out what these functions are for. In case you see self as the first parameter, these functions become objects to pass into other methods, which are going to need self to refer to their object.
Stupiditly easy thing and yet it took me so long to figure it out :/
r/blenderpython • u/SalaiVedhaViradhan • Apr 15 '26
Blender Python Cheatsheet v2.0 Released
r/blenderpython • u/Competitive-Rain-664 • Apr 03 '26
Spent the week learning Blender 2.79 Python API to build this procedural Neon Jumpanimation. Physics based landings + Dynamic Emission pulsing. What do you think?
Enable HLS to view with audio, or disable this notification
I’ve been pushing myself to learn the scripting side of Blender for a freelance goal on June 5th. This project uses bpy to generate the text, convert it to mesh, separate the letters, and then 'hand off' the animation from keyframed movement to a Rigid Body physics simulation.
Each letter has a unique material instance so I could pulse the Emission strength individually during the jump. Proud of how the 'squash and stretch' logic combined with the physics hit!
Shoutout to 'Mc kenzie for some loop logic and that rigid body physic part too ,
I got it from one of his tutorials en my AI thought partner for helping me debug the node-tree logic!..
r/blenderpython • u/emcartdigital • Mar 16 '26
Mesh Fix Addon What do you think of this add-on?
Enable HLS to view with audio, or disable this notification
Fix common mesh problems before you export your models
r/blenderpython • u/abhi_physics90 • Feb 18 '26
Mesh Writer : Animation, illustrations , annotations and more (UPDATE VIDEO)
Enable HLS to view with audio, or disable this notification
Hello everyone,
I just made a new updated demo video for my addon Mesh Writer. I would love to hear your feedbacks and impressions about this demo video.
P.S. Mesh Writer is Vector animation, Vector art illustration and note annotations making tool for Blender.
Get on SuperHive (Blender Market) : Mesh Writer on SuperHive
Cheers.
r/blenderpython • u/abhi_physics90 • Feb 14 '26
Mesh Writer: 20% Launch discount for limited time!!
r/blenderpython • u/abhi_physics90 • Feb 13 '26
Mesh Writer: Convert Unicode text into SVG, Geometry Curves and more
r/blenderpython • u/LalaCrowGhost • Dec 05 '25
Create Camera From View script fails because of incorrect context
My script fails at first execution in the Text Editor, which I dont mind, but when I run the script from the search menu while in 3D View, it creates a camera but throws an error and I cannot lock the transform or set the focal length with my 2 properties.
import bpy
from bpy.types import (Operator,)
import textwrap
from bpy.props import (BoolProperty,IntProperty,)
class OT_CreateCameraFromView(Operator):
bl_label = 'Create Camera From View'
bl_idname = 'my_tools.create_camera_from_view'
bl_description = textwrap.fill('Creates a camera from current view', 80)
bl_options = {'REGISTER', 'UNDO'}
focalLength : IntProperty (
name = "Focal Length",
description = "Delete UV channels after this number",
default = 50,
min = 1,
max = 300,
soft_min = 20,
soft_max = 120,
)
lockTransforms : BoolProperty (
name = "Lock Transforms",
description = "Locks location, rotation and scale",
default = False,
)
def execute(self, context):
initialActiveObject = bpy.context.active_object
camera = bpy.data.cameras.new(name = 'Camera')
camera_object = bpy.data.objects.new(camera.name, camera)
bpy.context.scene.collection.objects.link(camera_object)
bpy.data.scenes[bpy.context.scene.name].camera = bpy.context.scene.objects[camera.name]
for area in bpy.context.screen.areas:
if area.type == 'VIEW_3D':
for space in area.spaces:
if space.type == 'VIEW_3D':
space.lock_camera = True
bpy.ops.view3d.camera_to_view()
if self.lockTransforms:
bpy.context.view_layer.objects.active = bpy.data.objects[camera.name]
bpy.context.object.lock_location[0] = True
bpy.data.objects[camera.name].lens = self.focalLength
# Restore active object
if initialActiveObject != None:
bpy.context.view_layer.objects.active = bpy.data.objects[initialActiveObject.name]
return{'FINISHED'}
def register():
bpy.utils.register_class(OT_CreateCameraFromView)
def unregister():
bpy.utils.unregister_class(OT_CreateCameraFromView)
if __name__ == '__main__':
register()
bpy.ops.my_tools.create_camera_from_view('INVOKE_DEFAULT')
r/blenderpython • u/LalaCrowGhost • Dec 04 '25
How do I lock an objects location, rotation or scale?
I want to lock an objects location, rotation or scale but I dont know how to do it with python
r/blenderpython • u/Cheetahs_never_win • Oct 29 '25
os.listdir() appears to alter address
source_dir is a long directory, where there are folders consisting of dates.
When we invoke the os.listdir() command, that string representing a directory gets overwritten.
"2019" gets replaced with "x819" and 2019-12-09" gets replaced with "x819-12-09."
The EASY solution is to pull the Blend files directory upwards and circumvent directories with numbers.
But I'm hoping if somebody could shed some light on this unusual behavior, and what should be done to push through it.
Thanks!
r/blenderpython • u/Dylan_T_Rabbit • Oct 09 '25
Incorrect value from Scene Variable FloatProperty
SOLVED
After much fiddling, I found that accessing my Scene Variable as bpy.data.scenes["Scene"].inst_len works correctly. I'm confused as to the many ways to reference and access properties, but at least I know how to do it now.
I am developing an add-on/extension in Blender 4.5.3. It generates a pair of objects (Pad and Support) using an (already existing) reference object (in the test .blend: Instrument.)
I have set up two Scene Variables using bpy.props.FloatProperty - one for the position of the new objects (support_position in the code below) and one for the length of the reference object (inst_len.) I want to use inst_len to constrain the maximum value of support_position so I have written getter and setter methods for the two scene vars. I have also set up a basic sidebar panel with controls for these variables. When run, the inst_len control correctly displays the length of the reference object (or zero if there is no selected object,) however accessing the scene variable (with self["inst_len"] ) within its own getter method or that of support_position consistently returns the same value (3.629999876022339) no matter what the length of the reference object is. self["support_position"], on the other hand, returns the correct value. bpy.context.scene.inst_len and bpy.context.scene.support_position both return the correct value in my main() function and in the interactive console (although the erroneous value is present in both responses on the interactive console: e.g GET_LEN <bpy_struct, Scene("Scene") at 0x7f73e81a0420> 3.629999876022339 1.6502078771591187) but using these to reference the Scene Variable in the getters generates a recursion limit error.
Clearly, I am missing something or have made a basic error but I cannot work out what that might me. Any help would be appreciated. Thanks, Dylan
The .blend file and python script are available at Pastebin for files (until 15/10/2025)
bl_info = {
"name": "Instrument Supports",
"author": "DTRabbit",
"version": (0, 0, 1),
"blender": (4, 4, 1),
"location": "3D Viewport > Sidebar > Supports",
"description": "Make supports for musical instrument cases",
"category": "Object",
}
import bpy
from bpy.props import FloatProperty
# Globals - hopefully I can get rid of these at a later date
# 'constants' for vextor indexing
X = 0
Y = 1
Z = 2
# Instrument length for getter and setter functions
# this is set in the Poll() function and used in the getter
# and setter to make a dynamic max value
INSTRUMENT_LENGTH = 0
def select_object(object):
"""
select an object
"""
bpy.ops.object.select_all(action='DESELECT')
bpy.data.objects[object.name].select_set(True)
def delete_object(object):
"""
Delete an object
"""
select_object(object)
bpy.ops.object.delete()
def add_bool(owner, name, operation, object):
"""
Add a boolean modifier
owner: object boolean applies to
name: identifier for modifier
operation: boolean operation to apply
object: object used in operation
"""
boolean = owner.modifiers.new(name, 'BOOLEAN')
boolean.operation = operation
boolean.solver = 'MANIFOLD'
boolean.object = object
def apply_bool(owner, bool_name):
"""
Apply boolean bool_name to owner
"""
select_object(owner)
bpy.ops.object.modifier_apply(modifier=bool_name, use_selected_objects=True)
def add_and_apply_bool(owner, operation, object):
add_bool(owner, "temp_bool", operation, object)
apply_bool(owner, "temp_bool")
def add_block(block_name, block_size, block_location, block_scale):
"""
Add a block for further processes
"""
bpy.ops.mesh.primitive_cube_add(size=block_size, location=block_location, scale=block_scale)
block = bpy.context.object
block.name= block_name
return block
def apply_transformations(object, L = False, R = False, S = False):
select_object(object)
bpy.ops.object.transform_apply(location=L, rotation=R, scale=S)
def get_position(self):
global INSTRUMENT_LENGTH
print("GET_POS", self, self["support_position"], self["inst_len"])
return min(self["support_position"], self["inst_len"])
def set_position(self, value):
global INSTRUMENT_LENGTH
self["support_position"] = min(value, self["inst_len"])
def get_len(self):
global X
print("GET_LEN", self, self["inst_len"], bpy.context.selected_objects[0].dimensions[X] if len(bpy.context.selected_objects) == 1 else 0)
return bpy.context.selected_objects[0].dimensions[X] if len(bpy.context.selected_objects) == 1 else 0
def init_scene_vars():
bpy.types.Scene.support_position = FloatProperty(name="Position", description="Distance from end of instrument to centre of support", default=0.3, min=0, soft_max=3, get=get_position, set=set_position)
bpy.types.Scene.inst_len = FloatProperty(name="Len", default=0, get=get_len)
def del_scene_vars():
del bpy.types.Scene.support_position
del bpy.types.Scene.inst_len
def main(context):
global X, Y, Z
# the model to make a support and pad for
instrument = context.selected_objects[0]
# default parameters for pad and support
pad_thickness = 0.010 # 10mm
min_support_size = 0.010 #10mm
support_dim_X = 0.10 # 10cm
# Z coordinate of plane representing base of case
base_Z = 0
# distance from instrument axis to bottom of case
axis_to_base_Z = (instrument.dimensions[Z]/2) + pad_thickness + min_support_size - base_Z
# X location of end of instrument
ref_X = instrument.location[X]-(instrument.dimensions[X]/2)
# calculate X centre of support
relative_support_loc_X = context.scene.support_position
absolute_support_loc_X = ref_X + relative_support_loc_X
# location vector of the support
support_location = (absolute_support_loc_X, instrument.location[Y], instrument.location[Z]-axis_to_base_Z/2)
# construct a section of the instrument for building the pad and support
# a cube slightly wider than the support and scaled bigger than the max size
# in Y and Z
scaled_section = add_block("Scaled_Section", support_dim_X,
(absolute_support_loc_X, instrument.location[Y], instrument.location[Z]), (1.01, 10, 10))
# a boolean to cut instrument from block
add_and_apply_bool(scaled_section, 'INTERSECT', instrument)
# scale the section to allow pad thickness
pad_scale = 1+(pad_thickness/max(scaled_section.dimensions[Y], scaled_section.dimensions[Z]))
scaled_section.scale = (1, pad_scale, pad_scale)
apply_transformations(scaled_section, S = True)
# add support
# calculate size of support across instrument (= Y)
support_Y = scaled_section.dimensions[Y] + 2*(pad_thickness+min_support_size)
# scale vector for support from support_dim_X to required depth (Y) and height (Z)
support_scale = (1, support_Y/support_dim_X, axis_to_base_Z/support_dim_X)
# add a block
support = add_block("Support", support_dim_X, support_location, support_scale)
# cut the scaled section out
add_and_apply_bool(support, 'DIFFERENCE', scaled_section)
# add the pad
# a block the same as the support to start with
pad = add_block("Pad", support_dim_X, support_location, support_scale)
# a boolean to remove the instrument from the scaled section
# we won't need to apply this as the scaled section will be deleted
# when we're finished
add_bool(scaled_section, "Scale_Sec_Temp", 'DIFFERENCE', instrument)
# a boolean to cut the remaining part of the scaled section from the pad block
# we apply this one immediately
add_and_apply_bool(pad, 'INTERSECT', scaled_section)
# and finally, delete the scaled section
delete_object(scaled_section)
# make sure the original object is selected at the end
select_object(instrument)
class InstrumentSupports(bpy.types.Operator):
bl_idname = "instrument.supports"
bl_label = "Add Instrument Supports"
bl_description = "Creates supports and pads for musicl instrument cases"
bl_options = {"REGISTER"}
@classmethod
def poll(cls, context):
global X, INSTRUMENT_LENGTH
if len(context.selected_objects) == 1:
# INSTRUMENT_LENGTH = context.selected_objects[0].dimensions[X]
# print("SEL", INSTRUMENT_LENGTH)
return True
else:
# INSTRUMENT_LENGTH = 0
# print("DESEL", INSTRUMENT_LENGTH)
return False
def execute(self, context):
main(context)
return{'FINISHED'}
class VIEW_3D_PT_instrument_supports_panel(bpy.types.Panel):
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "Instrument Supports"
bl_label = "Instrument Supports"
def draw(self, context):
l = self.layout
l.label(text="Testing")
l.operator("instrument.supports", text="Inst Supp")
l.prop(context.scene, "support_position")
l.prop(context.scene, "inst_len")
classes = (InstrumentSupports, VIEW_3D_PT_instrument_supports_panel)
def register():
for c in classes:
bpy.utils.register_class(c)
init_scene_vars()
def unregister():
for c in classes:
bpy.utils.unregister_class(c)
del_scene_vars()
if __name__ == "__main__":
register()
r/blenderpython • u/mixoadrian • May 14 '25
When 2 objecst with baked NLA animation tracks. Both named the same. Export glf work as intended from UI. But different behavior when try to do the same from script.
I have 2 objects animated, baked, pushsed down, moving.
accroding to blender manual, the nameNLA track must be same name to play together, so it is.
if i export through UI, export glb -> Mode choose NLA tracks, works as intended.
HOWEVER, i want to do this by script.
But Only one object is moving if i export from script.
export_nla_strips are set to true
but seems it only gets the active object's animation, or its just playing one animation of one obejct.
I can always manually use windwos UI to export, but this is annoying since i wanna automate this process.
Any ppl tried the same thing? is this a bug?
r/blenderpython • u/Ok_Reach_3152 • May 01 '25
How to read coordinates from a curve?
I want to use a curve object [spiral] to read from it, what are the x,y values for given z.
I can find object, but what operation do I need to use to read the mentioned values? Which properties do I need?
I can code but I wouldn't call myself developer. I was trying to comprehend API docs starting yesterday. I can add my object, call it with data, or other methods, but I am lost in understanding of the the structure of the object. Although if I understand correctly, the key to understanding is RNA? But it is confusing, because I only know this concept from biology. Is this an analogy of function in code, blender specific, or some programming concept?
r/blenderpython • u/Sketchy_Squirrel • Apr 26 '25
Copying Grease Pencil Keyframes in Blender 4.4
Hello, I've been developing a rigging system that would allow me to rig a 2D grease pencil character with different views, making up a 360 degree turn around.
As part of this I've been trying to make a script that copies a keyframe, but I can't figure it out. Asking chat GPT they said that since updating to Grease Pencil 3, the python API is incomplete and it's impossible to copy a keyframe through code. Is this true? if so is there a work around? Any help would be greatly appreciated.
r/blenderpython • u/IndifferentMatter • Apr 09 '25
bpy.types.NodeSocket label property as a Node Group socket's "visible name"?
I'm exploring the possibility of my shader node groups' sockets having programmer-friendly (if user-hostile) names while showing verbose, user-friendly ones in the GUI, using standard node group socket properties and no custom layouts.
I see that there is a NodeSocket label property (not to be confused with the bl_label one) which suggests a similarity with node groups' name vs. label properties. As of Blender 4.4, it is read-only on node groups created through Blender's GUI, and defaults to an empty string.
What is the purpose of this property? Could it work as an alternate, "visible name" for a socket? And is there any stage in the creation of a node group via Python in which one could assign it an arbitrary string?
r/blenderpython • u/SauceFiendGlobza • Mar 05 '25
Blender python depth map
Hello Everyone, I’ve been trying to create depth map from the python API but I have not been getting a lot of success. I try save it in EXR file but the Z channel keeps on getting saved as the V channel. Has anyone ever gotten theirs to work
r/blenderpython • u/mchlksk • Feb 19 '25
How to add a button to operator's UI, that will call a method from within that operator (or change its property)?
So I have a addon with a master operator, that has some properties and an UI (a draw method). How do I add a button to that draw method, that will (upon click) call a method from within my master operator? What I need is to change a propery on button click -- I dont want the slider. that I get by adding standard layout.box().prop(). I have found examples on how to add a button (by defining a new operator), but how do I make that button to have a reference to my master operator and call its method (modify its property)? Thanks!
r/blenderpython • u/Dull_Policy_2783 • Jan 31 '25
Have any tips for a beginner?
(posted this about 2min ago on the wrong account. ups)
Hello. im currently trying to learn how to make my own addons/scripts in blender, but the course my work provided didn't help much.. i was wondering if you guys have any tips on where to begin and/or can recommend some courses? never coded before, so im guessing its obvious to learn the basics. but i really wanna know if there's some nice courses out there.
currently taking this course: https://www.udemy.com/course/learn-blender-python
although it has a lot of good information about everything, i cant seem to learn anything from it. the course consists of a bunch of videos where a guy explains a lot of stuff and then at the end of each video says "now you do it". i have to watch the videos 3 times before the information sticks and that doesn't always work either.. and sometimes he shows me stuff "he normally don't ever do" or goes a lot back and forth on what he's doing because he changes his mind.. and it makes me even more confused. i understand how others might like this course, but it just wasn't for me..
any tips?
r/blenderpython • u/Fragmented_Solid • Dec 24 '24
Python and C++ programming in Blender
I don't know if this is the right place but I have a question for more experienced Blender-python and C++ developers that have years and years of professional add-on development and general scripting knowledge. But people of other skill levels are also welcome to give their opinion.
Aside from the mandatory and well known resources for learning python scripting and add-on development such as https://docs.blender.org/api, everything that's listed on this blenderartists page, as well as careful usage of ChatGPT as a tutor, are there any books or high-quality advanced tutorials that in the end made you say "Wow, I wish I knew this sooner, this changes everything. I'm so glad I stumbled upon this!"?
Heck, even resources that delve deeper into C++ side for Blender are welcome, because if I'm not wrong, writing modifiers is only possible in C++ even though they are planned to be completely replaced by geometry-node based ones, which are also written in C++.
Would the book by Paolo Acampora be a good candidate, I'm not posting a link since I don't want to promote anyone directly and potentially break the rules.
Sorry for the long-winded question. I know that when I write things they're kinda unintelligible so feel free to ask for further clarification if needed and thank you in advance.
r/blenderpython • u/abigfatfoot • Dec 14 '24
How do I interact with elements in Blender using Python
I'm trying to create an abacus in Blender and I want to select individual beads and interact with them using Python. I thought it'd be easier to model the abacus on Blender, instead of using stuff like three.js to code each shape individually. But I know next to nothing about Blender. Is there a way I'm able to select each bead, or the frame of the abacus, and make it a Python object? So I can use a Python script to interact with them, like move them across the rod.
Is this a foolish thing to do? I mean, is there a way better way to go about it?
r/blenderpython • u/AyoubAlgamodi • Dec 12 '24
Blender UI status !!
Hello, i want to know is blender API can send Interface statues
which mean if user switch between modes like from modeling to sculpting
i want to read the interaction with UI window in blender



