[Bf-blender-cvs] [ccecd97c8c4] blender-v3.1-release: Compositor: Fix Missing output UI for Normal node
Aaron Carlisle
noreply at git.blender.org
Thu Mar 31 13:21:59 CEST 2022
Commit: ccecd97c8c41e32f0c4212c48195f80163e850ab
Author: Aaron Carlisle
Date: Wed Mar 30 08:00:00 2022 -0400
Branches: blender-v3.1-release
https://developer.blender.org/rBccecd97c8c41e32f0c4212c48195f80163e850ab
Compositor: Fix Missing output UI for Normal node
There were multiple issues at hand here:
- The default value has been changed to `{0, 0, 1}` see: rB25f1783673de636a6f0ca4457df8c05bc685981a
- The output needs the subtype set `PROP_DIRECTION`
- The noder properties were missing in `node_composit_set_butfunc`
Fixes T96860
===================================================================
M source/blender/editors/space_node/drawnode.cc
M source/blender/nodes/composite/nodes/node_composite_normal.cc
===================================================================
diff --git a/source/blender/editors/space_node/drawnode.cc b/source/blender/editors/space_node/drawnode.cc
index 30f2cc970bd..e3bf656ddb4 100644
--- a/source/blender/editors/space_node/drawnode.cc
+++ b/source/blender/editors/space_node/drawnode.cc
@@ -797,6 +797,9 @@ static void node_composit_set_butfunc(bNodeType *ntype)
ntype->draw_buttons = node_composit_buts_image;
ntype->draw_buttons_ex = node_composit_buts_image_ex;
break;
+ case CMP_NODE_NORMAL:
+ ntype->draw_buttons = node_buts_normal;
+ break;
case CMP_NODE_CURVE_RGB:
ntype->draw_buttons = node_buts_curvecol;
break;
diff --git a/source/blender/nodes/composite/nodes/node_composite_normal.cc b/source/blender/nodes/composite/nodes/node_composite_normal.cc
index da44d355966..7e8494426a8 100644
--- a/source/blender/nodes/composite/nodes/node_composite_normal.cc
+++ b/source/blender/nodes/composite/nodes/node_composite_normal.cc
@@ -30,11 +30,15 @@ namespace blender::nodes::node_composite_normal_cc {
static void cmp_node_normal_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Vector>(N_("Normal"))
- .default_value({1.0f, 1.0f, 1.0f})
+ .default_value({0.0f, 0.0f, 1.0f})
+ .min(-1.0f)
+ .max(1.0f)
+ .subtype(PROP_DIRECTION);
+ b.add_output<decl::Vector>(N_("Normal"))
+ .default_value({0.0f, 0.0f, 1.0f})
.min(-1.0f)
.max(1.0f)
.subtype(PROP_DIRECTION);
- b.add_output<decl::Vector>(N_("Normal"));
b.add_output<decl::Float>(N_("Dot"));
}
More information about the Bf-blender-cvs
mailing list