[Bf-blender-cvs] [108a6d33f31] soc-2019-cycles-procedural: Fix Mapping node backward compatibility. Update socket names.
OmarSquircleArt
noreply at git.blender.org
Mon Aug 5 22:35:55 CEST 2019
Commit: 108a6d33f312118d26fdfda888370ba439257548
Author: OmarSquircleArt
Date: Mon Aug 5 17:08:20 2019 +0200
Branches: soc-2019-cycles-procedural
https://developer.blender.org/rB108a6d33f312118d26fdfda888370ba439257548
Fix Mapping node backward compatibility. Update socket names.
===================================================================
M source/blender/blenloader/intern/versioning_cycles.c
===================================================================
diff --git a/source/blender/blenloader/intern/versioning_cycles.c b/source/blender/blenloader/intern/versioning_cycles.c
index dce6d1ffa21..be75cd6c334 100644
--- a/source/blender/blenloader/intern/versioning_cycles.c
+++ b/source/blender/blenloader/intern/versioning_cycles.c
@@ -830,6 +830,21 @@ static void update_vector_math_average_operator(bNodeTree *ntree)
}
}
+/* The name of the output socket of the Mapping node was changed. So we have to
+ * update it here. The socket's identifier needs to be updated as well since it
+ * is autmatically generated from the name.
+ */
+static void update_mapping_output_name_and_identifier(bNodeTree *ntree)
+{
+ for (bNode *node = ntree->nodes.first; node; node = node->next) {
+ if (node->type == SH_NODE_MAPPING) {
+ bNodeSocket *sockResult = node->outputs.first;
+ strcpy(sockResult->name, "Result");
+ strcpy(sockResult->identifier, "Result");
+ }
+ }
+}
+
void blo_do_versions_cycles(FileData *UNUSED(fd), Library *UNUSED(lib), Main *bmain)
{
/* Particle shape shared with Eevee. */
@@ -870,6 +885,8 @@ void blo_do_versions_cycles(FileData *UNUSED(fd), Library *UNUSED(lib), Main *bm
update_vector_math_socket_names_and_identifiers(ntree);
update_vector_math_operators_enum_mapping(ntree);
+
+ update_mapping_output_name_and_identifier(ntree);
}
}
FOREACH_NODETREE_END;
More information about the Bf-blender-cvs
mailing list