diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-11-17 20:11:02 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-11-17 20:11:02 +0400 |
commit | 469324b049012667a083017afa21538026008734 (patch) | |
tree | 5b3b1e12364ea0962e7f3907416dcf390446965b /source/blender/editors/space_node | |
parent | e2b58126a21df283c8f3ab93bc3c46b57825f69d (diff) |
Fix compositing normal node not properly showing vector XYZ values when opening
socket menu, and make the normal animatable.
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index e842bb5f262..99bdb8d6fe9 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -398,29 +398,15 @@ static void node_buts_curvecol(uiLayout *layout, bContext *UNUSED(C), PointerRNA uiTemplateCurveMapping(layout, ptr, "mapping", 'c', 0, 0); } -static void node_normal_cb(bContext *C, void *ntree_v, void *node_v) -{ - Main *bmain = CTX_data_main(C); - - ED_node_generic_update(bmain, ntree_v, node_v); - WM_event_add_notifier(C, NC_NODE | NA_EDITED, ntree_v); -} - static void node_buts_normal(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { - uiBlock *block = uiLayoutAbsoluteBlock(layout); - bNodeTree *ntree = ptr->id.data; - bNode *node = ptr->data; - rctf *butr = &node->butr; + bNodeTree *ntree = (bNodeTree*)ptr->id.data; + bNode *node = (bNode*)ptr->data; bNodeSocket *sock = node->outputs.first; /* first socket stores normal */ - float *nor = ((bNodeSocketValueVector *)sock->default_value)->value; - uiBut *bt; - - bt = uiDefButF(block, BUT_NORMAL, B_NODE_EXEC, "", - (int)butr->xmin, (int)butr->xmin, - (short)BLI_rctf_size_x(butr), (short)BLI_rctf_size_x(butr), - nor, 0.0f, 1.0f, 0, 0, ""); - uiButSetFunc(bt, node_normal_cb, ntree, node); + PointerRNA sockptr; + + RNA_pointer_create(&ntree->id, &RNA_NodeSocket, sock, &sockptr); + uiItemR(layout, &sockptr, "default_value", 0, "", ICON_NONE); } #if 0 /* not used in 2.5x yet */ static void node_browse_tex_cb(bContext *C, void *ntree_v, void *node_v) |