[Bf-blender-cvs] [8bbd6ba8b73] master: Tweak default ID types processing order, step 17: Group and comments.

Bastien Montagne noreply at git.blender.org
Wed Mar 24 15:19:02 CET 2021


Commit: 8bbd6ba8b738309ed49160691797e1bb2bdd3321
Author: Bastien Montagne
Date:   Wed Mar 24 15:07:58 2021 +0100
Branches: master
https://developer.blender.org/rB8bbd6ba8b738309ed49160691797e1bb2bdd3321

Tweak default ID types processing order, step 17: Group and comments.

Regroup ID type indices by categories, and add some comments about
reasoning of current order.

===================================================================

M	source/blender/makesdna/DNA_ID.h

===================================================================

diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index f30a241439a..d88db091cc2 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -763,25 +763,52 @@ typedef enum IDRecalcFlag {
  * See e.g. how #BKE_library_unused_linked_data_set_tag is doing this.
  */
 enum {
+  /* Special case: Library, should never ever depend on any other type. */
   INDEX_ID_LI = 0,
-  INDEX_ID_IP,
+
+  /* Animation types, might be used by almost all other types. */
+  INDEX_ID_IP, /* Deprecated. */
   INDEX_ID_AC,
+
+  /* Grease Pencil, special case, should be with the other obdata, but it can also be used by many
+   * other ID types, including node trees e.g.
+   * So there is no proper place for those, for now keep close to the lower end of the processing
+   * hierarchy, but we may want to re-evaluate that at some point. */
   INDEX_ID_GD,
+
+  /* Node trees, abstraction for procedural data, potentially used by many other ID types.
+   *
+   * NOTE: While node trees can also use many other ID types, they should not /own/ any of those,
+   * while they are being owned by many other ID types. This is why they are placed here. */
   INDEX_ID_NT,
+
+  /* File-wrapper types, those usually 'embed' external files in Blender, with no dependencies to
+   * other ID types. */
   INDEX_ID_VF,
   INDEX_ID_TXT,
   INDEX_ID_SO,
+
+  /* Image/movie types, can be used by shading ID types, but also directly by Objects, Scenes, etc.
+   */
   INDEX_ID_MSK,
   INDEX_ID_IM,
   INDEX_ID_MC,
+
+  /* Shading types. */
   INDEX_ID_TE,
   INDEX_ID_MA,
   INDEX_ID_LS,
   INDEX_ID_WO,
+
+  /* Simulation-related types. */
   INDEX_ID_CF,
   INDEX_ID_SIM,
   INDEX_ID_PA,
+
+  /* Shape Keys snow-flake, can be used by several obdata types. */
   INDEX_ID_KE,
+
+  /* Object data types. */
   INDEX_ID_AR,
   INDEX_ID_ME,
   INDEX_ID_CU,
@@ -794,15 +821,26 @@ enum {
   INDEX_ID_CA,
   INDEX_ID_SPK,
   INDEX_ID_LP,
+
+  /* Collection and object types. */
   INDEX_ID_OB,
   INDEX_ID_GR,
+
+  /* Preset-like, not-really-data types, can use many other ID types but should never be used by
+   * any actual data type (besides Scene, due to tool settings). */
   INDEX_ID_PAL,
   INDEX_ID_PC,
   INDEX_ID_BR,
+
+  /* Scene, after preset-like ID types because of tool settings. */
   INDEX_ID_SCE,
+
+  /* UI-related types, should never be used by any other data type. */
   INDEX_ID_SCR,
   INDEX_ID_WS,
   INDEX_ID_WM,
+
+  /* Special values. */
   INDEX_ID_NULL,
   INDEX_ID_MAX,
 };



More information about the Bf-blender-cvs mailing list