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)
2
10 comments
Kai Konnarth
3
cleanup before running experimental code / after errors
CG Python Academy (Free)
skool.com/cgpython
3D artists learning Blender Python.
Leaderboard (30-day)
Powered by