SavableContent
human/common_baseclasses/savable_content.pyClass 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() | str | Remove 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
sourceSaves the passed objects as a new blend file.
opening the file in the background to make it as small as possible
| Parameter | Type | Description |
|---|---|---|
| context | bpy.types.Context | Blender context. |
| objs | Iterable[bpy.types.Object] | List of objects to save |
| folder | str | Folder to save the file in |
| filename | str | Name to save the file as |
| clear_sk | bool default True | Remove all shapekeys from objs. Defaults to True. |
| clear_materials | bool default True | Remove all materials from objs. Defaults to True. |
| clear_vg | bool default True | Remove all vertex groups from objs. Defaults to True. |
| clear_ps | bool default True | Remove all particle systems from objs. Defaults to True. |
| run_in_background | bool default True | Open the new subprocess in the background. Defaults to True. |
| clear_drivers | bool default True | Remove all drivers from objs. Defaults to True. |
SavableContent.remove_number_suffix(name: str) → strstatic method
sourceRemove the number suffix from the passed name (i.e. Box.004 becomes Box).
| Parameter | Type | Description |
|---|---|---|
| name | str | name to remove suffix from |
Returns str — name without suffix
SavableContent.save_to_library()
sourceNo description yet.