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:
authorOmarSquircleArt <omar.squircleart@gmail.com>2019-08-16 18:59:12 +0300
committerOmarSquircleArt <omar.squircleart@gmail.com>2019-08-16 18:59:12 +0300
commit25f1783673de636a6f0ca4457df8c05bc685981a (patch)
tree7ecfedcc1eb9dfce5963f6d7ebd647795712a508
parent39288768b5740fa621a1355334ffa878bfaa33b0 (diff)
Fix T68702: Input socket in the Normal node isn't drawn properly.
The Normal vector socket in the Normal node wasn't drawn properly and couldn't be controlled. Additionally, the socket name was drawn over it. This happened because the socket had a default value of a zero vector. To fix this, we set the default value to the unit vector `(0, 0, 1)`. Moreover, we don't draw the UI name if the subtype is `PROP_DIRECTION`. Reviewers: brecht Differential Revision: https://developer.blender.org/D5503
-rw-r--r--source/blender/editors/space_node/drawnode.c9
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_normal.c2
2 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 748e485f614..c3ecc34aaf4 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -3358,8 +3358,13 @@ static void std_node_socket_draw(
uiTemplateComponentMenu(layout, ptr, "default_value", text);
}
else {
- uiLayout *column = uiLayoutColumn(layout, true);
- uiItemR(column, ptr, "default_value", 0, text, 0);
+ if (sock->typeinfo->subtype == PROP_DIRECTION) {
+ uiItemR(layout, ptr, "default_value", 0, "", ICON_NONE);
+ }
+ else {
+ uiLayout *column = uiLayoutColumn(layout, true);
+ uiItemR(column, ptr, "default_value", 0, text, ICON_NONE);
+ }
}
break;
case SOCK_RGBA:
diff --git a/source/blender/nodes/shader/nodes/node_shader_normal.c b/source/blender/nodes/shader/nodes/node_shader_normal.c
index 074cc3dd87f..9dd89258446 100644
--- a/source/blender/nodes/shader/nodes/node_shader_normal.c
+++ b/source/blender/nodes/shader/nodes/node_shader_normal.c
@@ -25,7 +25,7 @@
/* **************** NORMAL ******************** */
static bNodeSocketTemplate sh_node_normal_in[] = {
- {SOCK_VECTOR, 1, N_("Normal"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_DIRECTION},
+ {SOCK_VECTOR, 1, N_("Normal"), 0.0f, 0.0f, 1.0f, 0.0f, -1.0f, 1.0f, PROP_DIRECTION},
{-1, 0, ""},
};