BlendData(bpy_struct)#
base class — bpy_struct
- class bpy.types.BlendData(bpy_struct)#
Main data structure representing a .blend file and all its data-blocks
- actions#
Action data-blocks
- Type:
BlendDataActions
bpy_prop_collection
ofAction
, (readonly)
- armatures#
Armature data-blocks
- Type:
BlendDataArmatures
bpy_prop_collection
ofArmature
, (readonly)
- brushes#
Brush data-blocks
- Type:
BlendDataBrushes
bpy_prop_collection
ofBrush
, (readonly)
- cache_files#
Cache Files data-blocks
- Type:
BlendDataCacheFiles
bpy_prop_collection
ofCacheFile
, (readonly)
- cameras#
Camera data-blocks
- Type:
BlendDataCameras
bpy_prop_collection
ofCamera
, (readonly)
- collections#
Collection data-blocks
- Type:
BlendDataCollections
bpy_prop_collection
ofCollection
, (readonly)
- curves#
Curve data-blocks
- Type:
BlendDataCurves
bpy_prop_collection
ofCurve
, (readonly)
- filepath#
Path to the .blend file
- Type:
string, default “”, (readonly, never None)
- fonts#
Vector font data-blocks
- Type:
BlendDataFonts
bpy_prop_collection
ofVectorFont
, (readonly)
- grease_pencils#
Annotation data-blocks (legacy Grease Pencil)
- Type:
BlendDataGreasePencils
bpy_prop_collection
ofGreasePencil
, (readonly)
- grease_pencils_v3#
Grease Pencil data-blocks
- Type:
BlendDataGreasePencilsV3
bpy_prop_collection
ofGreasePencilv3
, (readonly)
- hair_curves#
Hair curve data-blocks
- Type:
BlendDataHairCurves
bpy_prop_collection
ofCurves
, (readonly)
- images#
Image data-blocks
- Type:
BlendDataImages
bpy_prop_collection
ofImage
, (readonly)
- is_dirty#
Have recent edits been saved to disk
- Type:
boolean, default False, (readonly)
- is_saved#
Has the current session been saved to disk as a .blend file
- Type:
boolean, default False, (readonly)
- lattices#
Lattice data-blocks
- Type:
BlendDataLattices
bpy_prop_collection
ofLattice
, (readonly)
- libraries#
Library data-blocks
- Type:
BlendDataLibraries
bpy_prop_collection
ofLibrary
, (readonly)
- lightprobes#
Light Probe data-blocks
- Type:
BlendDataProbes
bpy_prop_collection
ofLightProbe
, (readonly)
- lights#
Light data-blocks
- Type:
BlendDataLights
bpy_prop_collection
ofLight
, (readonly)
- linestyles#
Line Style data-blocks
- Type:
BlendDataLineStyles
bpy_prop_collection
ofFreestyleLineStyle
, (readonly)
- masks#
Masks data-blocks
- Type:
BlendDataMasks
bpy_prop_collection
ofMask
, (readonly)
- materials#
Material data-blocks
- Type:
BlendDataMaterials
bpy_prop_collection
ofMaterial
, (readonly)
- meshes#
Mesh data-blocks
- Type:
BlendDataMeshes
bpy_prop_collection
ofMesh
, (readonly)
- metaballs#
Metaball data-blocks
- Type:
BlendDataMetaBalls
bpy_prop_collection
ofMetaBall
, (readonly)
- movieclips#
Movie Clip data-blocks
- Type:
BlendDataMovieClips
bpy_prop_collection
ofMovieClip
, (readonly)
- node_groups#
Node group data-blocks
- Type:
BlendDataNodeTrees
bpy_prop_collection
ofNodeTree
, (readonly)
- objects#
Object data-blocks
- Type:
BlendDataObjects
bpy_prop_collection
ofObject
, (readonly)
- paint_curves#
Paint Curves data-blocks
- Type:
BlendDataPaintCurves
bpy_prop_collection
ofPaintCurve
, (readonly)
- palettes#
Palette data-blocks
- Type:
BlendDataPalettes
bpy_prop_collection
ofPalette
, (readonly)
- particles#
Particle data-blocks
- Type:
BlendDataParticles
bpy_prop_collection
ofParticleSettings
, (readonly)
- pointclouds#
Point cloud data-blocks
- Type:
BlendDataPointClouds
bpy_prop_collection
ofPointCloud
, (readonly)
- scenes#
Scene data-blocks
- Type:
BlendDataScenes
bpy_prop_collection
ofScene
, (readonly)
- screens#
Screen data-blocks
- Type:
BlendDataScreens
bpy_prop_collection
ofScreen
, (readonly)
- shape_keys#
Shape Key data-blocks
- Type:
bpy_prop_collection
ofKey
, (readonly)
- sounds#
Sound data-blocks
- Type:
BlendDataSounds
bpy_prop_collection
ofSound
, (readonly)
- speakers#
Speaker data-blocks
- Type:
BlendDataSpeakers
bpy_prop_collection
ofSpeaker
, (readonly)
- texts#
Text data-blocks
- Type:
BlendDataTexts
bpy_prop_collection
ofText
, (readonly)
- textures#
Texture data-blocks
- Type:
BlendDataTextures
bpy_prop_collection
ofTexture
, (readonly)
- use_autopack#
Automatically pack all external data into .blend file
- Type:
boolean, default False
- version#
File format version the .blend file was saved with
- Type:
int array of 3 items in [0, inf], default (0, 0, 0), (readonly)
- volumes#
Volume data-blocks
- Type:
BlendDataVolumes
bpy_prop_collection
ofVolume
, (readonly)
- window_managers#
Window manager data-blocks
- Type:
BlendDataWindowManagers
bpy_prop_collection
ofWindowManager
, (readonly)
- workspaces#
Workspace data-blocks
- Type:
BlendDataWorkSpaces
bpy_prop_collection
ofWorkSpace
, (readonly)
- worlds#
World data-blocks
- Type:
BlendDataWorlds
bpy_prop_collection
ofWorld
, (readonly)
- batch_remove(ids)#
Remove (delete) several IDs at once.
WARNING: Considered experimental feature currently.
Note that this function is quicker than individual calls to
remove()
(frombpy.types.BlendData
ID collections), but less safe/versatile (it can break Blender, e.g. by removing all scenes…).- Parameters:
ids – Iterables of IDs (types can be mixed).
- classmethod bl_rna_get_subclass(id, default=None)#
- Parameters:
id (string) – The RNA type identifier.
- Returns:
The RNA type or default when not found.
- Return type:
bpy.types.Struct
subclass
- classmethod bl_rna_get_subclass_py(id, default=None)#
- Parameters:
id (string) – The RNA type identifier.
- Returns:
The class or default when not found.
- Return type:
type
- orphans_purge()#
Remove (delete) all IDs with no user.
- Parameters:
do_local_ids (bool, optional) – Include unused local IDs in the deletion, defaults to True
do_linked_ids (bool, optional) – Include unused linked IDs in the deletion, defaults to True
do_recursive (bool, optional) – Recursively check for unused IDs, ensuring no orphaned one remain after a single run of that function, defaults to False
- Returns:
The number of deleted IDs.
- temp_data(filepath=None)#
A context manager that temporarily creates blender file data.
- Parameters:
filepath (str, bytes or NoneType) – The file path for the newly temporary data. When None, the path of the currently open file is used.
- Returns:
Blend file data which is freed once the context exists.
- Return type:
- user_map(subset, key_types, value_types)#
Returns a mapping of all ID data-blocks in current
bpy.data
to a set of all datablocks using them.For list of valid set members for key_types & value_types, see:
bpy.types.KeyingSetPath.id_type
.- Parameters:
subset (sequence) – When passed, only these data-blocks and their users will be included as keys/values in the map.
key_types (set of strings) – Filter the keys mapped by ID types.
value_types (set of strings) – Filter the values in the set by ID types.
- Returns:
dictionary of
bpy.types.ID
instances, with sets of ID’s as their values.- Return type:
dict