Linked Questions
17 questions linked to/from Python: How to completely remove an object
11
votes
4
answers
20k
views
How to completely remove all loaded data from Blender?
I'm implementing a Blender Python script to do batch conversions.
It works like this:
for each model file found in a directory:
Import the model
Process it
Export in other format
The problem is, ...
9
votes
4
answers
11k
views
How to find number of animated frames in a scene via python?
I need to find the number of animated frames after importing a bvh file in blender. scene.frame_start and ...
15
votes
2
answers
3k
views
A comprehensive list of operator overrides
I feel like I'm always spending far too much time playing scripting whack-a-mole whenever I want to override an operator in one of my scripts.
I'd like to build a comprehensive one-stop-shop list for ...
4
votes
1
answer
21k
views
How to completely delete an object through python?
How to completely delete an object without using:
bpy.ops.object.delete()
bpy.ops methods are too slow for my script, so far I am able to delete an object with a ...
5
votes
1
answer
7k
views
How to prevent memory leakage in Blender?
I have to load lots of objects/meshes(50k) in Blender and render them for which I have written a Python script. My meshes have lots of vertices/faces (in the range of ~[10k, 70k]). I noticed that ...
3
votes
2
answers
3k
views
How to delete all objects/cameras/meshes/etc. using Python scripting?
I have a Blender Python script that uses a loop to sequentially load and render viewpoints of multiple OBJ files that I generally try to run from the command line. However, if I have Blender open, ...
1
vote
1
answer
3k
views
Export collection and set FBX file name as collection name?
How difficult is it to make a selection by collection and set the FBX file name as the collection name?
...
1
vote
1
answer
925
views
objects.delete doesn't remove completely
I have this part of code in my script:
...
4
votes
2
answers
2k
views
Blender consuming all memory
I have hundreds of thousands of models in a folder. In my script I have a loop which loads each model at a time as object in my scene then render an image of it then delete the object. After couple of ...
3
votes
1
answer
1k
views
Python Scripting: Remove Curve Object
Preferably not using selection, tried bpy.data.meshes.remove don't works for it
1
vote
1
answer
1k
views
Cannot find camera after deleting and appending a new one with python
I run a background script that:
deletes everything:
override = {'selected_bases': list(bpy.context.scene.object_bases)}
bpy.ops.object.delete(override)
...
2
votes
0
answers
1k
views
fully clear scene and cache from scene collections and their embeded components e.g. objects, meshes, materials etc
I have a script which I am loading mutliple .obj files of room models from the disk. Each .obj goes into sub-collections depending whether it is a room in the same house or not. In the beginning of ...
1
vote
1
answer
775
views
Script to intersect two objects gets rapidly slower
What I want
I have two sets of objects and want to intersect every object of one set with every object of the other set by means of the boolean modifier. The output can be reduced to the vertices of ...
1
vote
0
answers
694
views
Delete Children Automatically
Is there a way to automatically delete children when the parent is deleted? By automatically I mean that you don't do any selection (or other action) of the children prior to selecting and deleting ...
1
vote
1
answer
527
views
Deleting temporary mesh after extracting data
When extracting data via temporary mesh, like this:
mesh = object.to_mesh(bpy.context.scene, apply_modifiers=True, settings='RENDER')
Do I need to delete this ...