Blender V5.0
node_fn_matrix_determinant.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 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::Matrix>("Matrix");
15 b.add_output<decl::Float>("Determinant");
16}
17
19{
20 static auto fn = mf::build::SI1_SO<float4x4, float>(
21 "Matrix Determinant", [](const float4x4 &matrix) { return math::determinant(matrix); });
22 builder.set_matching_fn(fn);
23}
24
25static void node_register()
26{
27 static blender::bke::bNodeType ntype;
28 fn_node_type_base(&ntype, "FunctionNodeMatrixDeterminant", FN_NODE_MATRIX_DETERMINANT);
29 ntype.ui_name = "Matrix Determinant";
30 ntype.ui_description = "Compute the determinant of the given matrix";
31 ntype.enum_name_legacy = "MATRIX_DETERMINANT";
33 ntype.declare = node_declare;
36}
38
39} // namespace blender::nodes::node_fn_matrix_determinant_cc
#define NODE_CLASS_CONVERTER
Definition BKE_node.hh:453
#define FN_NODE_MATRIX_DETERMINANT
#define NOD_REGISTER_NODE(REGISTER_FUNC)
void set_matching_fn(const mf::MultiFunction *fn)
void node_register_type(bNodeType &ntype)
Definition node.cc:2416
T determinant(const MatBase< T, Size, Size > &mat)
static void node_build_multi_function(NodeMultiFunctionBuilder &builder)
static void node_declare(NodeDeclarationBuilder &b)
MatBase< float, 4, 4 > float4x4
void fn_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
Defines a node type.
Definition BKE_node.hh:238
std::string ui_description
Definition BKE_node.hh:244
NodeMultiFunctionBuildFunction build_multi_function
Definition BKE_node.hh:351
const char * enum_name_legacy
Definition BKE_node.hh:247
NodeDeclareFunction declare
Definition BKE_node.hh:362