After discussion with Campbell (ideasman) on IRC I reorganized notifiers and created new one for visibility toggling (epilogue to r32052, fixing [#23944]).

This commit is contained in:
Nathan Letwory
2010-09-22 13:42:20 +00:00
parent d135e63705
commit 0bbc2cf882
3 changed files with 32 additions and 26 deletions

View File

@@ -1571,10 +1571,9 @@ static int outliner_toggle_visibility_exec(bContext *C, wmOperator *op)
outliner_do_object_operation(C, scene, soops, &soops->tree, object_toggle_visibility_cb);
WM_event_add_notifier(C, NC_SCENE|ND_OB_VISIBLE, scene);
ED_region_tag_redraw(ar);
WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
return OPERATOR_FINISHED;
}
@@ -1612,6 +1611,7 @@ static int outliner_toggle_selectability_exec(bContext *C, wmOperator *op)
outliner_do_object_operation(C, scene, soops, &soops->tree, object_toggle_selectability_cb);
WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
ED_region_tag_redraw(ar);
return OPERATOR_FINISHED;
@@ -1705,6 +1705,7 @@ static int outliner_toggle_selected_exec(bContext *C, wmOperator *op)
{
SpaceOops *soops= CTX_wm_space_outliner(C);
ARegion *ar= CTX_wm_region(C);
Scene *scene= CTX_data_scene(C);
if (outliner_has_one_flag(soops, &soops->tree, TSE_SELECTED, 1))
outliner_set_flag(soops, &soops->tree, TSE_SELECTED, 0);
@@ -1713,6 +1714,7 @@ static int outliner_toggle_selected_exec(bContext *C, wmOperator *op)
soops->storeflag |= SO_TREESTORE_REDRAW;
WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
ED_region_tag_redraw(ar);
return OPERATOR_FINISHED;
@@ -3184,8 +3186,6 @@ static void object_delete_cb(bContext *C, Scene *scene, TreeElement *te, TreeSto
te->directdata= NULL;
tselem->id= NULL;
}
WM_event_add_notifier(C, NC_SCENE|ND_OB_ACTIVE, scene);
}
@@ -3335,6 +3335,7 @@ void outliner_del(bContext *C, Scene *scene, ARegion *ar, SpaceOops *soops)
outliner_do_object_operation(C, scene, soops, &soops->tree, object_delete_cb);
DAG_scene_sort(CTX_data_main(C), scene);
ED_undo_push(C, "Delete Objects");
WM_event_add_notifier(C, NC_SCENE|ND_OB_ACTIVE, scene);
}
}
@@ -3372,34 +3373,37 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op)
}
str= "Select Objects";
WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
}
else if(event==2) {
outliner_do_object_operation(C, scene, soops, &soops->tree, object_deselect_cb);
str= "Deselect Objects";
WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
}
else if(event==4) {
outliner_do_object_operation(C, scene, soops, &soops->tree, object_delete_cb);
DAG_scene_sort(bmain, scene);
str= "Delete Objects";
WM_event_add_notifier(C, NC_SCENE|ND_OB_ACTIVE, scene);
}
else if(event==5) { /* disabled, see above (ton) */
else if(event==5) { /* disabled, see above enum (ton) */
outliner_do_object_operation(C, scene, soops, &soops->tree, id_local_cb);
str= "Localized Objects";
}
else if(event==6) {
outliner_do_object_operation(C, scene, soops, &soops->tree, object_toggle_visibility_cb);
str= "Toggle Visibility";
WM_event_add_notifier(C, NC_SCENE|ND_OB_VISIBLE, scene);
}
else if(event==7) {
outliner_do_object_operation(C, scene, soops, &soops->tree, object_toggle_selectability_cb);
str= "Toggle Selectability";
WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
}
else if(event==8) {
outliner_do_object_operation(C, scene, soops, &soops->tree, object_toggle_renderability_cb);
str= "Toggle Renderability";
}
WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
ED_undo_push(C, str);

View File

@@ -591,6 +591,7 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
case ND_TRANSFORM:
case ND_OB_ACTIVE:
case ND_OB_SELECT:
case ND_OB_VISIBLE:
case ND_LAYER:
case ND_RENDER_OPTIONS:
case ND_MODE:

View File

@@ -177,28 +177,29 @@ typedef struct wmNotifier {
#define ND_SEQUENCER (6<<16)
#define ND_OB_ACTIVE (7<<16)
#define ND_OB_SELECT (8<<16)
#define ND_MODE (9<<16)
#define ND_RENDER_RESULT (10<<16)
#define ND_COMPO_RESULT (11<<16)
#define ND_KEYINGSET (12<<16)
#define ND_TOOLSETTINGS (13<<16)
#define ND_LAYER (14<<16)
#define ND_FRAME_RANGE (15<<16)
#define ND_OB_VISIBLE (9<<16)
#define ND_MODE (10<<16)
#define ND_RENDER_RESULT (11<<16)
#define ND_COMPO_RESULT (12<<16)
#define ND_KEYINGSET (13<<16)
#define ND_TOOLSETTINGS (14<<16)
#define ND_LAYER (15<<16)
#define ND_FRAME_RANGE (16<<16)
#define ND_LAYER_CONTENT (101<<16)
/* NC_OBJECT Object */
#define ND_TRANSFORM (16<<16)
#define ND_OB_SHADING (17<<16)
#define ND_POSE (18<<16)
#define ND_BONE_ACTIVE (19<<16)
#define ND_BONE_SELECT (20<<16)
#define ND_DRAW (21<<16)
#define ND_MODIFIER (22<<16)
#define ND_KEYS (23<<16)
#define ND_CONSTRAINT (24<<16)
#define ND_PARTICLE (25<<16)
#define ND_POINTCACHE (26<<16)
#define ND_PARENT (27<<16)
#define ND_TRANSFORM (17<<16)
#define ND_OB_SHADING (18<<16)
#define ND_POSE (19<<16)
#define ND_BONE_ACTIVE (20<<16)
#define ND_BONE_SELECT (21<<16)
#define ND_DRAW (22<<16)
#define ND_MODIFIER (23<<16)
#define ND_KEYS (24<<16)
#define ND_CONSTRAINT (25<<16)
#define ND_PARTICLE (26<<16)
#define ND_POINTCACHE (27<<16)
#define ND_PARENT (28<<16)
/* NC_MATERIAL Material */
#define ND_SHADING (30<<16)