Blocs de données (Data-Blocks)

The base unit for any Blender project is the data-block. Examples of data-blocks include: meshes, objects, materials, textures, node trees, scenes, texts, brushes, and even Workspaces.

../_images/files_data-blocks_outliner-blender-file-view.png

Blender File view of the Outliner.

A data-block is a generic abstraction of very different kinds of data, which features a common set of basic features, properties and behaviors.

Quelques caractéristiques communes :

  • Ils sont les contenus primaires du fichier blend.
  • They can reference to each other, for reuse and instancing. (Child/parent, object/object-data, materials/images, in modifiers or constraints too…)
  • Their names are unique within a blend-file, for a given type.
  • Ils peuvent être ajoutés/supprimés/édités/dupliqués.
  • Ils peuvent être liés entre fichiers (seulement valable pour un ensemble limité de blocs de données).
  • Ils peuvent avoir leur propres données d’animation.
  • They can have Custom Properties.

User will typically interact with the higher level data types (objects, meshes, etc.). When doing more complex projects, managing data-blocks becomes more important, especially when inter-linking blend-files. The main editor for that is the Outliner.

Not every data in Blender is a data-block, bones, sequence strips or vertex groups e.g. are not, they belong to armature, scene and mesh types respectively.

Life Time

Every data-block has its usage counted (reference count), when there is more than one, you can see the number of current users of a data-block to the right of its name in the UI.

Blender follows the general rule that unused data is eventually removed.

Puisqu’il est habituel d’ajouter et de supprimer un grand nombre de données pendant le travail, ceci a l’avantage à ne pas avoir à gérer manuellement chaque bloc de données.

Ceci fonctionne en ignorant les blocs de données sans utilisateur pendant l’écriture des fichiers blend.

Protected

Puisque les blocs de données sans utilisateur ne sont pas enregistrés, il y a des fois où vous souhaitez forcer la sauvegarde des données sans tenir compte de ses utilisateurs.

Si vous construisez un fichier blend pour servir de base à une bibliothèque de choses que vous avez l’intention de lier à et depuis d’autres fichiers, vous devrez vous assurer qu’ils ne seront pas accidentellement supprimés du fichier bibliothèque.

To protect a data-block, use the button with the shield icon next to its name. The data-block will then never be silently deleted by Blender, but you can still do it manually if needed.

Sharing

Data-blocks can be shared among other data-blocks.

Exemples dans lesquels le partage de données est habituel :

  • Partage de textures entre matériaux.
  • Partage de maillages entre objets (instances).
  • Partage d’actions d’animation entre objets, par exemple pour faire baisser toutes les lumières ensemble.

Vous pouvez aussi partager les blocs de données entre fichiers, voir :

Making Single User

When a data-block is shared between several users, you can make a copy of it for a given user. To do so, click on the user-count button to the right of its name. This will duplicate that data-block and assign the newly created copy to that usage only.

Note

Objects have a set of more advanced actions to become single-user, see their documentation.

Suppression de bloc de données

As covered in Life Time, data-blocks are typically removed when they are no longer used.

They can also be manually unlinked or deleted.

Unlinking a data-block means that its user won’t use it anymore. This can be achieved by clicking on the « X » icon next to a data-block’s name.

If you unlink a data-block from all of its users, it will eventually be deleted by Blender as described above (unless it is a protected one).

Deleting a data-block directly erases it from the blend-file, automatically unlinking it from all of its users. This can be achieved by Shift-LMB on the « X » icon next to its name.

Avertissement

Deleting some data-blocks can lead to deletion of some of its users, which would become invalid without it. The main example is that object-data deletion (like mesh, curve, camera…) will also delete all objects using it.

Those two operations are also available in the context menu when RMB-clicking on a data-block in the Outliner.

Types de blocs de données

../_images/files_data-blocks_id-types.png

Types de bloc de données avec leur icône.

Pour référence, voici une table de types de bloc de données enregistrés dans les fichiers blend.

