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:
authorLeon Schittek <lone_noel>2022-03-22 17:57:50 +0300
committerHans Goudey <h.goudey@me.com>2022-03-22 17:57:50 +0300
commit7de3caa05d8de4aa9cf83bbeaaa298785f2366f8 (patch)
tree41bf8885453ee4029bdfe5b6997a18d980edcf35 /source/blender/nodes/function
parent6bbc3b56108193ed383fcab1261360901c4c340a (diff)
Fix: Drag link search doesn't always connect to socket
Connecting to some sockets of a few nodes via the drag link search would fail and trigger an assert, because the picked socket wasn't available. This was due to some sockets only being available with certain settings. This patch fixes these cases by adding the availability conditions of the socket to the node declaration with the `make_available` method or manually adding a `node_link_gather_search` function. Differential Revision: https://developer.blender.org/D14283
Diffstat (limited to 'source/blender/nodes/function')
-rw-r--r--source/blender/nodes/function/nodes/node_fn_rotate_euler.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/nodes/function/nodes/node_fn_rotate_euler.cc b/source/blender/nodes/function/nodes/node_fn_rotate_euler.cc
index 3718ce6f359..a4fc1a6bfd1 100644
--- a/source/blender/nodes/function/nodes/node_fn_rotate_euler.cc
+++ b/source/blender/nodes/function/nodes/node_fn_rotate_euler.cc
@@ -15,11 +15,20 @@ namespace blender::nodes::node_fn_rotate_euler_cc {
static void fn_node_rotate_euler_declare(NodeDeclarationBuilder &b)
{
+ auto enable_axis_angle = [](bNode &node) {
+ node.custom1 = FN_NODE_ROTATE_EULER_TYPE_AXIS_ANGLE;
+ };
+
b.is_function_node();
b.add_input<decl::Vector>(N_("Rotation")).subtype(PROP_EULER).hide_value();
- b.add_input<decl::Vector>(N_("Rotate By")).subtype(PROP_EULER);
- b.add_input<decl::Vector>(N_("Axis")).default_value({0.0, 0.0, 1.0}).subtype(PROP_XYZ);
- b.add_input<decl::Float>(N_("Angle")).subtype(PROP_ANGLE);
+ b.add_input<decl::Vector>(N_("Rotate By")).subtype(PROP_EULER).make_available([](bNode &node) {
+ node.custom1 = FN_NODE_ROTATE_EULER_TYPE_EULER;
+ });
+ b.add_input<decl::Vector>(N_("Axis"))
+ .default_value({0.0, 0.0, 1.0})
+ .subtype(PROP_XYZ)
+ .make_available(enable_axis_angle);
+ b.add_input<decl::Float>(N_("Angle")).subtype(PROP_ANGLE).make_available(enable_axis_angle);
b.add_output<decl::Vector>(N_("Rotation"));
}