Class used as baseclass for all content that can be saved to the library.

It mainly contains common methods for saving Blender content to .blend files in an optimized way.

Methods
save_objects_optimized()Saves the passed objects as a new blend file.
remove_number_suffix()strRemove the number suffix from the passed name (i.e. Box.004 becomes Box).
save_to_library()—

Methods

SavableContent.save_objects_optimized(context: bpy.types.Context, objs: Iterable[bpy.types.Object], folder: str, filename: str, clear_sk: bool = True, clear_materials: bool = True, clear_vg: bool = True, clear_ps: bool = True, run_in_background: bool = True, clear_drivers: bool = True)static method

source

Saves the passed objects as a new blend file.

opening the file in the background to make it as small as possible

ParameterTypeDescription
contextbpy.types.ContextBlender context.
objsIterable[bpy.types.Object]List of objects to save
folderstrFolder to save the file in
filenamestrName to save the file as
clear_skbool
default True
Remove all shapekeys from objs. Defaults to True.
clear_materialsbool
default True
Remove all materials from objs. Defaults to True.
clear_vgbool
default True
Remove all vertex groups from objs. Defaults to True.
clear_psbool
default True
Remove all particle systems from objs. Defaults to True.
run_in_backgroundbool
default True
Open the new subprocess in the background. Defaults to True.
clear_driversbool
default True
Remove all drivers from objs. Defaults to True.

SavableContent.remove_number_suffix(name: str) → strstatic method

source

Remove the number suffix from the passed name (i.e. Box.004 becomes Box).

ParameterTypeDescription
namestrname to remove suffix from

Returns str — name without suffix

SavableContent.save_to_library()

source

No description yet.