WIP: Closures and deferred evaluation for geometry nodes #107842
|
@ -1634,6 +1634,11 @@ typedef struct bNodeFunctionSignature {
|
|||
int _pad;
|
||||
} bNodeFunctionSignature;
|
||||
|
||||
typedef struct NodeFunctionEvaluate {
|
||||
/* Expected signature of the function. */
|
||||
bNodeFunctionSignature signature;
|
||||
} NodeFunctionEvaluate;
|
||||
|
||||
/* script node mode */
|
||||
#define NODE_SCRIPT_INTERNAL 0
|
||||
#define NODE_SCRIPT_EXTERNAL 1
|
||||
|
|
|
@ -5544,6 +5544,14 @@ static void rna_def_node_function_signature(BlenderRNA *brna)
|
|||
|
||||
static void def_fn_evaluate(StructRNA *srna)
|
||||
{
|
||||
PropertyRNA *prop;
|
||||
|
||||
RNA_def_struct_sdna_from(srna, "NodeFunctionEvaluate", "storage");
|
||||
|
||||
prop = RNA_def_property(srna, "signature", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "signature");
|
||||
RNA_def_property_flag(prop, PROP_NEVER_NULL);
|
||||
RNA_def_property_ui_text(prop, "Signature", "Expected signature of the function");
|
||||
}
|
||||
|
||||
/* -- Shader Nodes ---------------------------------------------------------- */
|
||||
|
|
|
@ -18,6 +18,12 @@ static void node_declare(NodeDeclarationBuilder &b)
|
|||
b.add_input<decl::Function>(N_("Function"));
|
||||
}
|
||||
|
||||
static void node_init(bNodeTree * /*tree*/, bNode *node)
|
||||
{
|
||||
NodeFunctionEvaluate *data = MEM_cnew<NodeFunctionEvaluate>(__func__);
|
||||
node->storage = data;
|
||||
}
|
||||
|
||||
static void node_update(bNodeTree *ntree, bNode *node)
|
||||
{
|
||||
}
|
||||
|
@ -37,6 +43,9 @@ void register_node_type_fn_evaluate()
|
|||
fn_node_type_base(&ntype, FN_NODE_EVALUATE, "Evaluate", NODE_CLASS_GROUP);
|
||||
ntype.declare = file_ns::node_declare;
|
||||
ntype.draw_buttons = file_ns::node_layout;
|
||||
ntype.initfunc = file_ns::node_init;
|
||||
ntype.updatefunc = file_ns::node_update;
|
||||
node_type_storage(
|
||||
&ntype, "NodeFunctionEvaluate", node_free_standard_storage, node_copy_standard_storage);
|
||||
nodeRegisterType(&ntype);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue