diff options
Diffstat (limited to 'source/blender/editors/space_node/drawnode.c')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 51 |
1 files changed, 46 insertions, 5 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index b5bb635b544..50e657bbb61 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -423,6 +423,7 @@ static void node_shader_buts_dynamic(uiLayout *layout, bContext *C, PointerRNA * /* only once called */ static void node_shader_set_butfunc(bNodeType *ntype) { + ntype->uifuncbut = NULL; switch(ntype->type) { /* case NODE_GROUP: note, typeinfo for group is generated... see "XXX ugly hack" */ @@ -472,6 +473,7 @@ static void node_shader_set_butfunc(bNodeType *ntype) default: ntype->uifunc= NULL; } + if (ntype->uifuncbut == NULL) ntype->uifuncbut = ntype->uifunc; } /* ****************** BUTTON CALLBACKS FOR COMPOSITE NODES ***************** */ @@ -862,7 +864,7 @@ static void node_composit_buts_color_spill(uiLayout *layout, bContext *UNUSED(C) uiItemR(col, ptr, "ratio", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(col, ptr, "use_unspill", 0, NULL, ICON_NONE); - if (RNA_enum_get(ptr, "use_unspill")== 1) { + if (RNA_boolean_get(ptr, "use_unspill")== 1) { uiItemR(col, ptr, "unspill_red", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(col, ptr, "unspill_green", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(col, ptr, "unspill_blue", UI_ITEM_R_SLIDER, NULL, ICON_NONE); @@ -1036,6 +1038,32 @@ static void node_composit_buts_colorbalance(uiLayout *layout, bContext *UNUSED(C } } +static void node_composit_buts_colorbalance_but(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +{ + uiItemR(layout, ptr, "correction_method", 0, NULL, ICON_NONE); + + if (RNA_enum_get(ptr, "correction_method")== 0) { + + uiTemplateColorWheel(layout, ptr, "lift", 1, 1, 0, 1); + uiItemR(layout, ptr, "lift", 0, NULL, ICON_NONE); + + uiTemplateColorWheel(layout, ptr, "gamma", 1, 1, 1, 1); + uiItemR(layout, ptr, "gamma", 0, NULL, ICON_NONE); + + uiTemplateColorWheel(layout, ptr, "gain", 1, 1, 1, 1); + uiItemR(layout, ptr, "gain", 0, NULL, ICON_NONE); + } else { + uiTemplateColorWheel(layout, ptr, "offset", 1, 1, 0, 1); + uiItemR(layout, ptr, "offset", 0, NULL, ICON_NONE); + + uiTemplateColorWheel(layout, ptr, "power", 1, 1, 0, 1); + uiItemR(layout, ptr, "power", 0, NULL, ICON_NONE); + + uiTemplateColorWheel(layout, ptr, "slope", 1, 1, 0, 1); + uiItemR(layout, ptr, "slope", 0, NULL, ICON_NONE); + } +} + static void node_composit_buts_huecorrect(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { @@ -1050,6 +1078,7 @@ static void node_composit_buts_ycc(uiLayout *layout, bContext *UNUSED(C), Pointe /* only once called */ static void node_composit_set_butfunc(bNodeType *ntype) { + ntype->uifuncbut = NULL; switch(ntype->type) { /* case NODE_GROUP: note, typeinfo for group is generated... see "XXX ugly hack" */ @@ -1184,6 +1213,7 @@ static void node_composit_set_butfunc(bNodeType *ntype) break; case CMP_NODE_COLORBALANCE: ntype->uifunc=node_composit_buts_colorbalance; + ntype->uifuncbut=node_composit_buts_colorbalance_but; break; case CMP_NODE_HUECORRECT: ntype->uifunc=node_composit_buts_huecorrect; @@ -1198,6 +1228,8 @@ static void node_composit_set_butfunc(bNodeType *ntype) default: ntype->uifunc= NULL; } + if (ntype->uifuncbut == NULL) ntype->uifuncbut = ntype->uifunc; + } /* ****************** BUTTON CALLBACKS FOR TEXTURE NODES ***************** */ @@ -1308,6 +1340,7 @@ static void node_texture_buts_output(uiLayout *layout, bContext *UNUSED(C), Poin /* only once called */ static void node_texture_set_butfunc(bNodeType *ntype) { + ntype->uifuncbut = NULL; if( ntype->type >= TEX_NODE_PROC && ntype->type < TEX_NODE_PROC_MAX ) { ntype->uifunc = node_texture_buts_proc; } @@ -1352,6 +1385,7 @@ static void node_texture_set_butfunc(bNodeType *ntype) default: ntype->uifunc= NULL; } + if (ntype->uifuncbut == NULL) ntype->uifuncbut = ntype->uifunc; } /* ******* init draw callbacks for all tree types, only called in usiblender.c, once ************* */ @@ -1835,10 +1869,17 @@ void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link) else { /* check cyclic */ if(link->fromnode->level >= link->tonode->level && link->tonode->level!=0xFFF) { - if(link->fromnode->flag & SELECT) - th_col1= TH_EDGE_SELECT; - if(link->tonode->flag & SELECT) - th_col2= TH_EDGE_SELECT; + /* special indicated link, on drop-node */ + if(link->flag & NODE_LINKFLAG_HILITE) { + th_col1= th_col2= TH_ACTIVE; + } + else { + /* regular link */ + if(link->fromnode->flag & SELECT) + th_col1= TH_EDGE_SELECT; + if(link->tonode->flag & SELECT) + th_col2= TH_EDGE_SELECT; + } do_shaded= 1; do_triple= 1; } |