Revision: 24716
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24716
Author:   aligorith
Date:     2009-11-20 22:17:17 +0100 (Fri, 20 Nov 2009)

Log Message:
-----------
Nodes Editor: Restored 'Show Cyclic Dependencies' Operator (CKEY)

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/space_node.py
    trunk/blender/source/blender/editors/space_node/node_edit.c
    trunk/blender/source/blender/editors/space_node/node_intern.h
    trunk/blender/source/blender/editors/space_node/node_ops.c

Modified: trunk/blender/release/scripts/ui/space_node.py
===================================================================
--- trunk/blender/release/scripts/ui/space_node.py      2009-11-20 21:04:41 UTC 
(rev 24715)
+++ trunk/blender/release/scripts/ui/space_node.py      2009-11-20 21:17:17 UTC 
(rev 24716)
@@ -111,7 +111,7 @@
         
         layout.itemS()
 
-        layout.itemO("node.duplicate_move", text="Duplicate")
+        layout.itemO("node.duplicate_move")
         layout.itemO("node.delete")
 
         layout.itemS()
@@ -129,8 +129,10 @@
 
         # XXX
         # layout.itemO("node.rename")
-        # layout.itemS()
-        # layout.itemO("node.show_cyclic_dependencies")
+               
+        layout.itemS()
+               
+        layout.itemO("node.show_cyclic_dependencies")
 
 bpy.types.register(NODE_HT_header)
 bpy.types.register(NODE_MT_view)

Modified: trunk/blender/source/blender/editors/space_node/node_edit.c
===================================================================
--- trunk/blender/source/blender/editors/space_node/node_edit.c 2009-11-20 
21:04:41 UTC (rev 24715)
+++ trunk/blender/source/blender/editors/space_node/node_edit.c 2009-11-20 
21:17:17 UTC (rev 24716)
@@ -2059,7 +2059,7 @@
 void NODE_OT_hide(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name= "Hide Nodes";
+       ot->name= "Hide";
        ot->description= "Toggle hiding of the nodes.";
        ot->idname= "NODE_OT_hide";
        
@@ -2098,7 +2098,7 @@
 void NODE_OT_mute(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name= "Mute Nodes";
+       ot->name= "Mute";
        ot->description= "Toggle muting of the nodes.";
        ot->idname= "NODE_OT_mute";
        
@@ -2157,32 +2157,41 @@
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
+/* ****************** Show Cyclic Dependencies Operator  ******************* */
 
+static int node_show_cycles_exec(bContext *C, wmOperator *op)
+{
+       SpaceNode *snode= CTX_wm_space_node(C);
+       
+       /* this is just a wrapper around this call... */
+       ntreeSolveOrder(snode->edittree);
+       snode_handle_recalc(C, snode);
+       
+       return OPERATOR_FINISHED;
+}
+
+void NODE_OT_show_cyclic_dependencies(wmOperatorType *ot)
+{
+       /* identifiers */
+       ot->name= "Show Cyclic Dependencies";
+       ot->description= "Sort the nodes and show the cyclic dependencies 
between the nodes.";
+       ot->idname= "NODE_OT_show_cyclic_dependencies";
+       
+       /* callbacks */
+       ot->exec= node_show_cycles_exec;
+       ot->poll= ED_operator_node_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
 #if 0
 
 /* ******************** main event loop ****************** */
 
 void winqreadnodespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
 {
-       SpaceNode *snode= spacedata;
-       bNode *actnode;
-       bNodeSocket *actsock;
-       unsigned short event= evt->event;
-       short val= evt->val, doredraw=0, fromlib= 0;
-       
-       if(sa->win==0) return;
-       
-       if(snode->nodetree==NULL) {
-               /* no other events should be handled, but floating panels still 
should get handled */
-               uiDoBlocks(&curarea->uiblocks, event, 1);
-               return;
-       }
-       
        if(val) {
-               if( node_uiDoBlocks(sa, event)!=UI_NOTHING ) event= 0;
-               
-               fromlib= (snode->id && snode->id->lib);
-               
                switch(event) {
                case CKEY:      /* sort again, showing cyclics */
                        ntreeSolveOrder(snode->edittree);
@@ -2207,13 +2216,6 @@
                        break;
                }
        }
-
-       if(fromlib==-1)
-               error_libdata();
-       if(doredraw)
-               scrarea_queue_winredraw(sa);
-       if(doredraw==2)
-               scrarea_queue_headredraw(sa);
 }
 #endif
 

Modified: trunk/blender/source/blender/editors/space_node/node_intern.h
===================================================================
--- trunk/blender/source/blender/editors/space_node/node_intern.h       
2009-11-20 21:04:41 UTC (rev 24715)
+++ trunk/blender/source/blender/editors/space_node/node_intern.h       
2009-11-20 21:17:17 UTC (rev 24716)
@@ -82,6 +82,7 @@
 bNode *node_tree_get_editgroup(bNodeTree *ntree);
 void node_tree_verify_groups(bNodeTree *nodetree);
 void snode_autoconnect(SpaceNode *snode, bNode *node_to, int flag);
+int node_has_hidden_sockets(bNode *node);
 
 void NODE_OT_duplicate(struct wmOperatorType *ot);
 void NODE_OT_delete(struct wmOperatorType *ot);
@@ -98,6 +99,8 @@
 void NODE_OT_mute(struct wmOperatorType *ot);
 void NODE_OT_hide(struct wmOperatorType *ot);
 
+void NODE_OT_show_cyclic_dependencies(struct wmOperatorType *ot);
+
 // XXXXXX
 
 // XXX from BSE_node.h

Modified: trunk/blender/source/blender/editors/space_node/node_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_node/node_ops.c  2009-11-20 
21:04:41 UTC (rev 24715)
+++ trunk/blender/source/blender/editors/space_node/node_ops.c  2009-11-20 
21:17:17 UTC (rev 24716)
@@ -61,6 +61,7 @@
        WM_operatortype_append(NODE_OT_visibility_toggle);
        WM_operatortype_append(NODE_OT_mute);
        WM_operatortype_append(NODE_OT_hide);
+       WM_operatortype_append(NODE_OT_show_cyclic_dependencies);
        
        WM_operatortype_append(NODE_OT_duplicate);
        WM_operatortype_append(NODE_OT_delete);
@@ -80,7 +81,7 @@
        wmOperatorType *ot;
        wmOperatorTypeMacro *otmacro;
        
-       ot= WM_operatortype_append_macro("NODE_OT_duplicate_move", "Add 
Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
+       ot= WM_operatortype_append_macro("NODE_OT_duplicate_move", "Duplicate", 
OPTYPE_UNDO|OPTYPE_REGISTER);
        WM_operatortype_macro_define(ot, "NODE_OT_duplicate");
        otmacro= WM_operatortype_macro_define(ot, "TFM_OT_translate");
        RNA_enum_set(otmacro->ptr, "proportional", 0);
@@ -123,6 +124,8 @@
        WM_keymap_add_item(keymap, "NODE_OT_hide", HKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "NODE_OT_mute", MKEY, KM_PRESS, 0, 0);
        
+       WM_keymap_add_item(keymap, "NODE_OT_show_cyclic_dependencies", CKEY, 
KM_PRESS, 0, 0);
+       
        WM_keymap_add_item(keymap, "NODE_OT_view_all", HOMEKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "NODE_OT_select_border", BKEY, KM_PRESS, 0, 
0);
        WM_keymap_add_item(keymap, "NODE_OT_delete", XKEY, KM_PRESS, 0, 0);


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

Reply via email to