Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/versioning_300.c
| Show First 20 Lines • Show All 2,398 Lines • ▼ Show 20 Lines | void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) | ||||
| * | * | ||||
| * \note Be sure to check when bumping the version: | * \note Be sure to check when bumping the version: | ||||
| * - "versioning_userdef.c", #blo_do_versions_userdef | * - "versioning_userdef.c", #blo_do_versions_userdef | ||||
| * - "versioning_userdef.c", #do_versions_theme | * - "versioning_userdef.c", #do_versions_theme | ||||
| * | * | ||||
| * \note Keep this message at the bottom of the function. | * \note Keep this message at the bottom of the function. | ||||
| */ | */ | ||||
| { | { | ||||
| LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) { | |||||
| if (ntree->type != NTREE_GEOMETRY) { | |||||
| continue; | |||||
| } | |||||
| version_node_id(ntree, GEO_NODE_CURVE_SPLINE_PARAMETER, "GeometryNodeSplineParameter"); | |||||
| LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { | |||||
| if (node->type == GEO_NODE_CURVE_SPLINE_PARAMETER) { | |||||
| nodeAddStaticSocketIfNotExists( | |||||
JacquesLucke: Either increase the subversion or check if the socket exists already (making the versioning… | |||||
| ntree, node, SOCK_OUT, SOCK_INT, PROP_NONE, "Index", "Index"); | |||||
| } | |||||
| } | |||||
| } | |||||
| /* Keep this block, even when empty. */ | /* Keep this block, even when empty. */ | ||||
| } | } | ||||
| } | } | ||||
Either increase the subversion or check if the socket exists already (making the versioning code idempotent). I prefer the second option. Feel free to add an utility method.
(btw, you don't see the socket in Blender, because it will be removed automatically again based on the declaration, but we don't want to depend on that)
You can use nodeAddStaticSocket instead of calling nodeStaticSocketType manually.