Revision: 29222
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29222
Author:   bdiego
Date:     2010-06-04 21:31:14 +0200 (Fri, 04 Jun 2010)

Log Message:
-----------
Fix bug #22153 and #21609

Can't leave edit mode if you enter to edit mode and hide the
object from the outliner.

Also fix the problem if you hide the object and enter edit mode
from the outliner.

To avoid this problem you can't enter edit mode from the outliner
if the object is not visible and also you can't hide the object
from the outliner if the object is in edit mode.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_outliner/outliner.c

Modified: trunk/blender/source/blender/editors/space_outliner/outliner.c
===================================================================
--- trunk/blender/source/blender/editors/space_outliner/outliner.c      
2010-06-04 18:26:15 UTC (rev 29221)
+++ trunk/blender/source/blender/editors/space_outliner/outliner.c      
2010-06-04 19:31:14 UTC (rev 29222)
@@ -2457,7 +2457,13 @@
                                        if(obedit) 
                                                ED_object_exit_editmode(C, 
EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR|EM_DO_UNDO);
                                        else {
-                                               ED_object_enter_editmode(C, 
EM_WAITCURSOR);
+                                               Object *ob= 
CTX_data_active_object(C);
+
+                                               /* Don't allow edit mode if the 
object is hide!
+                                                * check the bug #22153 and 
#21609
+                                                */
+                                               if (ob && (!(ob->restrictflag & 
OB_RESTRICT_VIEW)))
+                                                       
ED_object_enter_editmode(C, EM_WAITCURSOR);
                                                // XXX 
extern_set_butspace(F9KEY, 0);
                                        }
                                } else {        // rest of types
@@ -4862,6 +4868,16 @@
        Base *base;
        Scene *scene = (Scene *)poin;
        Object *ob = (Object *)poin2;
+       Object *obedit= CTX_data_edit_object(C);
+
+       /* Don't allow hide an objet in edit mode,
+        * check the bug #22153 and #21609
+        */
+       if (obedit && obedit == ob) {
+               if (ob->restrictflag & OB_RESTRICT_VIEW)
+                       ob->restrictflag &= ~OB_RESTRICT_VIEW;
+               return;
+       }
        
        /* deselect objects that are invisible */
        if (ob->restrictflag & OB_RESTRICT_VIEW) {


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

Reply via email to