[Bf-blender-cvs] [727ed660653] temp-test-point-cloud-simulation-depsgraph-integration: Add new simulation data block

Jacques Lucke noreply at git.blender.org
Wed Apr 15 18:27:07 CEST 2020


Commit: 727ed660653b4779799137409ef4c7fe85e35e37
Author: Jacques Lucke
Date:   Tue Mar 24 14:47:51 2020 +0100
Branches: temp-test-point-cloud-simulation-depsgraph-integration
https://developer.blender.org/rB727ed660653b4779799137409ef4c7fe85e35e37

Add new simulation data block

This introduces a new id data block with type `ID_SIM`.

The RNA part of this change is disabled by default for now.
The corresponding cmake option is `WITH_SIMULATION_DATA_BLOCK_RNA`.

The new data block does not yet have an embedded node tree.
I want to add that separately.

This is part of T73324.

The set of files I changed is based on rBb0a1cf2c9ae696.
However, I had to change fewer files, because I did not add a new object type.

Differential Revision: https://developer.blender.org/D7225

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

M	source/blender/blenkernel/BKE_idtype.h
M	source/blender/blenkernel/intern/anim_sys.c
M	source/blender/blenkernel/intern/idtype.c
M	source/blender/blenkernel/intern/lib_query.c
M	source/blender/blenkernel/intern/lib_remap.c
M	source/blender/blenkernel/intern/main.c
M	source/blender/blenkernel/intern/simulation.cc
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/writefile.c
M	source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M	source/blender/editors/interface/interface_icons.c
M	source/blender/editors/interface/interface_templates.c
M	source/blender/editors/render/render_opengl.c
M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/editors/space_outliner/outliner_intern.h
M	source/blender/editors/space_outliner/outliner_tools.c
M	source/blender/editors/space_outliner/outliner_tree.c
M	source/blender/makesdna/DNA_ID.h
M	source/blender/makesrna/intern/rna_ID.c
M	source/blender/makesrna/intern/rna_main_api.c
M	source/blender/makesrna/intern/rna_space.c

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

diff --git a/source/blender/blenkernel/BKE_idtype.h b/source/blender/blenkernel/BKE_idtype.h
index b4e6c4cddfc..e71de00733d 100644
--- a/source/blender/blenkernel/BKE_idtype.h
+++ b/source/blender/blenkernel/BKE_idtype.h
@@ -165,7 +165,7 @@ extern IDTypeInfo IDType_ID_LP;
 extern IDTypeInfo IDType_ID_HA;
 extern IDTypeInfo IDType_ID_PT;
 extern IDTypeInfo IDType_ID_VO;
-extern IDTypeInfo IDType_ID_SI;
+extern IDTypeInfo IDType_ID_SIM;
 
 extern IDTypeInfo IDType_ID_LINK_PLACEHOLDER;
 
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 07655119d2b..889168b68d0 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -113,7 +113,7 @@ bool id_type_can_have_animdata(const short id_type)
     case ID_HA:
     case ID_PT:
     case ID_VO:
-    case ID_SI:
+    case ID_SIM:
       return true;
 
     /* no AnimData */
diff --git a/source/blender/blenkernel/intern/idtype.c b/source/blender/blenkernel/intern/idtype.c
index 59dd8724b90..05159a6a029 100644
--- a/source/blender/blenkernel/intern/idtype.c
+++ b/source/blender/blenkernel/intern/idtype.c
@@ -92,7 +92,7 @@ static void id_type_init(void)
   INIT_TYPE(ID_HA);
   INIT_TYPE(ID_PT);
   INIT_TYPE(ID_VO);
-  INIT_TYPE(ID_SI);
+  INIT_TYPE(ID_SIM);
 
   /* Special naughty boy... */
   BLI_assert(IDType_ID_LINK_PLACEHOLDER.main_listbase_index == INDEX_ID_NULL);
@@ -252,7 +252,7 @@ uint64_t BKE_idtype_idcode_to_idfilter(const short idcode)
     CASE_IDFILTER(PT);
     CASE_IDFILTER(LP);
     CASE_IDFILTER(SCE);
-    CASE_IDFILTER(SI);
+    CASE_IDFILTER(SIM);
     CASE_IDFILTER(SPK);
     CASE_IDFILTER(SO);
     CASE_IDFILTER(TE);
@@ -304,7 +304,7 @@ short BKE_idtype_idcode_from_idfilter(const uint64_t idfilter)
     CASE_IDFILTER(PT);
     CASE_IDFILTER(LP);
     CASE_IDFILTER(SCE);
