When in localview, MKey moves objects out of localview, added redraw notifiers
This commit is contained in:
		@@ -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 ? */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
 
 | 
			
		||||
@@ -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)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user