Source code for ddg.visualization.blender.scene

import bpy

import ddg.visualization.blender.collection as collection


[docs]def clear(scene=None, deep=False, remove_collections=False): """ Unlink all objects contained in a scene. Clears `scene.collection`. Parameters ---------- scene : bpy.types.Scene (default=None) Scene to clear. If the argument is not provided or `None`, `bpy.context.scene` will be set to scene. deep : bool (default=False) Delete the data corresponding to the objects. remove_collections : bool (default=False) Remove the collections (and its children) from the scene. """ if scene is None: scene = bpy.context.scene collection.clear( collections=[scene.collection], deep=deep, remove_collections=remove_collections )