-    CASE_IDFILTER(SI);
+    CASE_IDFILTER(SIM);
     CASE_IDFILTER(SPK);
     CASE_IDFILTER(SO);
     CASE_IDFILTER(TE);
@@ -359,7 +359,7 @@ int BKE_idtype_idcode_to_index(const short idcode)
     CASE_IDINDEX(LP);
     CASE_IDINDEX(SCE);
     CASE_IDINDEX(SCR);
-    CASE_IDINDEX(SI);
+    CASE_IDINDEX(SIM);
     CASE_IDINDEX(SPK);
     CASE_IDINDEX(SO);
     CASE_IDINDEX(TE);
@@ -421,7 +421,7 @@ short BKE_idtype_idcode_from_index(const int index)
     CASE_IDCODE(LP);
     CASE_IDCODE(SCE);
     CASE_IDCODE(SCR);
-    CASE_IDCODE(SI);
+    CASE_IDCODE(SIM);
     CASE_IDCODE(SPK);
     CASE_IDCODE(SO);
     CASE_IDCODE(TE);
diff --git a/source/blender/blenkernel/intern/lib_query.c b/source/blender/blenkernel/intern/lib_query.c
index 69f3a42f71f..7f1369254f0 100644
--- a/source/blender/blenkernel/intern/lib_query.c
+++ b/source/blender/blenkernel/intern/lib_query.c
@@ -1295,7 +1295,7 @@ static void library_foreach_ID_link(Main *bmain,
       case ID_PAL:
       case ID_PC:
       case ID_CF:
-      case ID_SI:
+      case ID_SIM:
         break;
 
       /* Deprecated. */
@@ -1458,7 +1458,7 @@ bool BKE_library_id_can_use_idtype(ID *id_owner, const short id_type_used)
     case ID_PAL:
     case ID_PC:
     case ID_CF:
-    case ID_SI:
+    case ID_SIM:
       /* Those types never use/reference other IDs... */
       return false;
     case ID_IP:
diff --git a/source/blender/blenkernel/intern/lib_remap.c b/source/blender/blenkernel/intern/lib_remap.c
index 2874fbd7d63..0817c3042cb 100644
--- a/source/blender/blenkernel/intern/lib_remap.c
+++ b/source/blender/blenkernel/intern/lib_remap.c
@@ -523,7 +523,7 @@ void BKE_libblock_remap_locked(Main *bmain, void *old_idv, void *new_idv, const
     case ID_HA:
     case ID_PT:
     case ID_VO:
-    case ID_SI:
+    case ID_SIM:
       if (new_id) { /* Only affects us in case obdata was relinked (changed). */
         for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) {
           libblock_remap_data_postprocess_obdata_relink(bmain, ob, new_id);
diff --git a/source/blender/blenkernel/intern/main.c b/source/blender/blenkernel/intern/main.c
index 9cb695a25a2..ea3bee8b2f6 100644
--- a/source/blender/blenkernel/intern/main.c
+++ b/source/blender/blenkernel/intern/main.c
@@ -479,7 +479,7 @@ ListBase *which_libbase(Main *bmain, short type)
       return &(bmain->pointclouds);
     case ID_VO:
       return &(bmain->volumes);
-    case ID_SI:
+    case ID_SIM:
       return &(bmain->simulations);
   }
   return NULL;
@@ -556,7 +556,7 @@ int set_listbasepointers(Main *bmain, ListBase **lb)
   lb[INDEX_ID_WS] = &(bmain->workspaces); /* before wm, so it's freed after it! */
   lb[INDEX_ID_WM] = &(bmain->wm);
   lb[INDEX_ID_MSK] = &(bmain->masks);
-  lb[INDEX_ID_SI] = &(bmain->simulations);
+  lb[INDEX_ID_SIM] = &(bmain->simulations);
 
   lb[INDEX_ID_NULL] = NULL;
 
diff --git a/source/blender/blenkernel/intern/simulation.cc b/source/blender/blenkernel/intern/simulation.cc
index f4bd82a6a1c..7610f5f18cd 100644
--- a/source/blender/blenkernel/intern/simulation.cc
+++ b/source/blender/blenkernel/intern/simulation.cc
@@ -68,17 +68,17 @@ static void simulation_free_data(ID *id)
 
 void *BKE_simulation_add(Main *bmain, const char *name)
 {
-  Simulation *simulation = (Simulation *)BKE_libblock_alloc(bmain, ID_SI, name, 0);
+  Simulation *simulation = (Simulation *)BKE_libblock_alloc(bmain, ID_SIM, name, 0);
 
   simulation_init_data(&simulation->id);
 
   return simulation;
 }
 
-IDTypeInfo IDType_ID_SI = {
-    /* id_code */ ID_SI,
-    /* id_filter */ FILTER_ID_SI,
-    /* main_listbase_index */ INDEX_ID_SI,
+IDTypeInfo IDType_ID_SIM = {
+    /* id_code */ ID_SIM,
+    /* id_filter */ FILTER_ID_SIM,
+    /* main_listbase_index */ INDEX_ID_SIM,
     /* struct_size */ sizeof(Simulation),
     /* name */ "Simulation",
     /* name_plural */ "simulations",
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index cfdb0066325..76038b94b27 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -9244,8 +9244,8 @@ static const char *dataname(short id_code)
       return "Data from PT";
     case ID_VO:
       return "Data from VO";
-    case ID_SI:
-      return "Data from SI";
+    case ID_SIM:
+      return "Data from SIM";
   }
   return "Data from Lib Block";
 }
@@ -9680,7 +9680,7 @@ static BHead *read_libblock(FileData *fd,
     case ID_VO:
       direct_link_volume(fd, (Volume *)id);
       break;
-    case ID_SI:
+    case ID_SIM:
       direct_link_simulation(fd, (Simulation *)id);
       break;
   }
@@ -10044,7 +10044,7 @@ static void lib_link_all(FileData *fd, Main *bmain)
       case ID_AC:
         lib_link_action(fd, bmain, (bAction *)id);
         break;
-      case ID_SI:
+      case ID_SIM:
         lib_link_simulation(fd, bmain, (Simulation *)id);
         break;
       case ID_IP:
@@ -11602,7 +11602,7 @@ void BLO_expand_main(void *fdhandle, Main *mainvar)
             case ID_VO:
               expand_volume(fd, mainvar, (Volume *)id);
               break;
-            case ID_SI:
+            case ID_SIM:
               expand_simulation(fd, mainvar, (Simulation *)id);
               break;
             default:
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 7960a04a8f4..07ff55703d9 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -3811,7 +3811,7 @@ static void write_volume(WriteData *wd, Volume *volume)
 static void write_simulation(WriteData *wd, Simulation *simulation)
 {
   if (simulation->id.us > 0 || wd->use_memfile) {
-    writestruct(wd, ID_SI, Simulation, 1, simulation);
+    writestruct(wd, ID_SIM, Simulation, 1, simulation);
     write_iddata(wd, &simulation->id);
 
     if (simulation->adt) {
@@ -4134,7 +4134,7 @@ static bool write_file_handle(Main *mainvar,
           case ID_VO:
             write_volume(wd, (Volume *)id);
             break;
-          case ID_SI:
+          case ID_SIM:
             write_simulation(wd, (Simulation *)id);
             break;
           case ID_LI:
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 4453a30a3be..cf63a94023d 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -481,7 +481,7 @@ void DepsgraphNodeBuilder::build_id(ID *id)
     case ID_SCE:
       build_scene_parameters((Scene *)id);
       break;
-    case ID_SI:
+    case ID_SIM:
       build_simulation((Simulation *)id);
       break;
     default:
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index bf578b39529..f1c3e03bca2 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -559,7 +559,7 @@ void DepsgraphRelationBuilder::build_id(ID *id)
     case ID_SCE:
       build_scene_parameters((Scene *)id);
       break;
-    case ID_SI:
+    case ID_SIM:
       build_simulation((Simulation *)id);
       break;
     default:
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index c2f9bc1166e..8dd29fce1af 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -2326,7 +2326,7 @@ int UI_idcode_icon_get(const int idcode)
       return ICON_WORLD_DATA;
     case ID_WS:
       return ICON_WORKSPACE;
-    case ID_SI:
+    case ID_SIM:
       /* TODO: Use correct icon. */
       return ICON_PHYSICS;
     default:
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 860138cadc9..b2d164de8ad 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -681,7 +681,7 @@ static const char *template_id_browse_tip(const StructRNA *type)
         return N_("Browse Point Cloud Data to be linked");
       case ID_VO:
         return N_("Browse Volume Data to be linked");
-      case ID_SI:
+    

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list