Commit: 6d65c2cff603d8bb007701e77ad83c4941f39a70
Author: Julian Eisel
Date:   Fri Aug 18 21:00:39 2017 +0200
Branches: topbar
https://developer.blender.org/rB6d65c2cff603d8bb007701e77ad83c4941f39a70

Merge branch 'blender2.8' into topbar

Conflicts:
        source/blender/editors/interface/resources.c

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



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

diff --cc source/blender/blenloader/intern/versioning_280.c
index 5a6fb3408c6,810bf5a3a46..b07c83b2dd8
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@@ -487,50 -433,61 +487,81 @@@ void blo_do_versions_280(FileData *fd, 
        }
  
        {
-               {
-                       /* 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;
-                                               }
+               typedef enum eNTreeDoVersionErrors {
+                       NTREE_DOVERSION_NO_ERROR = 0,
+                       NTREE_DOVERSION_NEED_OUTPUT = (1 << 0),
+                       NTREE_DOVERSION_TRANSPARENCY_EMISSION = (1 << 1),
+               } eNTreeDoVersionErrors;
+ 
+               /* 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.
+                *
+                * Also, metallic node is now unified into the principled node. 
*/
+               eNTreeDoVersionErrors error = NTREE_DOVERSION_NO_ERROR;
+ 
+               FOREACH_NODETREE(main, ntree, id) {
+                       if (ntree->type == NTREE_SHADER) {
+                               for (bNode *node = ntree->nodes.first; node; 
node = node->next) {
+                                       if (node->type == 194 /* 
SH_NODE_EEVEE_METALLIC */ &&
+                                               STREQ(node->idname, 
"ShaderNodeOutputMetallic"))
+                                       {
+                                               BLI_strncpy(node->idname, 
"ShaderNodeEeveeMetallic", sizeof(node->idname));
+                                               error |= 
NTREE_DOVERSION_NEED_OUTPUT;
+                                       }
  
-                                               if (node->type == 
SH_NODE_EEVEE_SPECULAR && STREQ(node->idname, "ShaderNodeOutputSpecular")) {
-                                                       
BLI_strncpy(node->idname, "ShaderNodeEeveeSpecular", sizeof(node->idname));
-                                                       error = true;
-                                               }
+                                       else if (node->type == 
SH_NODE_EEVEE_SPECULAR && STREQ(node->idname, "ShaderNodeOutputSpecular")) {
+                                               BLI_strncpy(node->idname, 
"ShaderNodeEeveeSpecular", sizeof(node->idname));
+                                               error |= 
NTREE_DOVERSION_NEED_OUTPUT;
+                                       }
+ 
+                                       else if (node->type == 196 /* 
SH_NODE_OUTPUT_EEVEE_MATERIAL */ &&
+                                                        STREQ(node->idname, 
"ShaderNodeOutputEeveeMaterial"))
+                                       {
+                                               node->type = 
SH_NODE_OUTPUT_MATERIAL;
+                                               BLI_strncpy(node->idname, 
"ShaderNodeOutputMaterial", sizeof(node->idname));
+                                       }
+ 
+                                       else if (node->type == 194 /* 
SH_NODE_EEVEE_METALLIC */ &&
+                                                        STREQ(node->idname, 
"ShaderNodeEeveeMetallic"))
+                                       {
+                                               node->type = 
SH_NODE_BSDF_PRINCIPLED;
+                                               BLI_strncpy(node->idname, 
"ShaderNodeBsdfPrincipled", sizeof(node->idname));
+                                               node->custom1 = 
SHD_GLOSSY_MULTI_GGX;
+                                               error |= 
NTREE_DOVERSION_TRANSPARENCY_EMISSION;
                                        }
                                }
-                       } 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");
                        }
+               } FOREACH_NODETREE_END
+ 
+               if (error & NTREE_DOVERSION_NEED_OUTPUT) {
+                       BKE_report(fd->reports, RPT_ERROR, "Eevee material 
conversion problem. Error in console");
+                       printf("You need to connect Principled and Eevee 
Specular shader nodes to new material output nodes.\n");
+               }
+ 
+               if (error & NTREE_DOVERSION_TRANSPARENCY_EMISSION) {
+                       BKE_report(fd->reports, RPT_ERROR, "Eevee material 
conversion problem. Error in console");
+                       printf("You need to combine transparency and emission 
shaders to the converted Principled shader nodes.\n");
                }
        }
 +
 +      if (!DNA_struct_find(fd->filesdna, "SpaceTopBar")) {
 +              for (bScreen *screen = main->screen.first; screen; screen = 
screen->id.next) {
 +                      for (ScrArea *sa = screen->areabase.first; sa; sa = 
sa->next) {
 +                              for (SpaceLink *sl = sa->spacedata.first; sl; 
sl = sl->next) {
 +                                      ListBase *regionbase = (sl == 
sa->spacedata.first) ? &sa->regionbase : &sl->regionbase;
 +
 +                                      if (sl->spacetype == SPACE_VIEW3D) {
 +                                              for (ARegion *region = 
regionbase->first; region; region = region->next) {
 +                                                      if (region->regiontype 
== RGN_TYPE_TOOL_PROPS) {
 +                                                              
BKE_area_region_free(NULL, region);
 +                                                              
BLI_freelinkN(regionbase, region);
 +                                                              break;
 +                                                      }
 +                                              }
 +                                      }
 +                              }
 +                      }
 +              }
 +      }
  }
diff --cc source/blender/editors/interface/resources.c
index 29a449080cb,bf42316289f..cd90da24951
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@@ -2903,10 -2915,29 +2926,29 @@@ void init_userdef_do_versions(void
                        btheme->ttime.time_keyframe[3] = 
btheme->ttime.time_gp_keyframe[3] = 255;
                }
        }
+ 
+       if (!USER_VERSION_ATLEAST(278, 6)) {
+               /* Clear preference flags for re-use. */
+               U.flag &= ~(
+                   USER_FLAG_DEPRECATED_1 | USER_FLAG_DEPRECATED_2 | 
USER_FLAG_DEPRECATED_3 |
+                   USER_FLAG_DEPRECATED_6 | USER_FLAG_DEPRECATED_7 |
+                   USER_FLAG_DEPRECATED_9 | USER_FLAG_DEPRECATED_10);
+               U.uiflag &= ~(
+                   USER_UIFLAG_DEPRECATED_7);
+               U.transopts &= ~(
+                   USER_TR_DEPRECATED_2 | USER_TR_DEPRECATED_3 | 
USER_TR_DEPRECATED_4 |
+                   USER_TR_DEPRECATED_6 | USER_TR_DEPRECATED_7);
+               U.gameflags &= ~(
+                   USER_GL_RENDER_DEPRECATED_0 | USER_GL_RENDER_DEPRECATED_1 |
+                   USER_GL_RENDER_DEPRECATED_3 | USER_GL_RENDER_DEPRECATED_4);
+ 
+               U.uiflag |= USER_LOCK_CURSOR_ADJUST;
+       }
+ 
 -      if (!USER_VERSION_ATLEAST(280, 1)) {
 +      if (!USER_VERSION_ATLEAST(280, 2)) {
                /* interface_widgets.c */
                struct uiWidgetColors wcol_tab = {
 -                      {255, 255, 255, 255},
 +                      {60, 60, 60, 255},
                        {83, 83, 83, 255},
                        {114, 114, 114, 255},
                        {90, 90, 90, 255},

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to