Link:Library Linking, prend en charge le lien dans d’autres fichiers blend.
Pack:File Packing, prend en charge le contenu de fichier emballé dans le fichier blend (non applicable pour la plupart des blocs de données qui n’ont pas de référence).
Type Link Pack Description
Action
Stores animation F-curves.
Utilisé comme donnée d’animation de bloc de données,
and the Nonlinear Animation editor.
Armature
Skeleton utilisé pour déformer les maillages.
Used as data of armature objects, and by the Armature Modifier.
Brush
Utilisé par les outils de peinture.
Camera
Used as data by camera objects.
Cache File
Used by Mesh Cache modifiers.
Curve
Used as data by curve, font & surface objects.
Font
Fait référence aux fichiers de fontes.
Used by curve object-data of text objects.
Grease Pencil
2D/3D sketch data used by Grease Pencil objects.
Used as overlay helper info, by the
les éditeurs vue 3D, Image, Séquenceur et Movie Clip.
Collection
Group and organize objects in scenes.
Used to instance objects, and in library linking.
Image
Fichiers image
Used by shader nodes and textures.
Keys (Shape Keys)
Enregistrement de forme de géométrie, qui peut être animée.
Utilisés par les objets mesh, curve, et lattice.
Light
Used as object data by light objects.
Library
References to an external blend-file.
Access from the Outliner’s Blender File view.
Line Style
Used by the Freestyle renderer.
Lattice
Grid based lattice deformation.
Used as data of lattice objects, and by the Lattice Modifier.
Mask
Courbes de masque 2D d’animation.
Utilisé par les nodes compositing et le Séquenceur.
Material
Définir les propriétés de rendu d’ombrage et de texturing.
Utilisé par les objets, maillages et courbes.
Metaball
Une isosurface dans l’espace 3D.
Used as data of metaball objects.
Mesh
Geometry made of vertices/edges/faces.
Used as data of mesh objects.
Movie Clip
Référence à une séquence d’images ou un fichier vidéo.
Used in the Movie Clip editor.
Node Tree
Groups of re-usable nodes.
Used in the node editors.
Object
Une entité dans la scène avec position,
échelle, rotation.
Used by scenes & collections.
Paint Curve
Stores a paint or sculpt stroke.
Accès depuis les outils de peinture.
Palette
Enregistre les préréglages de couleurs.
Accès depuis les outils de peinture.
Particle
Réglages de particules.
Utilisées par les systèmes de particules.
Light Probe
Help achieve complex real-time lighting in Eevee.
Scene
enregistrement principal de toutes les données d’affichage et d’animation.
Utilisée comme enregistrement de haut niveau pour les objets et l’animation.
Sounds
Reference to sound files.
Used as data of speaker objects.
Speaker
Sources sonores pour une scène 3D.
Used as data of speaker object.
Text
données texte.
Utilisé par les scripts Python et les shaders OSL.
Texture
Textures 2D/3D.
Used by brushes and modifiers.
Window Manager
The overarching manager for all of Blender’s UI.
Includes Workspaces, notification system, operators, and keymaps.
World
Define global render environment settings.
Workspace
UI layout.
Used by each window, which has its own workspace.

Custom Properties

../_images/files_data-blocks_add.png

Custom Properties panel.

Custom properties are a way to store your own data in Blender’s data-blocks. It can be used for rigging (where bones and objects can have custom properties driving other properties), and Python scripts, where it’s common to define new settings not available in Blender.

Only certain data supports custom properties:

To add a custom property, search for the Custom Properties panel, found at the bottom of most Properties Editor or Sidebar region, and hit Add.

Editing Properties

User Interface

Custom properties can be edited using the panel available for data types that support it.

../_images/files_data-blocks_edit.png

Custom Properties edit pop-up.

Property Name
The name of the custom property.
Property Value

This does two things: first it sets the current value of the custom property, and second, it defines the data type of the property.

Custom properties can be of the following types: Integers, Floats, Strings, Booleans, or short vectors of Integers or Floats.

See the table below for a list of examples for each:

Integers:1, 2, 3, 4,
Floats:3.141, 5.0, 6.125,
Strings:any text,
Booleans:True, False
Vectors:[1, 2, 3], [1.0, 2.0, 3.0]

Note

Booleans are handled very similar to integers and only work when using Min/Max values that are integers and that are no more than 1 apart.

At this point, the booleans will still look like integers but behave like booleans having one lower, off, value and a higher, on, value.

Default Value

This sets the default value of the property used by the Reset to Default Value operator.

Avertissement

Default values are used as the basis of NLA blending, and a nonsensical default (e.g. 0 for a property used for scaling) on a property intended for being keyframed is likely to cause issues.

Min
The minimum value the custom property can take.
Max
The maximum value the custom property can take.
../_images/files_data-blocks_edit_color.png

Custom Property settings for a color with alpha.

Use Soft Limits

Enables limits that the Property Value slider can be adjusted to without having to input the value numerically.

Soft Min
The minimum value for the soft limit.
Soft Max
The maximum value for the soft limit.
Tooltip
Allows you to write a custom Tooltip for your property.
Subtype
For vector properties, specifies the kind of data the property contains, which affects how it appears in the UI. Most useful for color properties.

Python Access

Custom properties can be accessed in a similar way to dictionaries, with the constraints that keys can only be strings, and values can only be strings, numbers, arrays of such, or nested properties.

See the API documentation for details.