base class — bpy_struct

subclasses — Action, Armature, Brush, CacheFile, Camera, Collection, Curve, FreestyleLineStyle, GreasePencil, Image, Key, Lattice, Library, Light, LightProbe, Mask, Material, Mesh, MetaBall, MovieClip, NodeTree, Object, PaintCurve, Palette, ParticleSettings, Scene, Screen, Sound, Speaker, Text, Texture, VectorFont, WindowManager, WorkSpace, World

class bpy.types.ID(bpy_struct)

Base type for data-blocks, defining a unique name, linking from other libraries and garbage collection


Whether this ID is runtime-only, evaluated data-block, or actual data from .blend file

Type:boolean, default False, (readonly)

Is this ID block linked indirectly

Type:boolean, default False, (readonly)

Library file the data-block is linked from

Type:Library, (readonly)

Unique data-block ID name

Type:string, default “”, (never None)

Unique data-block ID name, including library one is any

Type:string, default “”, (readonly, never None)

Actual data-block from .blend file (Main database) that generated that evaluated one

Type:ID, (readonly)

Library override data

Type:IDOverrideLibrary, (readonly)

Preview image and icon of this data-block (None if not supported for this type of data)

Type:ImagePreview, (readonly)

Tools can use this to tag data for their own purposes (initial state is undefined)

Type:boolean, default False

Save this data-block even if it has no users

Type:boolean, default False

Number of times this data-block is referenced

Type:int in [0, inf], default 0, (readonly)

Get corresponding evaluated ID from the given dependency graph

Parameters:depsgraph (Depsgraph, (never None)) – Dependency graph to perform lookup in
Returns:New copy of the ID
Return type:ID

Create a copy of this data-block (not supported for all data-blocks)

Returns:New copy of the ID
Return type:ID

Create an overridden local copy of this linked data-block (not supported for all data-blocks)

Parameters:remap_local_usages (boolean, (optional)) – Whether local usages of the linked ID should be remapped to the new library override of it
Returns:New overridden local copy of the ID
Return type:ID

Clear the user count of a data-block so its not saved, on reload the data will be removed

This function is for advanced use only, misuse can crash blender since the user count is used to prevent data being removed when it is used.

# This example shows what _not_ to do, and will crash blender.
import bpy

# object which is in the scene.
obj =["Cube"]

# without this, removal would raise an error.

# runs without an exception
# but will crash on redraw.

Replace all usage in the .blend file of this ID by new given one

Parameters:new_id (ID, (never None)) – New ID to use

Make this datablock local, return local one (may be a copy of the original, in case it is also indirectly used)

Parameters:clear_proxy (boolean, (optional)) – Whether to clear proxies (the default behavior, note that if object has to be duplicated to be made local, proxies are always cleared)
Returns:This ID, or the new ID if it was copied
Return type:ID

Count the number of times that ID uses/references given one

Parameters:id (ID, (never None)) – ID to count usages
Returns:Number of usages/references of given id by current data-block
Return type:int in [0, inf]

Create animation data to this ID, note that not all ID types support this

Returns:New animation data or NULL
Return type:AnimData

Clear animation on this this ID


Tag the ID to update its display data, e.g. when calling bpy.types.Scene.update

Parameters:refresh (enum set in {'OBJECT', 'DATA', 'TIME'}, (optional)) – Type of updates to perform
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

Inherited Properties

Inherited Functions