# ID(bpy_struct)

base class — `bpy_struct`

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

class `bpy.types.``ID`(bpy_struct)

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

  `is_library_indirect`

    Is this ID block linked indirectly

    Type: | boolean, default False, (readonly)

  `is_updated`

    Datablock is tagged for recalculation

    Type: | boolean, default False, (readonly)

  `is_updated_data`

    Datablock data is tagged for recalculation

    Type: | boolean, default False, (readonly)

  `library`

    Library file the data-block is linked from

    Type: | `Library`, (readonly)

  `name`

    Unique data-block ID name

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

  `preview`

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

    Type: | `ImagePreview`, (readonly)

  `tag`

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

    Type: | boolean, default False

  `use_fake_user`

    Save this data-block even if it has no users

    Type: | boolean, default False

  `users`

    Number of times this data-block is referenced

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

  `copy`()

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

    Returns: | New copy of the ID
    Return type: | `ID`

  `user_clear`()

    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 = bpy.data.objects["Cube"]

        # without this, removal would raise an error.
        obj.user_clear()

        # runs without an exception
        # but will crash on redraw.
        bpy.data.objects.remove(obj)

  `animation_data_create`()

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

    Returns: | New animation data or NULL
    Return type: | `AnimData`

  `animation_data_clear`()

    Clear animation on this this ID

  `update_tag`(refresh={})

    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

Inherited Properties

`bpy_struct.id_data` |

Inherited Functions

`bpy_struct.as_pointer` `bpy_struct.driver_add` `bpy_struct.driver_remove` `bpy_struct.get` `bpy_struct.is_property_hidden` `bpy_struct.is_property_readonly` `bpy_struct.is_property_set` `bpy_struct.items` | `bpy_struct.keyframe_delete` `bpy_struct.keyframe_insert` `bpy_struct.keys` `bpy_struct.path_from_id` `bpy_struct.path_resolve` `bpy_struct.property_unset` `bpy_struct.type_recast` `bpy_struct.values`

References

`bpy.context.gpencil_data_owner` `bpy.context.texture_user` `BlendDataObjects.new` `DopeSheet.source` `DriverTarget.id` `ID.copy` `Key.user` `KeyingSetPath.id` `KeyingSetPaths.add` `MaskParent.id` | `NodeTree.get_from_context` `NodeTree.get_from_context` `Object.data` `SpaceNodeEditor.id` `SpaceNodeEditor.id_from` `SpaceProperties.pin_id` `UILayout.template_path_builder` `UILayout.template_preview` `UILayout.template_preview`