-
Notifications
You must be signed in to change notification settings - Fork 18
Development Notes
David Millán Escrivá edited this page Nov 26, 2013
·
4 revisions
This files define how to show in node view the custom variables or the different properties
/source/blender/makesrna/intern/rna_nodetree_types.h : 123
/source/blender/makesrna/intern/rna_nodetree.c : 2416
/source/blender/makesrna/RNA_access.h:175
/source/blender/editors/space_node/drawnode.c:1679 and 1834
This file define the draw function and data structure to use
/source/blender/makesrna/intern/rna_nodetree_types.h : 123
DefNode( CompositorNode, CMP_NODE_CVTHRESHOLD, def_cmp_bocv_threshold, "CVTHRESHOLD", CvThreshold, "OpenCV - Threshold", "" )
For each node that need custom data this will be draw in the node and mapped to a variable. This is the purpose of this file.
/source/blender/makesrna/intern/rna_nodetree.c : 2416
static void def_cmp_bocv_threshold(StructRNA *srna)
{
...
}
We must define the RNA drawing and structure function. as an extenr StructRNA
/source/blender/makesrna/RNA_access.h:175
extern StructRNA RNA_CompositorNodeCvThreshold;
And define in node space the buttons to use when the node is choosed.
/source/blender/editors/space_node/drawnode.c:1679 and 1834
static void node_composit_buts_cvthreshold(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "cvthreshold_type", 0, "", ICON_NONE);
}
...
/* only once called */
static void node_composit_set_butfunc(bNodeType *ntype)
{
ntype->uifuncbut = NULL;
switch(ntype->type) {
...
case CMP_NODE_CVTHRESHOLD:
ntype->uifunc=node_composit_buts_cvthreshold;
break;
...