From 09fe0e8aa94c10aa941cb09ab6eb80b8fbb097b4 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 13 Jan 2021 12:25:31 +0100 Subject: [PATCH 1/3] Nodes: use green color again for shader sockets and shader category The green is still distinct from the more turquoise use for geometry, and they are never used in the same node graph. The use of red makes sense, but would need changes to other sockets and categories to set it apart well. Ref T82689 --- release/datafiles/userdef/userdef_default_theme.c | 2 +- source/blender/blenkernel/BKE_blender_version.h | 2 +- source/blender/blenloader/intern/versioning_userdef.c | 2 +- source/blender/editors/space_node/drawnode.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/release/datafiles/userdef/userdef_default_theme.c b/release/datafiles/userdef/userdef_default_theme.c index 53e8cd38d02..191758277ed 100644 --- a/release/datafiles/userdef/userdef_default_theme.c +++ b/release/datafiles/userdef/userdef_default_theme.c @@ -836,7 +836,7 @@ const bTheme U_theme_default = { .nodeclass_filter = RGBA(0x584d80ff), .nodeclass_vector = RGBA(0x9b80ffff), .nodeclass_texture = RGBA(0xe68745ff), - .nodeclass_shader = RGBA(0xea7581ff), + .nodeclass_shader = RGBA(0x63c763ff), .nodeclass_script = RGBA(0x084d4dff), .nodeclass_pattern = RGBA(0x6c696fff), .nodeclass_layout = RGBA(0x6c696fff), diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index a30141aa20e..c299edf55ee 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -39,7 +39,7 @@ extern "C" { /* Blender file format version. */ #define BLENDER_FILE_VERSION BLENDER_VERSION -#define BLENDER_FILE_SUBVERSION 11 +#define BLENDER_FILE_SUBVERSION 12 /* Minimum Blender version that supports reading file written with the current * version. Older Blender versions will test this and show a warning if the file diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c index b9f09e0326d..0bc1cc4a05c 100644 --- a/source/blender/blenloader/intern/versioning_userdef.c +++ b/source/blender/blenloader/intern/versioning_userdef.c @@ -257,7 +257,7 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme) FROM_DEFAULT_V4_UCHAR(space_node.nodeclass_attribute); } - if (!USER_VERSION_ATLEAST(292, 6)) { + if (!USER_VERSION_ATLEAST(292, 12)) { FROM_DEFAULT_V4_UCHAR(space_node.nodeclass_shader); } diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index fa71561b2f5..ad975196981 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -3525,7 +3525,7 @@ static const float std_node_socket_colors[][4] = { {0.63, 0.63, 0.63, 1.0}, /* SOCK_FLOAT */ {0.39, 0.39, 0.78, 1.0}, /* SOCK_VECTOR */ {0.78, 0.78, 0.16, 1.0}, /* SOCK_RGBA */ - {0.88, 0.43, 0.46, 1.0}, /* SOCK_SHADER */ + {0.39, 0.78, 0.39, 1.0}, /* SOCK_SHADER */ {0.80, 0.65, 0.84, 1.0}, /* SOCK_BOOLEAN */ {0.0, 0.0, 0.0, 1.0}, /*__SOCK_MESH (deprecated) */ {0.25, 0.75, 0.26, 1.0}, /* SOCK_INT */ From 08ee5573a92959c6739fb47541bdd20d1e72306b Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 13 Jan 2021 18:04:23 +0100 Subject: [PATCH 2/3] Fix Python warnings in node editor after revert of datablock changes Revert was done in 2771dfd, ref T84669 --- .../startup/bl_ui/properties_grease_pencil_common.py | 2 +- release/scripts/startup/bl_ui/space_node.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py index 80e5b49f4fe..8b404c4a306 100644 --- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py +++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py @@ -592,7 +592,7 @@ class GreasePencilMaterialsPanel: if show_full_ui: row = layout.row() - row.template_ID(ob, "active_material", new="material.new", duplicate="material.duplicate", live_icon=True) + row.template_ID(ob, "active_material", new="material.new", live_icon=True) slot = context.material_slot if slot: diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 0177579c5c2..e6af83b61f4 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -93,10 +93,10 @@ class NODE_HT_header(Header): # Show material.new when no active ID/slot exists if not id_from and ob_type in types_that_support_material: - row.template_ID(ob, "active_material", new="material.new", duplicate="material.duplicate") + row.template_ID(ob, "active_material", new="material.new") # Material ID, but not for Lights if id_from and ob_type != 'LIGHT': - row.template_ID(id_from, "active_material", new="material.new", duplicate="material.duplicate") + row.template_ID(id_from, "active_material", new="material.new") if snode.shader_type == 'WORLD': NODE_MT_editor_menus.draw_collapsible(context, layout) @@ -109,7 +109,7 @@ class NODE_HT_header(Header): row = layout.row() row.enabled = not snode.pin - row.template_ID(scene, "world", new="world.new", duplicate="world.duplicate") + row.template_ID(scene, "world", new="world.new") if snode.shader_type == 'LINESTYLE': view_layer = context.view_layer From 9dab489d51a17e9dc0d1f6871c9bdbfe12861151 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Wed, 13 Jan 2021 11:16:11 -0600 Subject: [PATCH 3/3] Bump file subversion after recent node versioning commit --- .../blender/blenkernel/BKE_blender_version.h | 2 +- .../blender/blenloader/intern/versioning_290.c | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index c299edf55ee..a7960b6ce87 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -39,7 +39,7 @@ extern "C" { /* Blender file format version. */ #define BLENDER_FILE_VERSION BLENDER_VERSION -#define BLENDER_FILE_SUBVERSION 12 +#define BLENDER_FILE_SUBVERSION 13 /* Minimum Blender version that supports reading file written with the current * version. Older Blender versions will test this and show a warning if the file diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c index 5cb94159ab2..743985e7650 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -1561,6 +1561,16 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) FOREACH_NODETREE_END; } + if (!MAIN_VERSION_ATLEAST(bmain, 292, 13)) { + FOREACH_NODETREE_BEGIN (bmain, ntree, id) { + if (ntree->type == NTREE_GEOMETRY) { + version_node_socket_name(ntree, GEO_NODE_BOOLEAN, "Geometry A", "Geometry 1"); + version_node_socket_name(ntree, GEO_NODE_BOOLEAN, "Geometry B", "Geometry 2"); + } + } + FOREACH_NODETREE_END; + } + /** * Versioning code until next subversion bump goes here. * @@ -1572,13 +1582,5 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) */ { /* Keep this block, even when empty. */ - - FOREACH_NODETREE_BEGIN (bmain, ntree, id) { - if (ntree->type == NTREE_GEOMETRY) { - version_node_socket_name(ntree, GEO_NODE_BOOLEAN, "Geometry A", "Geometry 1"); - version_node_socket_name(ntree, GEO_NODE_BOOLEAN, "Geometry B", "Geometry 2"); - } - FOREACH_NODETREE_END; - } } }