Revision: 18830
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18830
Author:   ton
Date:     2009-02-06 14:07:02 +0100 (Fri, 06 Feb 2009)

Log Message:
-----------
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

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/space_node/drawnode.c
    branches/blender2.5/blender/source/blender/editors/space_node/node_edit.c
    branches/blender2.5/blender/source/blender/editors/space_node/node_header.c

Modified: 
branches/blender2.5/blender/source/blender/editors/space_node/drawnode.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_node/drawnode.c    
2009-02-06 12:33:15 UTC (rev 18829)
+++ branches/blender2.5/blender/source/blender/editors/space_node/drawnode.c    
2009-02-06 13:07:02 UTC (rev 18830)
@@ -1051,10 +1051,8 @@
                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);

Modified: 
branches/blender2.5/blender/source/blender/editors/space_node/node_edit.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_node/node_edit.c   
2009-02-06 12:33:15 UTC (rev 18829)
+++ branches/blender2.5/blender/source/blender/editors/space_node/node_edit.c   
2009-02-06 13:07:02 UTC (rev 18830)
@@ -510,11 +510,13 @@
        
        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 */

Modified: 
branches/blender2.5/blender/source/blender/editors/space_node/node_header.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_node/node_header.c 
2009-02-06 12:33:15 UTC (rev 18829)
+++ branches/blender2.5/blender/source/blender/editors/space_node/node_header.c 
2009-02-06 13:07:02 UTC (rev 18830)
@@ -648,14 +648,17 @@
 
 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 @@
                                        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 @@
                                        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;
        }
 }


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to