[Bf-blender-cvs] [7773a8ad048] blender2.8: Indicate to users when manual conversion of Eevee materials is needed

Dalai Felinto noreply at git.blender.org
Thu Jun 22 10:48:47 CEST 2017


Commit: 7773a8ad0482a3069f82b3321b3c492b1f2e5059
Author: Dalai Felinto
Date:   Thu Jun 22 10:32:50 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB7773a8ad0482a3069f82b3321b3c492b1f2e5059

Indicate to users when manual conversion of Eevee materials is needed

We now shows a report error when user opens a file that need fixing.
It's fine(ish) to not do doversion. It's not fine to not communicate that.

===================================================================

M	source/blender/blenloader/intern/versioning_280.c

===================================================================

diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 9379c605fe8..664f1e07f71 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -50,6 +50,7 @@
 #include "BKE_main.h"
 #include "BKE_mesh.h"
 #include "BKE_node.h"
+#include "BKE_report.h"
 #include "BKE_scene.h"
 #include "BKE_workspace.h"
 
@@ -425,19 +426,26 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
 			/* Eevee shader nodes renamed because of the output node system.
 			 * Note that a new output node is not being added here, because it would be overkill
 			 * to handle this case in lib_verify_nodetree. */
+			bool error = false;
 			FOREACH_NODETREE(main, ntree, id) {
 				if (ntree->type == NTREE_SHADER) {
 					for (bNode *node = ntree->nodes.first; node; node = node->next) {
 						if (node->type == SH_NODE_EEVEE_METALLIC && STREQ(node->idname, "ShaderNodeOutputMetallic")) {
 							BLI_strncpy(node->idname, "ShaderNodeEeveeMetallic", sizeof(node->idname));
+							error = true;
 						}
 
 						if (node->type == SH_NODE_EEVEE_SPECULAR && STREQ(node->idname, "ShaderNodeOutputSpecular")) {
 							BLI_strncpy(node->idname, "ShaderNodeEeveeSpecular", sizeof(node->idname));
+							error = true;
 						}
 					}
 				}
 			} FOREACH_NODETREE_END
+			if (error) {
+				BKE_report(fd->reports, RPT_ERROR, "Eevee material conversion problem. Error in console");
+				printf("You need to connect Eevee Metallic and Specular shader nodes to new material output nodes.\n");
+			}
 		}
 	}
 }




More information about the Bf-blender-cvs mailing list