diff options
author | Ton Roosendaal <ton@blender.org> | 2009-02-06 16:07:02 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-02-06 16:07:02 +0300 |
commit | 1646f053a5db0e4cdfc994ad302cf87046000c67 (patch) | |
tree | 6ab0b23b20a4f3e098421c9ec4526b22e1a0b98e /source/blender | |
parent | 9d5958f061b662039d1ab19aab19e44098769e63 (diff) |
2.5
Compo node fixes:
- adding new composite in scene crashed, wrong pointers passed on to
addnode function
- scene render-layer node now gets default scene ID pointer, which
can be viewed/edited with menu in node
- on using headerbuttons in node window, display refreshes now
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_edit.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_header.c | 20 |
3 files changed, 14 insertions, 18 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index a1a7a32bf28..028cba327ac 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -1051,10 +1051,8 @@ static void node_browse_scene_cb(bContext *C, void *ntree_v, void *node_v) node->id= NULL; } sce= BLI_findlink(&G.main->scene, node->menunr-1); - if(sce!=CTX_data_scene(C)) { - node->id= &sce->id; - id_us_plus(node->id); - } + node->id= &sce->id; + id_us_plus(node->id); set_render_layers_title(C, node, NULL); nodeSetActive(ntree, node); diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index b317c01e6c6..ed808b0dac8 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -510,11 +510,13 @@ void node_composit_default(Scene *sce) sce->nodetree= ntreeAddTree(NTREE_COMPOSIT); - out= nodeAddNodeType(sce->nodetree, CMP_NODE_COMPOSITE, NULL, &sce->id); + out= nodeAddNodeType(sce->nodetree, CMP_NODE_COMPOSITE, NULL, NULL); out->locx= 300.0f; out->locy= 400.0f; + out->id= &sce->id; - in= nodeAddNodeType(sce->nodetree, CMP_NODE_R_LAYERS, NULL, &sce->id); + in= nodeAddNodeType(sce->nodetree, CMP_NODE_R_LAYERS, NULL, NULL); in->locx= 10.0f; in->locy= 400.0f; + in->id= &sce->id; nodeSetActive(sce->nodetree, in); /* links from color to color */ diff --git a/source/blender/editors/space_node/node_header.c b/source/blender/editors/space_node/node_header.c index eb5e85cc001..d25eefcb45e 100644 --- a/source/blender/editors/space_node/node_header.c +++ b/source/blender/editors/space_node/node_header.c @@ -648,14 +648,17 @@ static uiBlock *node_viewmenu(bContext *C, ARegion *ar, void *arg_unused) static void do_node_buttons(bContext *C, void *arg, int event) { - // NODE_FIX_ME : instead of using "current material/texture/scene" a la old buttons/G.scene - // have a panel from which enumerates textures, materials and scenes. + // NODE_FIX_ME : instead of using "current material/texture/scene", node editor can also pin context? + // note: scene context better not gets overridden, that'll clash too much (ton) SpaceNode *snode= (SpaceNode*)CTX_wm_space_data(C); Scene *scene= CTX_data_scene(C); Material *ma; Tex *tx; switch(event) { + case B_REDR: + ED_area_tag_redraw(CTX_wm_area(C)); + break; case B_NODE_USEMAT: ma= (Material *)snode->id; if(ma) { @@ -663,21 +666,17 @@ static void do_node_buttons(bContext *C, void *arg, int event) node_shader_default(ma); snode_set_context(snode, scene); } - /* BIF_preview_changed(ID_MA); - allqueue(REDRAWNODE, 0); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWIPO, 0);*/ } + ED_area_tag_redraw(CTX_wm_area(C)); break; case B_NODE_USESCENE: if(scene->use_nodes) { if(scene->nodetree==NULL) node_composit_default(scene); - // addqueue(curarea->win, UI_BUT_EVENT, B_NODE_TREE_EXEC); } snode_set_context(snode, scene); - // allqueue(REDRAWNODE, 0); + ED_area_tag_redraw(CTX_wm_area(C)); break; case B_NODE_USETEX: @@ -688,11 +687,8 @@ static void do_node_buttons(bContext *C, void *arg, int event) node_texture_default(tx); snode_set_context(snode, scene); } - /* BIF_preview_changed(ID_TE); - allqueue(REDRAWNODE, 0); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWIPO, 0);*/ } + ED_area_tag_redraw(CTX_wm_area(C)); break; } } |