ddg.visualization.blender.collection module

Collection of functions to manage blender collections

ddg.visualization.blender.collection.collection(name, parent=None, children=None)[source]

Creates a new collection or uses an existing one if a collection with given name exists. If the collection already exists the remaining parameters are ignored.

Parameters:
namestr

.name of the collection.

parentbpy.types.Collection (default=None)

Parent collection to link newly generated collection to. If None, collections get linked to bpy.context.scene.collection.

children: list of str or lists (default=None)

.name of children that will be generated when generating a new collection. If an entry is a list, the first string will be the child’s .name and the others the child’s children’s .names.

Returns:
bpy.types.Collection

Reference to the created Blender collection.

ddg.visualization.blender.collection.clear(collections=None, deep=False, remove_collections=False)[source]

Unlink all the objects contained in the given collection.

Parameters:
collectionsIterable of bpy.types.Collection (default=None)

Collection(s) to clear. If the argument is not provided or None, bpy.context.scene will be used.

deepbool (default=False)

Delete the data corresponding to the objects.

remove_collectionsbool (default=False)

Deletes the given collections and children. If bpy.context.scene.collection was given it deletes all children of this collection (bpy.context.scene.collection can’t be removed).