Geometry Nodes: Add versioning and legacy warning for random float node

This commit is contained in:
2021-09-24 14:06:41 -05:00
parent 536f9eb82e
commit 2dd3968335
2 changed files with 36 additions and 1 deletions

View File

@@ -808,6 +808,7 @@ static void version_geometry_nodes_change_legacy_names(bNodeTree *ntree)
}
}
}
static bool seq_transform_origin_set(Sequence *seq, void *UNUSED(user_data))
{
StripTransform *transform = seq->strip->transform;
@@ -1480,5 +1481,29 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
}
/* Deprecate the random float node in favor of the random float node. */
LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
if (ntree->type != NTREE_GEOMETRY) {
continue;
}
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
if (node->type != FN_NODE_LEGACY_RANDOM_FLOAT) {
continue;
}
if (strstr(node->idname, "Legacy")) {
/* Make sure we haven't changed this idname already. */
continue;
}
char temp_idname[sizeof(node->idname)];
BLI_strncpy(temp_idname, node->idname, sizeof(node->idname));
BLI_snprintf(node->idname,
sizeof(node->idname),
"FunctionNodeLegacy%s",
temp_idname + strlen("FunctionNode"));
}
}
}
}
}