Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/versioning_300.c
| Show First 20 Lines • Show All 2,176 Lines • ▼ Show 20 Lines | void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) | ||||
| } | } | ||||
| if (!MAIN_VERSION_ATLEAST(bmain, 300, 36)) { | if (!MAIN_VERSION_ATLEAST(bmain, 300, 36)) { | ||||
| /* Update the `idnames` for renamed geometry and function nodes. */ | /* Update the `idnames` for renamed geometry and function nodes. */ | ||||
| LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) { | LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) { | ||||
| if (ntree->type != NTREE_GEOMETRY) { | if (ntree->type != NTREE_GEOMETRY) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| version_node_id(ntree, FN_NODE_COMPARE_FLOATS, "FunctionNodeCompareFloats"); | version_node_id(ntree, FN_NODE_COMPARE, "FunctionNodeCompareFloats"); | ||||
| version_node_id(ntree, GEO_NODE_CAPTURE_ATTRIBUTE, "GeometryNodeCaptureAttribute"); | version_node_id(ntree, GEO_NODE_CAPTURE_ATTRIBUTE, "GeometryNodeCaptureAttribute"); | ||||
| version_node_id(ntree, GEO_NODE_MESH_BOOLEAN, "GeometryNodeMeshBoolean"); | version_node_id(ntree, GEO_NODE_MESH_BOOLEAN, "GeometryNodeMeshBoolean"); | ||||
| version_node_id(ntree, GEO_NODE_FILL_CURVE, "GeometryNodeFillCurve"); | version_node_id(ntree, GEO_NODE_FILL_CURVE, "GeometryNodeFillCurve"); | ||||
| version_node_id(ntree, GEO_NODE_FILLET_CURVE, "GeometryNodeFilletCurve"); | version_node_id(ntree, GEO_NODE_FILLET_CURVE, "GeometryNodeFilletCurve"); | ||||
| version_node_id(ntree, GEO_NODE_REVERSE_CURVE, "GeometryNodeReverseCurve"); | version_node_id(ntree, GEO_NODE_REVERSE_CURVE, "GeometryNodeReverseCurve"); | ||||
| version_node_id(ntree, GEO_NODE_SAMPLE_CURVE, "GeometryNodeSampleCurve"); | version_node_id(ntree, GEO_NODE_SAMPLE_CURVE, "GeometryNodeSampleCurve"); | ||||
| version_node_id(ntree, GEO_NODE_RESAMPLE_CURVE, "GeometryNodeResampleCurve"); | version_node_id(ntree, GEO_NODE_RESAMPLE_CURVE, "GeometryNodeResampleCurve"); | ||||
| version_node_id(ntree, GEO_NODE_SUBDIVIDE_CURVE, "GeometryNodeSubdivideCurve"); | version_node_id(ntree, GEO_NODE_SUBDIVIDE_CURVE, "GeometryNodeSubdivideCurve"); | ||||
| ▲ Show 20 Lines • Show All 196 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. | ||||
| */ | */ | ||||
| { | { | ||||
| /* Update the compare floats node. */ | |||||
HooglyBoogly: Add a comment above this block: `/* Convert float compare into a more general compare node. */` | |||||
| LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) { | |||||
| if (ntree->type != NTREE_GEOMETRY) { | |||||
| continue; | |||||
| } | |||||
| LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { | |||||
| if (node->type == FN_NODE_COMPARE) { | |||||
| if (node->storage == NULL) { | |||||
| NodeFunctionCompare *data = (NodeFunctionCompare *)MEM_callocN( | |||||
| sizeof(NodeFunctionCompare), __func__); | |||||
| data->data_type = SOCK_FLOAT; | |||||
| data->operation = node->custom1; | |||||
| strcpy(node->idname, "FunctionNodeCompare"); | |||||
| node->update = NODE_UPDATE; | |||||
| node->storage = data; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| /* Keep this block, even when empty. */ | /* Keep this block, even when empty. */ | ||||
| } | } | ||||
| } | } | ||||
Add a comment above this block: /* Convert float compare into a more general compare node. */