Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2015-03-23 20:33:50 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-03-24 17:49:18 +0300
commiteb9826d8d9c71989cf4232d96f0e1ea332ede6d2 (patch)
tree46009830f43cbc71003e93a02bc5e4794feaf50b
parentc7dc142c1ba56057c9281ebdd514c8412c4cf2bc (diff)
Versioning code to correct socket naming after
340b76b42c53816ddac1b4cecdff3d8d2010a9cc Reported by formerly Old_Demon on blenderartists. Apparently this caused old files to lose their links to material sockets (noob own mistake from inexperience with node system). This should either be included in release with version checking being set to version 2.73 and subversion 10, without tweaking the BKE_blender.h file OR 340b76b42c53816ddac1b4cecdff3d8d2010a9cc should be reverted for this release. Thanks to Lukas for checking this out. Conflicts: source/blender/blenkernel/BKE_blender.h source/blender/blenloader/intern/versioning_270.c
-rw-r--r--source/blender/blenloader/intern/versioning_270.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index 735ed199e3d..cd0869f0e54 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -643,4 +643,32 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
+ if (!MAIN_VERSION_ATLEAST(main, 274, 3)) {
+ FOREACH_NODETREE(main, ntree, id)
+ {
+ bNode *node;
+ bNodeSocket *sock;
+
+ for (node = ntree->nodes.first; node; node = node->next) {
+ if (node->type == SH_NODE_MATERIAL) {
+ for (sock = node->inputs.first; sock; sock = sock->next) {
+ if (STREQ(sock->name, "Refl")) {
+ BLI_strncpy(sock->name, "DiffuseIntensity", sizeof(sock->name));
+ }
+ }
+ }
+ else if (node->type == SH_NODE_MATERIAL_EXT) {
+ for (sock = node->outputs.first; sock; sock = sock->next) {
+ if (STREQ(sock->name, "Refl")) {
+ BLI_strncpy(sock->name, "DiffuseIntensity", sizeof(sock->name));
+ }
+ else if (STREQ(sock->name, "Ray Mirror")) {
+ BLI_strncpy(sock->name, "Reflectivity", sizeof(sock->name));
+ }
+ }
+ }
+ }
+ }
+ FOREACH_NODETREE_END
+ }
}