Revision: 42604
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42604
Author:   nazgul
Date:     2011-12-13 12:51:40 +0000 (Tue, 13 Dec 2011)
Log Message:
-----------
Disallow link/append when in edit mode

Linking changes active object which is pretty useful in general,
but which totally confuses edit mode (i.e. it becoming not so obvious
to leave from edit mode and inwalid tools in toolbar might be displayed)
so disable link/append when in edit mode

Modified Paths:
--------------
    trunk/blender/source/blender/windowmanager/intern/wm_operators.c

Modified: trunk/blender/source/blender/windowmanager/intern/wm_operators.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_operators.c    
2011-12-13 12:49:12 UTC (rev 42603)
+++ trunk/blender/source/blender/windowmanager/intern/wm_operators.c    
2011-12-13 12:51:40 UTC (rev 42604)
@@ -1634,6 +1634,22 @@
 
 /* **************** link/append *************** */
 
+int wm_link_append_poll(bContext *C)
+{
+       if(WM_operator_winactive(C)) {
+               /* linking changes active object which is pretty useful in 
general,
+                  but which totally confuses edit mode (i.e. it becoming not 
so obvious
+                  to leave from edit mode and inwalid tools in toolbar might 
be displayed)
+                  so disable link/append when in edit mode (sergey) */
+               if(CTX_data_edit_object(C))
+                       return 0;
+
+               return 1;
+       }
+
+       return 0;
+}
+
 static int wm_link_append_invoke(bContext *C, wmOperator *op, wmEvent 
*UNUSED(event))
 {
        if(RNA_property_is_set(op->ptr, "filepath")) {
@@ -1796,7 +1812,7 @@
        
        ot->invoke= wm_link_append_invoke;
        ot->exec= wm_link_append_exec;
-       ot->poll= WM_operator_winactive;
+       ot->poll= wm_link_append_poll;
        
        ot->flag |= OPTYPE_UNDO;
 

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to