Blender V4.3
node_fn_transform_direction.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#include "BLI_math_matrix.hh"
6
8
10
12{
13 b.is_function_node();
14 b.add_input<decl::Vector>("Direction").subtype(PROP_XYZ);
15 b.add_input<decl::Matrix>("Transform");
16 b.add_output<decl::Vector>("Direction").subtype(PROP_XYZ);
17}
18
20{
21 static auto fn = mf::build::SI2_SO<float3, float4x4, float3>(
22 "Transform Direction", [](float3 direction, float4x4 matrix) {
23 return math::transform_direction(matrix, direction);
24 });
25 builder.set_matching_fn(fn);
26}
27
28static void node_register()
29{
30 static blender::bke::bNodeType ntype;
32 &ntype, FN_NODE_TRANSFORM_DIRECTION, "Transform Direction", NODE_CLASS_CONVERTER);
33 ntype.declare = node_declare;
36}
38
39} // namespace blender::nodes::node_fn_transform_direction_cc
#define NODE_CLASS_CONVERTER
Definition BKE_node.hh:410
#define NOD_REGISTER_NODE(REGISTER_FUNC)
@ PROP_XYZ
Definition RNA_types.hh:172
void set_matching_fn(const mf::MultiFunction *fn)
local_group_size(16, 16) .push_constant(Type b
void node_register_type(bNodeType *ntype)
Definition node.cc:1708
VecBase< T, 3 > transform_direction(const MatBase< T, 3, 3 > &mat, const VecBase< T, 3 > &direction)
static void node_declare(NodeDeclarationBuilder &b)
static void node_build_multi_function(NodeMultiFunctionBuilder &builder)
void fn_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
Defines a node type.
Definition BKE_node.hh:218
NodeMultiFunctionBuildFunction build_multi_function
Definition BKE_node.hh:336
NodeDeclareFunction declare
Definition BKE_node.hh:347