Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Borghetti <bdiego@gmail.com>2010-06-04 23:31:14 +0400
committerDiego Borghetti <bdiego@gmail.com>2010-06-04 23:31:14 +0400
commite40f425619614ab3dae8544331f58b854031341d (patch)
tree6797eb5fd5e17f082b001f25c39361681746ad27 /source/blender/editors/space_outliner
parent7639c5146fecacb64d84c4911788c30d87a78bf8 (diff)
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.
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r--source/blender/editors/space_outliner/outliner.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c
index 6675b84b82b..235a5e00117 100644
--- a/source/blender/editors/space_outliner/outliner.c
+++ b/source/blender/editors/space_outliner/outliner.c
@@ -2457,7 +2457,13 @@ static int do_outliner_item_activate(bContext *C, Scene *scene, ARegion *ar, Spa
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 @@ static void restrictbutton_view_cb(bContext *C, void *poin, void *poin2)
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) {