[Bf-blender-cvs] [18b2ec19633] geometry-nodes-simulation: Rename "Use Cache" to "Persistent Cache"

Hans Goudey noreply at git.blender.org
Thu Dec 1 23:35:00 CET 2022


Commit: 18b2ec19633cdf20a289ac15c9fca62171232ded
Author: Hans Goudey
Date:   Thu Dec 1 16:32:01 2022 -0600
Branches: geometry-nodes-simulation
https://developer.blender.org/rB18b2ec19633cdf20a289ac15c9fca62171232ded

Rename "Use Cache" to "Persistent Cache"

This is a temporary option anyway, the caches will be controlled in a
more unified place at the object or scene level. But for now the name
can be a bit better anyway.

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

M	source/blender/makesdna/DNA_node_types.h
M	source/blender/makesrna/intern/rna_nodetree.c
M	source/blender/nodes/geometry/nodes/node_geo_simulation_output.cc

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

diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index 055a34dfe93..3390bac1385 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -1555,7 +1555,7 @@ typedef struct NodeGeometrySimulationInput {
 } NodeGeometrySimulationInput;
 
 typedef struct NodeGeometrySimulationOutput {
-  int8_t use_cache;
+  int8_t use_persistent_cache;
 } NodeGeometrySimulationOutput;
 
 typedef struct NodeGeometryDistributePointsInVolume {
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 468f13d8817..42100b0dccc 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -9696,8 +9696,8 @@ static void def_geo_simulation_output(StructRNA *srna)
 
   RNA_def_struct_sdna_from(srna, "NodeGeometrySimulationOutput", "storage");
 
-  prop = RNA_def_property(srna, "use_cache", PROP_BOOLEAN, PROP_NONE);
-  RNA_def_property_ui_text(prop, "Use Cache", "");
+  prop = RNA_def_property(srna, "use_persistent_cache", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_ui_text(prop, "Persistent Cache", "");
   RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
 }
 
diff --git a/source/blender/nodes/geometry/nodes/node_geo_simulation_output.cc b/source/blender/nodes/geometry/nodes/node_geo_simulation_output.cc
index f11100f0eac..e1579061a69 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_simulation_output.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_simulation_output.cc
@@ -26,13 +26,13 @@ static void node_declare(NodeDeclarationBuilder &b)
 
 static void node_layout(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)
 {
-  uiItemR(layout, ptr, "use_cache", 0, nullptr, ICON_NONE);
+  uiItemR(layout, ptr, "use_cache", 0, IFACE_("Persistent Cache"), ICON_NONE);
 }
 
 static void node_init(bNodeTree * /*tree*/, bNode *node)
 {
   NodeGeometrySimulationOutput *data = MEM_cnew<NodeGeometrySimulationOutput>(__func__);
-  data->use_cache = false;
+  data->use_persistent_cache = false;
   node->storage = data;
 }
 
@@ -95,7 +95,7 @@ static void node_geo_exec(GeoNodeExecParams params)
   GeometrySet geometry_set = params.extract_input<GeometrySet>("Geometry");
   geometry_set.ensure_owns_direct_data();
   /* TODO: The "Use cache" input should probably become a "Persistent Cache" option. */
-  if (storage.use_cache || cache.geometry_per_frame.is_empty()) {
+  if (storage.use_persistent_cache || cache.geometry_per_frame.is_empty()) {
     /* If using the cache or there is no cached data yet, write the input in a new cache value. */
     cache.insert(geometry_set, scene_frame, scene_ctime);
   }



More information about the Bf-blender-cvs mailing list