diff options
author | Luca Rood <dev@lucarood.com> | 2017-06-20 15:33:13 +0300 |
---|---|---|
committer | Luca Rood <dev@lucarood.com> | 2017-06-20 19:39:59 +0300 |
commit | 5c5c09439abdf2f759fbc3c17a4e773b9005d77f (patch) | |
tree | bce718ddb823f6623e9804b2aa16ddd1f52ed61f /source/blender/blenloader/intern/versioning_280.c | |
parent | aaf37e1216b2a9dfc43591e227c679a5b35af8c0 (diff) |
Clean node names and organize menus for eevee
This makes the node menus aware of the Cycles/Eevee distinction, and
only show the relevant nodes for the current engine. Names have also
been changed to accomodate for the new output node system.
Diffstat (limited to 'source/blender/blenloader/intern/versioning_280.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 97df428ee22..9379c605fe8 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -28,6 +28,8 @@ /* allow readfile to use deprecated functionality */ #define DNA_DEPRECATED_ALLOW +#include <string.h> + #include "DNA_object_types.h" #include "DNA_camera_types.h" #include "DNA_gpu_types.h" @@ -47,12 +49,14 @@ #include "BKE_layer.h" #include "BKE_main.h" #include "BKE_mesh.h" +#include "BKE_node.h" #include "BKE_scene.h" #include "BKE_workspace.h" #include "BLI_listbase.h" #include "BLI_mempool.h" #include "BLI_string.h" +#include "BLI_utildefines.h" #include "BLO_readfile.h" #include "readfile.h" @@ -415,4 +419,25 @@ 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. */ + 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)); + } + + if (node->type == SH_NODE_EEVEE_SPECULAR && STREQ(node->idname, "ShaderNodeOutputSpecular")) { + BLI_strncpy(node->idname, "ShaderNodeEeveeSpecular", sizeof(node->idname)); + } + } + } + } FOREACH_NODETREE_END + } + } } |