User
Write something
Coffee Hangout is happening in 16 hours
Part 2 section 3 Quiz and Exercise...on the BaseMesh Class
Hi all, in Part 2 section 3 Quiz and Exercise...on the BaseMesh Class...the add_wireframe_mod() method is reading the wireframe_name attribute, but it always seems to be "None". I added a bunch of print statements to see what was getting passed and everytime it is "None". Even if the mesh already has multiple wireframe modifier on it. BaseMesh class seems to be overwriting the name...so it keeps adding wireframes.
Struggles in duplicating an object with a Follow Path constraint
In my short film about fungi, I need lots of spores randomly floating around the scene. So I made one original spore with a Follow Path constraint targeting a Bezier curve. This would allow it to be animated using the Offset Factor in the constraint panel. I thought I’d then make copies by writing a script to duplicate the original spore. Not so easy! It took forever to get it right. One each try, the spore copy was displaced somewhere on the screen and not lined up at the start of the curve copy as it should be. This is what I had to do (also documented in the script file): Steps: 1. Select the spore and flight path for duplication 2. Duplicate the spore and flight path objects 3. Disable the Follow Path constraint 4. Centre copied spores at world origin (0, 0, 0) 5. Move the duplicates to a new location 6. Enable the Follow Path constraint on the copied spore I’ve attached the blend file and the python script. The spores are now ready for animation. Next step - maybe I’ll try to animate using a script. I’m using Blender 4.5.
Struggles in duplicating an object with a Follow Path constraint
cleanup before running experimental code / after errors
Hi, the last time I got time (years ago) for blender & python blender often crashed, until I started to use cleanup functions at the beginning of every code. Today I updated the functions. Blender still sometimes crashes - but in the most cases the problem is "me" and not blender ... Any suggestions? I try to make alle my code pep 8 (pretty new to me) conform because I have an absolute naming-chaos in my hoarded function .... Yes - I know "_obj" e.g. in the function "remove_all_objects()" is not pep 8 conform - but it's a kind of personal "flavor" I like. If I see _obj, I know without doubt that it is something not from die def of the function. def remove_all_objects(): print("--- Removing all objects ---") for _obj in list(bpy.data.objects): bpy.data.objects.remove(_obj, do_unlink=True)
Replaces an expression in all Blender Text data-blocks
Hi, I just created (with a lot of help from Gemini!) a function to replace an expression in multiple text blocks. Seems to work - quite well. I often change something in a function because I am constantly learning new and better ways to do something in Python. Maybe you find the function useful too - or have suggestions for improvements? replace_text_with_exclusion( search_string = "export_object_as_stl", replace_string = "export_obj_as_stl", exclude_names = ["this_text_block", "do_not_touch_either"])
2
0
Question on organization blender python scripts
I am updating my script for Blender 5.0, my biggest script is an exporter script that does a lot of types of files video, adds caption, takes popular armature, copies animation onto them and exports. At 867, the code essentially repeats itself, import unreal engine mannequin manny, then quinn, then ready player me. My question is what can do to make this easier to maintain? Can I save the parts to scripts, and then have a blender run that
1-24 of 24
CG Python Academy (Free)
skool.com/cgpython
3D artists learning Blender Python.
Leaderboard (30-day)
Powered by