15 b.use_custom_socket_order();
16 b.allow_any_socket_order();
20 .description(
"The inverted matrix or the identity matrix if the input is not invertible")
21 .align_with_previous();
23 .description(
"True if the input matrix is invertible");
32 mf::SignatureBuilder builder{
"Invert Matrix",
signature};
33 builder.single_input<
float4x4>(
"Matrix");
34 builder.single_output<
float4x4>(
"Matrix", mf::ParamFlag::SupportsUnusedOutput);
35 builder.single_output<
bool>(
"Invertible", mf::ParamFlag::SupportsUnusedOutput);
46 MutableSpan<bool> out_invertible = params.uninitialized_single_output_if_required<
bool>(
49 const float4x4 &matrix = in_matrices[i];
52 if (!out_matrices.is_empty()) {
55 if (!out_invertible.is_empty()) {
56 out_invertible[i] = success;
81 ntype.
ui_name =
"Invert Matrix";
82 ntype.
ui_description =
"Compute the inverse of the given matrix, if one exists";
#define NODE_CLASS_CONVERTER
#define FN_NODE_INVERT_MATRIX
#define NOD_REGISTER_NODE(REGISTER_FUNC)
const Signature & signature() const
void set_signature(const Signature *signature)
void set_matching_fn(const mf::MultiFunction *fn)
void call(const IndexMask &mask, mf::Params params, mf::Context) const override
void node_register_type(bNodeType &ntype)
CartesianBasis invert(const CartesianBasis &basis)
static void node_declare(NodeDeclarationBuilder &b)
static void node_build_multi_function(NodeMultiFunctionBuilder &builder)
static int node_gpu_material(GPUMaterial *material, bNode *node, bNodeExecData *, GPUNodeStack *inputs, GPUNodeStack *outputs)
static void node_register()
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
void fn_cmp_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
MatBase< float, 4, 4 > float4x4
static MatBase identity()
std::string ui_description
NodeGPUExecFunction gpu_fn
NodeMultiFunctionBuildFunction build_multi_function
const char * enum_name_legacy
NodeDeclareFunction declare