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.
This commit is contained in:
Hans Goudey 2022-12-01 16:32:01 -06:00
parent 97df619be7
commit 18b2ec1963
3 changed files with 6 additions and 6 deletions

View File

@ -1555,7 +1555,7 @@ typedef struct NodeGeometrySimulationInput {
} NodeGeometrySimulationInput;
typedef struct NodeGeometrySimulationOutput {
int8_t use_cache;
int8_t use_persistent_cache;
} NodeGeometrySimulationOutput;
typedef struct NodeGeometryDistributePointsInVolume {

View File

@ -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");
}

View File

@ -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);
}