Blender  V3.3
DNA_ID.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
9 #pragma once
10 
11 #include "DNA_ID_enums.h"
12 #include "DNA_defs.h"
13 #include "DNA_listBase.h"
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 struct FileData;
20 struct GHash;
21 struct GPUTexture;
22 struct ID;
23 struct Library;
24 struct PackedFile;
25 struct UniqueName_Map;
26 
27 /* Runtime display data */
28 struct DrawData;
29 typedef void (*DrawDataInitCb)(struct DrawData *engine_data);
30 typedef void (*DrawDataFreeCb)(struct DrawData *engine_data);
31 
32 #
33 #
34 typedef struct DrawData {
35  struct DrawData *next, *prev;
37  /* Only nested data, NOT the engine data itself. */
39  /* Accumulated recalc flags, which corresponds to ID->recalc flags. */
40  int recalc;
42 
43 typedef struct DrawDataList {
44  struct DrawData *first, *last;
46 
47 typedef struct IDPropertyUIData {
49  char *description;
52 
53  char _pad[4];
55 
56 /* IDP_UI_DATA_TYPE_INT */
57 typedef struct IDPropertyUIDataInt {
59  int *default_array; /* Only for array properties. */
61  char _pad[4];
62 
63  int min;
64  int max;
65  int soft_min;
66  int soft_max;
67  int step;
70 
71 /* IDP_UI_DATA_TYPE_FLOAT */
72 typedef struct IDPropertyUIDataFloat {
74  double *default_array; /* Only for array properties. */
76  char _pad[4];
77 
78  float step;
79  int precision;
80 
81  double min;
82  double max;
83  double soft_min;
84  double soft_max;
85  double default_value;
87 
88 /* IDP_UI_DATA_TYPE_STRING */
89 typedef struct IDPropertyUIDataString {
93 
94 /* IDP_UI_DATA_TYPE_ID */
95 typedef struct IDPropertyUIDataID {
98 
99 typedef struct IDPropertyData {
100  void *pointer;
103  int val, val2;
105 
106 typedef struct IDProperty {
107  struct IDProperty *next, *prev;
108  char type, subtype;
109  short flag;
111  char name[64];
112 
113  /* saved is used to indicate if this struct has been saved yet.
114  * seemed like a good idea as a '_pad' var was needed anyway :) */
115  int saved;
118 
119  /* Array length, also (this is important!) string length + 1.
120  * the idea is to be able to reuse array realloc functions on strings. */
121  int len;
122 
123  /* Strings and arrays are both buffered, though the buffer isn't saved. */
124  /* totallen is total length of allocated array/string, including a buffer.
125  * Note that the buffering is mild; the code comes from python's list implementation. */
126  int totallen;
127 
130 
131 #define MAX_IDPROP_NAME 64
132 #define DEFAULT_ALLOC_FOR_NULL_STRINGS 64
133 
134 /*->type*/
135 typedef enum eIDPropertyType {
137  IDP_INT = 1,
142  IDP_ID = 7,
146 #define IDP_NUMTYPES 10
147 
149 enum {
158 };
159 
160 /*->subtype */
161 
162 /* IDP_STRING */
163 enum {
164  IDP_STRING_SUB_UTF8 = 0, /* default */
165  IDP_STRING_SUB_BYTE = 1, /* arbitrary byte array, _not_ null terminated */
166 };
167 
168 /*->flag*/
169 enum {
173 
178 
181  IDP_FLAG_GHOST = 1 << 7,
182 };
183 
184 /* add any future new id property types here. */
185 
186 /* Static ID override structs. */
187 
190 
191  /* Type of override. */
192  short operation;
193  short flag;
194 
196  short tag;
197  char _pad0[2];
198 
199  /* Sub-item references, if needed (for arrays or collections only).
200  * We need both reference and local values to allow e.g. insertion into RNA collections
201  * (constraints, modifiers...).
202  * In RNA collection case, if names are defined, they are used in priority.
203  * Names are pointers (instead of char[64]) to save some space, NULL or empty string when unset.
204  * Indices are -1 when unset.
205  *
206  * NOTE: For insertion operations in RNA collections, reference may not actually exist in the
207  * linked reference data. It is used to identify the anchor of the insertion operation (i.e. the
208  * item after or before which the new local item should be inserted), in the local override. */
214 
215 /* IDOverrideLibraryPropertyOperation->operation. */
216 enum {
217  /* Basic operations. */
218  IDOVERRIDE_LIBRARY_OP_NOOP = 0, /* Special value, forbids any overriding. */
219 
220  IDOVERRIDE_LIBRARY_OP_REPLACE = 1, /* Fully replace local value by reference one. */
221 
222  /* Numeric-only operations. */
223  IDOVERRIDE_LIBRARY_OP_ADD = 101, /* Add local value to reference one. */
224  /* Subtract local value from reference one (needed due to unsigned values etc.). */
226  /* Multiply reference value by local one (more useful than diff for scales and the like). */
228 
229  /* Collection-only operations. */
230  IDOVERRIDE_LIBRARY_OP_INSERT_AFTER = 201, /* Insert after given reference's subitem. */
231  IDOVERRIDE_LIBRARY_OP_INSERT_BEFORE = 202, /* Insert before given reference's subitem. */
232  /* We can add more if needed (move, delete, ...). */
233 };
234 
235 /* IDOverrideLibraryPropertyOperation->flag. */
236 enum {
241 
245 };
246 
250 
255  char *rna_path;
256 
261 
265  short tag;
266  char _pad[2];
267 
269  unsigned int rna_prop_type;
271 
272 /* IDOverrideLibraryProperty->tag and IDOverrideLibraryPropertyOperation->tag. */
273 enum {
276 };
277 
278 #
279 #
280 typedef struct IDOverrideLibraryRuntime {
284 
285 /* IDOverrideLibraryRuntime->tag. */
286 enum {
289 };
290 
291 /* Main container for all overriding data info of a data-block. */
292 typedef struct IDOverrideLibrary {
294  struct ID *reference;
297 
304 
305  /* Read/write data. */
306  /* Temp ID storing extra override data (used for differential operations only currently).
307  * Always NULL outside of read/write context. */
308  struct ID *storage;
309 
311 
312  unsigned int flag;
313  char _pad_1[4];
315 
316 /* IDOverrideLibrary->flag */
317 enum {
328 };
329 
330 /* watch it: Sequence has identical beginning. */
336 /* 2 characters for ID code and 64 for actual name */
337 #define MAX_ID_NAME 66
338 
340 enum {
345 };
346 
348 typedef struct ID_Runtime_Remap {
350  int status;
361 
362 typedef struct ID_Runtime {
365 
366 /* There's a nasty circular dependency here.... 'void *' to the rescue! I
367  * really wonder why this is needed. */
368 typedef struct ID {
369  void *next, *prev;
370  struct ID *newid;
371 
372  struct Library *lib;
373 
376 
378  char name[66];
383  short flag;
387  int tag;
388  int us;
389  int icon_id;
390  int recalc;
402 
407  unsigned int session_uuid;
408 
410 
413 
419  struct ID *orig_id;
420 
435  void *py_instance;
436 
444 
445  struct ID_Runtime runtime;
446 } ID;
447 
448 typedef struct Library_Runtime {
449  /* Used for efficient calculations of unique names. */
452 
457 typedef struct Library {
461  char filepath[1024];
462 
471  char filepath_abs[1024];
472 
474  struct Library *parent;
475 
477 
479  char _pad_0[6];
480 
485 
486  struct Library_Runtime runtime;
488 
491  /* Automatic recursive resync was needed when linking/loading data from that library. */
493 };
494 
505 typedef struct LibraryWeakReference {
507  char library_filepath[1024];
508 
510  char library_id_name[66];
511 
512  char _pad[2];
514 
515 /* for PreviewImage->flag */
517  PRV_CHANGED = (1 << 0),
518  PRV_USER_EDITED = (1 << 1), /* if user-edited, do not auto-update this anymore! */
519  PRV_RENDERING = (1 << 2), /* Rendering was invoked. Cleared on file read. */
520 };
521 
522 /* for PreviewImage->tag */
523 enum {
524  PRV_TAG_DEFFERED = (1 << 0), /* Actual loading of preview is deferred. */
525  PRV_TAG_DEFFERED_RENDERING = (1 << 1), /* Deferred preview is being loaded. */
526  PRV_TAG_DEFFERED_DELETE = (1 << 2), /* Deferred preview should be deleted asap. */
527 };
528 
529 typedef struct PreviewImage {
530  /* All values of 2 are really NUM_ICON_SIZES */
531  unsigned int w[2];
532  unsigned int h[2];
533  short flag[2];
535  unsigned int *rect[2];
536 
537  /* Runtime-only data. */
538  struct GPUTexture *gputexture[2];
540  int icon_id;
541 
543  short tag;
544  char _pad[2];
546 
547 #define PRV_DEFERRED_DATA(prv) \
548  (CHECK_TYPE_INLINE(prv, PreviewImage *), \
549  BLI_assert((prv)->tag & PRV_TAG_DEFFERED), \
550  (void *)((prv) + 1))
551 
552 #define ID_FAKE_USERS(id) ((((const ID *)id)->flag & LIB_FAKEUSER) ? 1 : 0)
553 #define ID_REAL_USERS(id) (((const ID *)id)->us - ID_FAKE_USERS(id))
554 #define ID_EXTRA_USERS(id) (((const ID *)id)->tag & LIB_TAG_EXTRAUSER ? 1 : 0)
555 
556 #define ID_CHECK_UNDO(id) \
557  ((GS((id)->name) != ID_SCR) && (GS((id)->name) != ID_WM) && (GS((id)->name) != ID_WS))
558 
559 #define ID_BLEND_PATH(_bmain, _id) \
560  ((_id)->lib ? (_id)->lib->filepath_abs : BKE_main_blendfile_path((_bmain)))
561 #define ID_BLEND_PATH_FROM_GLOBAL(_id) \
562  ((_id)->lib ? (_id)->lib->filepath_abs : BKE_main_blendfile_path_from_global())
563 
564 #define ID_MISSING(_id) ((((const ID *)(_id))->tag & LIB_TAG_MISSING) != 0)
565 
566 #define ID_IS_LINKED(_id) (((const ID *)(_id))->lib != NULL)
567 
568 /* Note that these are fairly high-level checks, should be used at user interaction level, not in
569  * BKE_library_override typically (especially due to the check on LIB_TAG_EXTERN). */
570 #define ID_IS_OVERRIDABLE_LIBRARY_HIERARCHY(_id) \
571  (ID_IS_LINKED(_id) && !ID_MISSING(_id) && \
572  (BKE_idtype_get_info_from_id((const ID *)(_id))->flags & IDTYPE_FLAGS_NO_LIBLINKING) == 0 && \
573  !ELEM(GS(((ID *)(_id))->name), ID_SCE))
574 #define ID_IS_OVERRIDABLE_LIBRARY(_id) \
575  (ID_IS_OVERRIDABLE_LIBRARY_HIERARCHY((_id)) && (((const ID *)(_id))->tag & LIB_TAG_EXTERN) != 0)
576 
577 /* NOTE: The three checks below do not take into account whether given ID is linked or not (when
578  * chaining overrides over several libraries). User must ensure the ID is not linked itself
579  * currently. */
580 /* TODO: add `_EDITABLE` versions of those macros (that would check if ID is linked or not)? */
581 #define ID_IS_OVERRIDE_LIBRARY_REAL(_id) \
582  (((const ID *)(_id))->override_library != NULL && \
583  ((const ID *)(_id))->override_library->reference != NULL)
584 
585 #define ID_IS_OVERRIDE_LIBRARY_VIRTUAL(_id) \
586  ((((const ID *)(_id))->flag & LIB_EMBEDDED_DATA_LIB_OVERRIDE) != 0)
587 
588 #define ID_IS_OVERRIDE_LIBRARY(_id) \
589  (ID_IS_OVERRIDE_LIBRARY_REAL(_id) || ID_IS_OVERRIDE_LIBRARY_VIRTUAL(_id))
590 
591 #define ID_IS_OVERRIDE_LIBRARY_HIERARCHY_ROOT(_id) \
592  (!ID_IS_OVERRIDE_LIBRARY_REAL(_id) || \
593  ((ID *)(_id))->override_library->hierarchy_root == ((ID *)(_id)))
594 
595 #define ID_IS_OVERRIDE_LIBRARY_TEMPLATE(_id) \
596  (((ID *)(_id))->override_library != NULL && ((ID *)(_id))->override_library->reference == NULL)
597 
598 #define ID_IS_ASSET(_id) (((const ID *)(_id))->asset_data != NULL)
599 
600 /* Check whether datablock type is covered by copy-on-write. */
601 #define ID_TYPE_IS_COW(_id_type) \
602  (!ELEM(_id_type, ID_LI, ID_IP, ID_SCR, ID_VF, ID_BR, ID_WM, ID_PAL, ID_PC, ID_WS, ID_IM))
603 
604 /* Check whether data-block type requires copy-on-write from #ID_RECALC_PARAMETERS.
605  * Keep in sync with #BKE_id_eval_properties_copy. */
606 #define ID_TYPE_SUPPORTS_PARAMS_WITHOUT_COW(id_type) ELEM(id_type, ID_ME)
607 
608 #define ID_TYPE_IS_DEPRECATED(id_type) ELEM(id_type, ID_IP)
609 
610 #ifdef GS
611 # undef GS
612 #endif
613 #define GS(a) \
614  (CHECK_TYPE_ANY(a, char *, const char *, char[66], const char[66]), \
615  (ID_Type)(*((const short *)(a))))
616 
617 #define ID_NEW_SET(_id, _idn) \
618  (((ID *)(_id))->newid = (ID *)(_idn), \
619  ((ID *)(_id))->newid->tag |= LIB_TAG_NEW, \
620  (void *)((ID *)(_id))->newid)
621 #define ID_NEW_REMAP(a) \
622  if ((a) && (a)->id.newid) { \
623  (a) = (void *)(a)->id.newid; \
624  } \
625  ((void)0)
626 
628 enum {
630  LIB_FAKEUSER = 1 << 9,
635  LIB_EMBEDDED_DATA = 1 << 10,
652 };
653 
669 enum {
670  /* RESET_NEVER Datablock is from current .blend file. */
672  /* RESET_NEVER Datablock is from a library,
673  * but is used (linked) directly by current .blend file. */
674  LIB_TAG_EXTERN = 1 << 0,
675  /* RESET_NEVER Datablock is from a library,
676  * and is only used (linked) indirectly through other libraries. */
678 
679  /* RESET_AFTER_USE Flag used internally in readfile.c,
680  * to mark IDs needing to be expanded (only done once). */
682  /* RESET_AFTER_USE Flag used internally in readfile.c to mark ID
683  * placeholders for linked data-blocks needing to be read. */
685  /* RESET_AFTER_USE */
687 
688  /* RESET_NEVER tag data-block as a place-holder
689  * (because the real one could not be linked from its library e.g.). */
690  LIB_TAG_MISSING = 1 << 6,
691 
692  /* RESET_NEVER tag data-block as being up-to-date regarding its reference. */
694  /* RESET_NEVER tag data-block as needing an auto-override execution, if enabled. */
696 
697  /* tag data-block as having an extra user. */
699  /* tag data-block as having actually increased user-count for the extra virtual user. */
701 
702  /* RESET_AFTER_USE tag newly duplicated/copied IDs (see #ID_NEW_SET macro above).
703  * Also used internally in readfile.c to mark data-blocks needing do_versions. */
704  LIB_TAG_NEW = 1 << 8,
705  /* RESET_BEFORE_USE free test flag.
706  * TODO: make it a RESET_AFTER_USE too. */
707  LIB_TAG_DOIT = 1 << 10,
708  /* RESET_AFTER_USE tag existing data before linking so we know what is new. */
710 
731 
740  LIB_TAG_LOCALIZED = 1 << 14,
741 
742  /* RESET_NEVER tag data-block for freeing etc. behavior
743  * (usually set when copying real one into temp/runtime one). */
744  LIB_TAG_NO_MAIN = 1 << 15, /* Datablock is not listed in Main database. */
745  LIB_TAG_NO_USER_REFCOUNT = 1 << 16, /* Datablock does not refcount usages of other IDs. */
746  /* Datablock was not allocated by standard system (BKE_libblock_alloc), do not free its memory
747  * (usual type-specific freeing is called though). */
749 
750  /* RESET_AFTER_USE Used by undo system to tag unchanged IDs re-used from old Main (instead of
751  * read from memfile). */
753 
754  /* This ID is part of a temporary #Main which is expected to be freed in a short time-frame.
755  * Don't allow assigning this to non-temporary members (since it's likely to cause errors).
756  * When set #ID.session_uuid isn't initialized, since the data isn't part of the session. */
757  LIB_TAG_TEMP_MAIN = 1 << 20,
758 
763 };
764 
765 /* Tag given ID for an update in all the dependency graphs. */
766 typedef enum IDRecalcFlag {
767  /***************************************************************************
768  * Individual update tags, this is what ID gets tagged for update with. */
769 
770  /* ** Object transformation changed. ** */
772 
773  /* ** Geometry changed. **
774  *
775  * When object of armature type gets tagged with this flag, its pose is
776  * re-evaluated.
777  *
778  * When object of other type is tagged with this flag it makes the modifier
779  * stack to be re-evaluated.
780  *
781  * When object data type (mesh, curve, ...) gets tagged with this flag it
782  * makes all objects which shares this data-block to be updated.
783  *
784  * Note that the evaluation depends on the object-mode.
785  * So edit-mesh data for example only reevaluate with the updated edit-mesh.
786  * When geometry in the original ID has been modified #ID_RECALC_GEOMETRY_ALL_MODES
787  * must be used instead.
788  *
789  * When a collection gets tagged with this flag, all objects depending on the geometry and
790  * transforms on any of the objects in the collection are updated. */
791  ID_RECALC_GEOMETRY = (1 << 1),
792 
793  /* ** Animation or time changed and animation is to be re-evaluated. ** */
795 
796  /* ** Particle system changed. ** */
797  /* Only do pathcache etc. */
799  /* Reset everything including pointcache. */
801  /* Only child settings changed. */
803  /* Physics type changed. */
805 
806  /* ** Material and shading ** */
807 
808  /* For materials and node trees this means that topology of the shader tree
809  * changed, and the shader is to be recompiled.
810  * For objects it means that the draw batch cache is to be redone. */
811  ID_RECALC_SHADING = (1 << 7),
812  /* TODO(sergey): Consider adding an explicit ID_RECALC_SHADING_PARAMATERS
813  * which can be used for cases when only socket value changed, to speed up
814  * redraw update in that case. */
815 
816  /* Selection of the ID itself or its components (for example, vertices) did
817  * change, and all the drawing data is to be updated. */
818  ID_RECALC_SELECT = (1 << 9),
819  /* Flags on the base did change, and is to be copied onto all the copies of
820  * corresponding objects. */
821  ID_RECALC_BASE_FLAGS = (1 << 10),
823  /* Only inform editors about the change. Is used to force update of editors
824  * when data-block which is not a part of dependency graph did change.
825  *
826  * For example, brush texture did change and the preview is to be
827  * re-rendered. */
828  ID_RECALC_EDITORS = (1 << 12),
829 
830  /* ** Update copy on write component. **
831  * This is most generic tag which should only be used when nothing else
832  * matches.
833  */
835 
836  /* Sequences in the sequencer did change.
837  * Use this tag with a scene ID which owns the sequences. */
839 
840  /* Runs on frame-change (used for seeking audio too). */
842 
843  ID_RECALC_AUDIO_FPS = (1 << 16),
845  ID_RECALC_AUDIO_MUTE = (1 << 18),
847 
848  ID_RECALC_AUDIO = (1 << 20),
849 
850  /* NOTE: This triggers copy on write for types that require it.
851  * Exceptions to this can be added using #ID_TYPE_SUPPORTS_PARAMS_WITHOUT_COW,
852  * this has the advantage that large arrays stored in the idea data don't
853  * have to be copied on every update. */
854  ID_RECALC_PARAMETERS = (1 << 21),
855 
856  /* Input has changed and datablock is to be reload from disk.
857  * Applies to movie clips to inform that copy-on-written version is to be refreshed for the new
858  * input file or for color space changes. */
859  ID_RECALC_SOURCE = (1 << 23),
860 
861  /* Virtual recalc tag/marker required for undo in some cases, where actual data does not change
862  * and hence do not require an update, but conceptually we are dealing with something new.
863  *
864  * Current known case: linked IDs made local without requiring any copy. While their users do not
865  * require any update, they have actually been 'virtually' remapped from the linked ID to the
866  * local one.
867  */
869 
870  /* The node tree has changed in a way that affects its output nodes. */
872 
873  /***************************************************************************
874  * Pseudonyms, to have more semantic meaning in the actual code without
875  * using too much low-level and implementation specific tags. */
876 
877  /* Update animation data-block itself, without doing full re-evaluation of
878  * all dependent objects. */
880 
881  /* Ensure geometry of object and edit modes are both up-to-date in the evaluated data-block.
882  * Example usage is when mesh validation modifies the non-edit-mode data,
883  * which we want to be copied over to the evaluated data-block. */
885 
886  /***************************************************************************
887  * Aggregate flags, use only for checks on runtime.
888  * Do NOT use those for tagging. */
889 
890  /* Identifies that SOMETHING has been changed in this ID. */
892  /* Identifies that something in particle system did change. */
895 
897 
898 /* To filter ID types (filter_id). 64 bit to fit all types. */
899 #define FILTER_ID_AC (1ULL << 0)
900 #define FILTER_ID_AR (1ULL << 1)
901 #define FILTER_ID_BR (1ULL << 2)
902 #define FILTER_ID_CA (1ULL << 3)
903 #define FILTER_ID_CU_LEGACY (1ULL << 4)
904 #define FILTER_ID_GD (1ULL << 5)
905 #define FILTER_ID_GR (1ULL << 6)
906 #define FILTER_ID_IM (1ULL << 7)
907 #define FILTER_ID_LA (1ULL << 8)
908 #define FILTER_ID_LS (1ULL << 9)
909 #define FILTER_ID_LT (1ULL << 10)
910 #define FILTER_ID_MA (1ULL << 11)
911 #define FILTER_ID_MB (1ULL << 12)
912 #define FILTER_ID_MC (1ULL << 13)
913 #define FILTER_ID_ME (1ULL << 14)
914 #define FILTER_ID_MSK (1ULL << 15)
915 #define FILTER_ID_NT (1ULL << 16)
916 #define FILTER_ID_OB (1ULL << 17)
917 #define FILTER_ID_PAL (1ULL << 18)
918 #define FILTER_ID_PC (1ULL << 19)
919 #define FILTER_ID_SCE (1ULL << 20)
920 #define FILTER_ID_SPK (1ULL << 21)
921 #define FILTER_ID_SO (1ULL << 22)
922 #define FILTER_ID_TE (1ULL << 23)
923 #define FILTER_ID_TXT (1ULL << 24)
924 #define FILTER_ID_VF (1ULL << 25)
925 #define FILTER_ID_WO (1ULL << 26)
926 #define FILTER_ID_PA (1ULL << 27)
927 #define FILTER_ID_CF (1ULL << 28)
928 #define FILTER_ID_WS (1ULL << 29)
929 #define FILTER_ID_LP (1ULL << 31)
930 #define FILTER_ID_CV (1ULL << 32)
931 #define FILTER_ID_PT (1ULL << 33)
932 #define FILTER_ID_VO (1ULL << 34)
933 #define FILTER_ID_SIM (1ULL << 35)
934 #define FILTER_ID_KE (1ULL << 36)
935 #define FILTER_ID_SCR (1ULL << 37)
936 #define FILTER_ID_WM (1ULL << 38)
937 #define FILTER_ID_LI (1ULL << 39)
938 
939 #define FILTER_ID_ALL \
940  (FILTER_ID_AC | FILTER_ID_AR | FILTER_ID_BR | FILTER_ID_CA | FILTER_ID_CU_LEGACY | \
941  FILTER_ID_GD | FILTER_ID_GR | FILTER_ID_IM | FILTER_ID_LA | FILTER_ID_LS | FILTER_ID_LT | \
942  FILTER_ID_MA | FILTER_ID_MB | FILTER_ID_MC | FILTER_ID_ME | FILTER_ID_MSK | FILTER_ID_NT | \
943  FILTER_ID_OB | FILTER_ID_PA | FILTER_ID_PAL | FILTER_ID_PC | FILTER_ID_SCE | FILTER_ID_SPK | \
944  FILTER_ID_SO | FILTER_ID_TE | FILTER_ID_TXT | FILTER_ID_VF | FILTER_ID_WO | FILTER_ID_CF | \
945  FILTER_ID_WS | FILTER_ID_LP | FILTER_ID_CV | FILTER_ID_PT | FILTER_ID_VO | FILTER_ID_SIM | \
946  FILTER_ID_KE | FILTER_ID_SCR | FILTER_ID_WM | FILTER_ID_LI)
947 
978 enum {
979  /* Special case: Library, should never ever depend on any other type. */
981 
982  /* Animation types, might be used by almost all other types. */
983  INDEX_ID_IP, /* Deprecated. */
985 
986  /* Grease Pencil, special case, should be with the other obdata, but it can also be used by many
987  * other ID types, including node trees e.g.
988  * So there is no proper place for those, for now keep close to the lower end of the processing
989  * hierarchy, but we may want to re-evaluate that at some point. */
991 
992  /* Node trees, abstraction for procedural data, potentially used by many other ID types.
993  *
994  * NOTE: While node trees can also use many other ID types, they should not /own/ any of those,
995  * while they are being owned by many other ID types. This is why they are placed here. */
997 
998  /* File-wrapper types, those usually 'embed' external files in Blender, with no dependencies to
999  * other ID types. */
1003 
1004  /* Image/movie types, can be used by shading ID types, but also directly by Objects, Scenes, etc.
1005  */
1009 
1010  /* Shading types. */
1015 
1016  /* Simulation-related types. */
1020 
1021  /* Shape Keys snow-flake, can be used by several obdata types. */
1023 
1024  /* Object data types. */
1037 
1038  /* Collection and object types. */
1041 
1042  /* Preset-like, not-really-data types, can use many other ID types but should never be used by
1043  * any actual data type (besides Scene, due to tool settings). */
1047 
1048  /* Scene, after preset-like ID types because of tool settings. */
1050 
1051  /* UI-related types, should never be used by any other data type. */
1055 
1056  /* Special values. */
1059 };
1060 
1061 #ifdef __cplusplus
1062 }
1063 #endif
unsigned int uint
Definition: BLI_sys_types.h:67
unsigned short ushort
Definition: BLI_sys_types.h:68
struct IDOverrideLibraryProperty IDOverrideLibraryProperty
@ IDP_TYPE_FILTER_STRING
Definition: DNA_ID.h:150
@ IDP_TYPE_FILTER_ARRAY
Definition: DNA_ID.h:153
@ IDP_TYPE_FILTER_DOUBLE
Definition: DNA_ID.h:156
@ IDP_TYPE_FILTER_FLOAT
Definition: DNA_ID.h:152
@ IDP_TYPE_FILTER_GROUP
Definition: DNA_ID.h:154
@ IDP_TYPE_FILTER_ID
Definition: DNA_ID.h:155
@ IDP_TYPE_FILTER_IDPARRAY
Definition: DNA_ID.h:157
@ IDP_TYPE_FILTER_INT
Definition: DNA_ID.h:151
@ IDOVERRIDE_LIBRARY_FLAG_LOCKED
Definition: DNA_ID.h:240
@ IDOVERRIDE_LIBRARY_FLAG_MANDATORY
Definition: DNA_ID.h:238
@ IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE
Definition: DNA_ID.h:244
@ IDP_STRING_SUB_UTF8
Definition: DNA_ID.h:164
@ IDP_STRING_SUB_BYTE
Definition: DNA_ID.h:165
struct IDOverrideLibraryPropertyOperation IDOverrideLibraryPropertyOperation
struct IDPropertyUIData IDPropertyUIData
struct DrawData DrawData
struct Library_Runtime Library_Runtime
eIDPropertyType
Definition: DNA_ID.h:135
@ IDP_DOUBLE
Definition: DNA_ID.h:143
@ IDP_FLOAT
Definition: DNA_ID.h:138
@ IDP_STRING
Definition: DNA_ID.h:136
@ IDP_IDPARRAY
Definition: DNA_ID.h:144
@ IDP_INT
Definition: DNA_ID.h:137
@ IDP_GROUP
Definition: DNA_ID.h:141
@ IDP_ARRAY
Definition: DNA_ID.h:140
@ IDP_ID
Definition: DNA_ID.h:142
@ PRV_TAG_DEFFERED_DELETE
Definition: DNA_ID.h:526
@ PRV_TAG_DEFFERED
Definition: DNA_ID.h:524
@ PRV_TAG_DEFFERED_RENDERING
Definition: DNA_ID.h:525
IDRecalcFlag
Definition: DNA_ID.h:766
@ ID_RECALC_PARAMETERS
Definition: DNA_ID.h:854
@ ID_RECALC_AUDIO_FPS
Definition: DNA_ID.h:843
@ ID_RECALC_PSYS_PHYS
Definition: DNA_ID.h:804
@ ID_RECALC_AUDIO_LISTENER
Definition: DNA_ID.h:846
@ ID_RECALC_TRANSFORM
Definition: DNA_ID.h:771
@ ID_RECALC_COPY_ON_WRITE
Definition: DNA_ID.h:834
@ ID_RECALC_SHADING
Definition: DNA_ID.h:811
@ ID_RECALC_FRAME_CHANGE
Definition: DNA_ID.h:841
@ ID_RECALC_AUDIO
Definition: DNA_ID.h:848
@ ID_RECALC_POINT_CACHE
Definition: DNA_ID.h:822
@ ID_RECALC_SELECT
Definition: DNA_ID.h:818
@ ID_RECALC_PSYS_REDO
Definition: DNA_ID.h:798
@ ID_RECALC_PSYS_CHILD
Definition: DNA_ID.h:802
@ ID_RECALC_SOURCE
Definition: DNA_ID.h:859
@ ID_RECALC_EDITORS
Definition: DNA_ID.h:828
@ ID_RECALC_GEOMETRY_ALL_MODES
Definition: DNA_ID.h:884
@ ID_RECALC_PSYS_ALL
Definition: DNA_ID.h:893
@ ID_RECALC_AUDIO_MUTE
Definition: DNA_ID.h:845
@ ID_RECALC_SEQUENCER_STRIPS
Definition: DNA_ID.h:838
@ ID_RECALC_TAG_FOR_UNDO
Definition: DNA_ID.h:868
@ ID_RECALC_NTREE_OUTPUT
Definition: DNA_ID.h:871
@ ID_RECALC_PSYS_RESET
Definition: DNA_ID.h:800
@ ID_RECALC_ANIMATION
Definition: DNA_ID.h:794
@ ID_RECALC_GEOMETRY
Definition: DNA_ID.h:791
@ ID_RECALC_ALL
Definition: DNA_ID.h:891
@ ID_RECALC_AUDIO_VOLUME
Definition: DNA_ID.h:844
@ ID_RECALC_ANIMATION_NO_FLUSH
Definition: DNA_ID.h:879
@ ID_RECALC_BASE_FLAGS
Definition: DNA_ID.h:821
struct Library Library
struct IDPropertyUIDataID IDPropertyUIDataID
struct IDOverrideLibrary IDOverrideLibrary
@ IDP_FLAG_GHOST
Definition: DNA_ID.h:181
@ IDP_FLAG_OVERRIDELIBRARY_LOCAL
Definition: DNA_ID.h:177
@ IDP_FLAG_OVERRIDABLE_LIBRARY
Definition: DNA_ID.h:172
struct LibraryWeakReference LibraryWeakReference
struct DrawDataList DrawDataList
@ INDEX_ID_TXT
Definition: DNA_ID.h:1001
@ INDEX_ID_WM
Definition: DNA_ID.h:1054
@ INDEX_ID_VO
Definition: DNA_ID.h:1031
@ INDEX_ID_NULL
Definition: DNA_ID.h:1057
@ INDEX_ID_GD
Definition: DNA_ID.h:990
@ INDEX_ID_CF
Definition: DNA_ID.h:1017
@ INDEX_ID_CV
Definition: DNA_ID.h:1029
@ INDEX_ID_PT
Definition: DNA_ID.h:1030
@ INDEX_ID_GR
Definition: DNA_ID.h:1040
@ INDEX_ID_LA
Definition: DNA_ID.h:1033
@ INDEX_ID_LT
Definition: DNA_ID.h:1032
@ INDEX_ID_PC
Definition: DNA_ID.h:1045
@ INDEX_ID_MA
Definition: DNA_ID.h:1012
@ INDEX_ID_IM
Definition: DNA_ID.h:1007
@ INDEX_ID_OB
Definition: DNA_ID.h:1039
@ INDEX_ID_ME
Definition: DNA_ID.h:1026
@ INDEX_ID_SO
Definition: DNA_ID.h:1002
@ INDEX_ID_VF
Definition: DNA_ID.h:1000
@ INDEX_ID_MC
Definition: DNA_ID.h:1008
@ INDEX_ID_MSK
Definition: DNA_ID.h:1006
@ INDEX_ID_BR
Definition: DNA_ID.h:1046
@ INDEX_ID_WS
Definition: DNA_ID.h:1053
@ INDEX_ID_SIM
Definition: DNA_ID.h:1018
@ INDEX_ID_SCR
Definition: DNA_ID.h:1052
@ INDEX_ID_SPK
Definition: DNA_ID.h:1035
@ INDEX_ID_MB
Definition: DNA_ID.h:1028
@ INDEX_ID_CU_LEGACY
Definition: DNA_ID.h:1027
@ INDEX_ID_LI
Definition: DNA_ID.h:980
@ INDEX_ID_IP
Definition: DNA_ID.h:983
@ INDEX_ID_NT
Definition: DNA_ID.h:996
@ INDEX_ID_WO
Definition: DNA_ID.h:1014
@ INDEX_ID_MAX
Definition: DNA_ID.h:1058
@ INDEX_ID_TE
Definition: DNA_ID.h:1011
@ INDEX_ID_PAL
Definition: DNA_ID.h:1044
@ INDEX_ID_LS
Definition: DNA_ID.h:1013
@ INDEX_ID_SCE
Definition: DNA_ID.h:1049
@ INDEX_ID_LP
Definition: DNA_ID.h:1036
@ INDEX_ID_AC
Definition: DNA_ID.h:984
@ INDEX_ID_CA
Definition: DNA_ID.h:1034
@ INDEX_ID_AR
Definition: DNA_ID.h:1025
@ INDEX_ID_PA
Definition: DNA_ID.h:1019
@ INDEX_ID_KE
Definition: DNA_ID.h:1022
struct ID_Runtime ID_Runtime
struct ID ID
void(* DrawDataFreeCb)(struct DrawData *engine_data)
Definition: DNA_ID.h:30
struct IDPropertyUIDataFloat IDPropertyUIDataFloat
struct IDOverrideLibraryRuntime IDOverrideLibraryRuntime
@ IDOVERRIDE_LIBRARY_OP_MULTIPLY
Definition: DNA_ID.h:227
@ IDOVERRIDE_LIBRARY_OP_INSERT_AFTER
Definition: DNA_ID.h:230
@ IDOVERRIDE_LIBRARY_OP_NOOP
Definition: DNA_ID.h:218
@ IDOVERRIDE_LIBRARY_OP_SUBTRACT
Definition: DNA_ID.h:225
@ IDOVERRIDE_LIBRARY_OP_ADD
Definition: DNA_ID.h:223
@ IDOVERRIDE_LIBRARY_OP_INSERT_BEFORE
Definition: DNA_ID.h:231
@ IDOVERRIDE_LIBRARY_OP_REPLACE
Definition: DNA_ID.h:220
@ LIB_TAG_EXTRAUSER_SET
Definition: DNA_ID.h:700
@ LIB_TAG_COPIED_ON_WRITE_EVAL_RESULT
Definition: DNA_ID.h:730
@ LIB_TAG_NO_USER_REFCOUNT
Definition: DNA_ID.h:745
@ LIB_TAG_NOT_ALLOCATED
Definition: DNA_ID.h:748
@ LIB_TAG_INDIRECT
Definition: DNA_ID.h:677
@ LIB_TAG_EXTRAUSER
Definition: DNA_ID.h:698
@ LIB_TAG_TEMP_MAIN
Definition: DNA_ID.h:757
@ LIB_TAG_NEW
Definition: DNA_ID.h:704
@ LIB_TAG_PRE_EXISTING
Definition: DNA_ID.h:709
@ LIB_TAG_COPIED_ON_WRITE
Definition: DNA_ID.h:720
@ LIB_TAG_UNDO_OLD_ID_REUSED
Definition: DNA_ID.h:752
@ LIB_TAG_LOCALIZED
Definition: DNA_ID.h:740
@ LIB_TAG_LOCAL
Definition: DNA_ID.h:671
@ LIB_TAG_DOIT
Definition: DNA_ID.h:707
@ LIB_TAG_NEED_EXPAND
Definition: DNA_ID.h:681
@ LIB_TAG_EXTERN
Definition: DNA_ID.h:674
@ LIB_TAG_OVERRIDE_LIBRARY_REFOK
Definition: DNA_ID.h:693
@ LIB_TAG_NO_MAIN
Definition: DNA_ID.h:744
@ LIB_TAG_MISSING
Definition: DNA_ID.h:690
@ LIB_TAG_LIB_OVERRIDE_NEED_RESYNC
Definition: DNA_ID.h:762
@ LIB_TAG_NEED_LINK
Definition: DNA_ID.h:686
@ LIB_TAG_OVERRIDE_LIBRARY_AUTOREFRESH
Definition: DNA_ID.h:695
@ LIB_TAG_ID_LINK_PLACEHOLDER
Definition: DNA_ID.h:684
struct PreviewImage PreviewImage
@ LIB_LIB_OVERRIDE_RESYNC_LEFTOVER
Definition: DNA_ID.h:651
@ LIB_EMBEDDED_DATA
Definition: DNA_ID.h:635
@ LIB_FAKEUSER
Definition: DNA_ID.h:630
@ LIB_EMBEDDED_DATA_LIB_OVERRIDE
Definition: DNA_ID.h:646
@ LIB_INDIRECT_WEAK_LINK
Definition: DNA_ID.h:641
void(* DrawDataInitCb)(struct DrawData *engine_data)
Definition: DNA_ID.h:29
@ IDOVERRIDE_LIBRARY_RUNTIME_TAG_NEEDS_RELOAD
Definition: DNA_ID.h:288
struct IDPropertyData IDPropertyData
struct IDProperty IDProperty
@ ID_REMAP_IS_LINKED_DIRECT
Definition: DNA_ID.h:342
@ ID_REMAP_IS_USER_ONE_SKIPPED
Definition: DNA_ID.h:344
eLibrary_Tag
Definition: DNA_ID.h:490
@ LIBRARY_TAG_RESYNC_REQUIRED
Definition: DNA_ID.h:492
@ IDOVERRIDE_LIBRARY_TAG_UNUSED
Definition: DNA_ID.h:275
struct IDPropertyUIDataString IDPropertyUIDataString
struct IDPropertyUIDataInt IDPropertyUIDataInt
ePreviewImage_Flag
Definition: DNA_ID.h:516
@ PRV_RENDERING
Definition: DNA_ID.h:519
@ PRV_CHANGED
Definition: DNA_ID.h:517
@ PRV_USER_EDITED
Definition: DNA_ID.h:518
@ IDOVERRIDE_LIBRARY_FLAG_NO_HIERARCHY
Definition: DNA_ID.h:322
@ IDOVERRIDE_LIBRARY_FLAG_SYSTEM_DEFINED
Definition: DNA_ID.h:327
struct ID_Runtime_Remap ID_Runtime_Remap
Enumerations for DNA_ID.h.
These structs are the foundation for all linked lists in the library system.
struct GPUTexture GPUTexture
Definition: GPU_texture.h:17
SyclQueue void void size_t num_bytes void
The meta-data of an asset. By creating and giving this for a data-block (ID.asset_data),...
struct DrawData * first
Definition: DNA_ID.h:44
struct DrawData * last
Definition: DNA_ID.h:44
struct DrawData * prev
Definition: DNA_ID.h:35
struct DrawEngineType * engine_type
Definition: DNA_ID.h:36
struct DrawData * next
Definition: DNA_ID.h:35
int recalc
Definition: DNA_ID.h:40
DrawDataFreeCb free
Definition: DNA_ID.h:38
struct IDOverrideLibraryPropertyOperation * next
Definition: DNA_ID.h:189
struct IDOverrideLibraryPropertyOperation * prev
Definition: DNA_ID.h:189
struct IDOverrideLibraryProperty * prev
Definition: DNA_ID.h:249
unsigned int rna_prop_type
Definition: DNA_ID.h:269
struct IDOverrideLibraryProperty * next
Definition: DNA_ID.h:249
struct GHash * rna_path_to_override_properties
Definition: DNA_ID.h:281
char _pad_1[4]
Definition: DNA_ID.h:313
struct ID * storage
Definition: DNA_ID.h:308
ListBase properties
Definition: DNA_ID.h:296
unsigned int flag
Definition: DNA_ID.h:312
struct ID * hierarchy_root
Definition: DNA_ID.h:303
struct ID * reference
Definition: DNA_ID.h:294
IDOverrideLibraryRuntime * runtime
Definition: DNA_ID.h:310
ListBase group
Definition: DNA_ID.h:101
void * pointer
Definition: DNA_ID.h:100
double * default_array
Definition: DNA_ID.h:74
IDPropertyUIData base
Definition: DNA_ID.h:73
double default_value
Definition: DNA_ID.h:85
IDPropertyUIData base
Definition: DNA_ID.h:96
int default_array_len
Definition: DNA_ID.h:60
IDPropertyUIData base
Definition: DNA_ID.h:58
int * default_array
Definition: DNA_ID.h:59
char _pad[4]
Definition: DNA_ID.h:61
IDPropertyUIData base
Definition: DNA_ID.h:90
char * default_value
Definition: DNA_ID.h:91
char _pad[4]
Definition: DNA_ID.h:53
char * description
Definition: DNA_ID.h:49
int rna_subtype
Definition: DNA_ID.h:51
short flag
Definition: DNA_ID.h:109
int len
Definition: DNA_ID.h:121
int saved
Definition: DNA_ID.h:115
struct IDProperty * next
Definition: DNA_ID.h:107
IDPropertyUIData * ui_data
Definition: DNA_ID.h:128
char name[64]
Definition: DNA_ID.h:111
IDPropertyData data
Definition: DNA_ID.h:117
struct IDProperty * prev
Definition: DNA_ID.h:107
char subtype
Definition: DNA_ID.h:108
int totallen
Definition: DNA_ID.h:126
char type
Definition: DNA_ID.h:108
int skipped_refcounted
Definition: DNA_ID.h:352
int skipped_direct
Definition: DNA_ID.h:357
int skipped_indirect
Definition: DNA_ID.h:359
ID_Runtime_Remap remap
Definition: DNA_ID.h:363
Definition: DNA_ID.h:368
void * py_instance
Definition: DNA_ID.h:435
int tag
Definition: DNA_ID.h:387
struct AssetMetaData * asset_data
Definition: DNA_ID.h:375
struct Library * lib
Definition: DNA_ID.h:372
int recalc_after_undo_push
Definition: DNA_ID.h:401
int recalc
Definition: DNA_ID.h:390
int us
Definition: DNA_ID.h:388
int icon_id
Definition: DNA_ID.h:389
struct ID * newid
Definition: DNA_ID.h:370
void * prev
Definition: DNA_ID.h:369
IDProperty * properties
Definition: DNA_ID.h:409
IDOverrideLibrary * override_library
Definition: DNA_ID.h:412
struct ID * orig_id
Definition: DNA_ID.h:419
short flag
Definition: DNA_ID.h:383
unsigned int session_uuid
Definition: DNA_ID.h:407
void * next
Definition: DNA_ID.h:369
char name[66]
Definition: DNA_ID.h:378
int recalc_up_to_undo_push
Definition: DNA_ID.h:400
struct LibraryWeakReference * library_weak_reference
Definition: DNA_ID.h:443
struct ID_Runtime runtime
Definition: DNA_ID.h:445
char library_filepath[1024]
Definition: DNA_ID.h:507
char library_id_name[66]
Definition: DNA_ID.h:510
struct UniqueName_Map * name_map
Definition: DNA_ID.h:450
struct PackedFile * packedfile
Definition: DNA_ID.h:476
short versionfile
Definition: DNA_ID.h:484
short subversionfile
Definition: DNA_ID.h:484
char filepath[1024]
Definition: DNA_ID.h:461
struct Library_Runtime runtime
Definition: DNA_ID.h:486
ID id
Definition: DNA_ID.h:458
int temp_index
Definition: DNA_ID.h:482
struct Library * parent
Definition: DNA_ID.h:474
ushort tag
Definition: DNA_ID.h:478
struct FileData * filedata
Definition: DNA_ID.h:459
char _pad_0[6]
Definition: DNA_ID.h:479
char filepath_abs[1024]
Definition: DNA_ID.h:471
unsigned int h[2]
Definition: DNA_ID.h:532
char _pad[2]
Definition: DNA_ID.h:544
short tag
Definition: DNA_ID.h:543
short changed_timestamp[2]
Definition: DNA_ID.h:534
short flag[2]
Definition: DNA_ID.h:533
int icon_id
Definition: DNA_ID.h:540
unsigned int * rect[2]
Definition: DNA_ID.h:535
unsigned int w[2]
Definition: DNA_ID.h:531
struct GPUTexture * gputexture[2]
Definition: DNA_ID.h:538