When in localview, MKey moves objects out of localview, added redraw notifiers
authorCampbell Barton <ideasman42@gmail.com>
Sat, 10 Oct 2009 12:29:11 +0000 (12:29 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 10 Oct 2009 12:29:11 +0000 (12:29 +0000)
source/blender/editors/object/object_add.c
source/blender/editors/object/object_relations.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/intern/wm_operators.c

index 0b7dbf791e03190937dab90391ea74224e40dc61..d79ec460dec561ddf75ff61507fdc56daf664ac6 100644 (file)
@@ -1239,7 +1239,7 @@ static int convert_exec(bContext *C, wmOperator *op)
        BASACT= basact;
 
        DAG_scene_sort(scene);
-       WM_event_add_notifier(C, NC_SCENE|ND_DRAW, scene);
+       WM_event_add_notifier(C, NC_SCENE|NC_OBJECT|ND_DRAW, scene); /* is NC_SCENE needed ? */
 
 
 
index 4a0c812f7b1760f06a7fb3fad5ad06d3e5a0aec1..d6a55077be954202756356d3e9a00431f14d3d94 100644 (file)
@@ -978,8 +978,14 @@ static unsigned int move_to_layer_init(bContext *C, wmOperator *op)
 
 static int move_to_layer_invoke(bContext *C, wmOperator *op, wmEvent *event)
 {
-       move_to_layer_init(C, op);
-       return WM_operator_props_popup(C, op, event);
+       View3D *v3d= CTX_wm_view3d(C);
+       if(v3d && v3d->localvd) {
+               return WM_operator_confirm_message(C, op, "Move from localview");
+       }
+       else {
+               move_to_layer_init(C, op);
+               return WM_operator_props_popup(C, op, event);
+       }
 }
 
 static int move_to_layer_exec(bContext *C, wmOperator *op)
@@ -1023,7 +1029,7 @@ static int move_to_layer_exec(bContext *C, wmOperator *op)
        
        /* warning, active object may be hidden now */
        
-       WM_event_add_notifier(C, NC_SCENE, scene);
+       WM_event_add_notifier(C, NC_SCENE|NC_OBJECT|ND_DRAW, scene); /* is NC_SCENE needed ? */
        DAG_scene_sort(scene);
 
        return OPERATOR_FINISHED;
index eaf8b00163cbf4d1e9c6eb685cf0f268f19f365c..44e404524f561bb459c7a0f82af4a429c2a2e3b7 100644 (file)
@@ -158,6 +158,8 @@ int                 WM_operator_winactive   (struct bContext *C);
 int                    WM_operator_props_popup (struct bContext *C, struct wmOperator *op, struct wmEvent *event);
 int                    WM_operator_redo_popup  (struct bContext *C, struct wmOperator *op);
 
+int                    WM_operator_confirm_message(struct bContext *C, struct wmOperator *op, char *message);
+
                /* operator api */
 void           WM_operator_free                (struct wmOperator *op);
 void           WM_operator_stack_clear(struct bContext *C);
index 915f4c80663e495232c506e43cfb6dcf3fd095ae..7db6669ca7419f52eb37ecbae5dd3877ee219676 100644 (file)
@@ -488,20 +488,26 @@ int WM_menu_invoke(bContext *C, wmOperator *op, wmEvent *event)
        return OPERATOR_CANCELLED;
 }
 
-/* op->invoke */
-int WM_operator_confirm(bContext *C, wmOperator *op, wmEvent *event)
+/* Can't be used as an invoke directly, needs message arg (can be NULL) */
+int WM_operator_confirm_message(bContext *C, wmOperator *op, char *message)
 {
        uiPopupMenu *pup;
        uiLayout *layout;
 
        pup= uiPupMenuBegin(C, "OK?", ICON_QUESTION);
        layout= uiPupMenuLayout(pup);
-       uiItemO(layout, NULL, 0, op->type->idname);
+       uiItemO(layout, message, 0, op->type->idname);
        uiPupMenuEnd(C, pup);
        
        return OPERATOR_CANCELLED;
 }
 
+
+int WM_operator_confirm(bContext *C, wmOperator *op, wmEvent *event)
+{
+       return WM_operator_confirm_message(C, op, NULL);
+}
+
 /* op->invoke, opens fileselect if path property not set, otherwise executes */
 int WM_operator_filesel(bContext *C, wmOperator *op, wmEvent *event)
 {