Fixed problems with outliner update in same cases caused by my previous commit.

This troubles were caused by "break" of ND_OBJECT case in outliner area listener,
so not all cases were handled.

Handle more data and actions in outline listener, but not refresh when it's
actually unneeded (there where problems with it without that "break" -- extra
refreshing could be made).
This commit is contained in:
Sergey Sharybin 2010-09-18 08:37:47 +00:00
parent d81315e9d2
commit e2f4395864
6 changed files with 17 additions and 3 deletions

@ -808,7 +808,7 @@ static int constraint_delete_exec (bContext *C, wmOperator *op)
ED_object_constraint_update(ob); /* needed to set the flags on posebones correctly */
/* notifiers */
WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT, ob);
WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT|NA_REMOVED, ob);
return OPERATOR_FINISHED;
}

@ -113,11 +113,21 @@ static void outliner_main_area_listener(ARegion *ar, wmNotifier *wmn)
break;
case ND_BONE_ACTIVE:
case ND_BONE_SELECT:
case ND_PARENT:
ED_region_tag_redraw(ar);
break;
case ND_CONSTRAINT:
switch(wmn->action) {
case NA_ADDED:
case NA_REMOVED:
case NA_RENAME:
ED_region_tag_redraw(ar);
break;
}
break;
case ND_MODIFIER:
if(wmn->action == NA_RENAME)
ED_region_tag_redraw(ar);
/* all modifier actions now */
ED_region_tag_redraw(ar);
break;
}
break;

@ -1919,6 +1919,7 @@ void RNA_def_constraint(BlenderRNA *brna)
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Constraint_name_set");
RNA_def_property_ui_text(prop, "Name", "Constraint name");
RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT|NA_RENAME, NULL);
/* enums */
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);

@ -2280,6 +2280,7 @@ void RNA_def_modifier(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Render);
RNA_def_property_ui_text(prop, "Render", "Use modifier during rendering");
RNA_def_property_ui_icon(prop, ICON_SCENE, 0);
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL);
prop= RNA_def_property(srna, "show_in_editmode", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Editmode);

@ -216,6 +216,7 @@ static void rna_Object_dependency_update(Main *bmain, Scene *scene, PointerRNA *
{
DAG_id_flush_update(ptr->id.data, OB_RECALC_OB);
DAG_scene_sort(bmain, scene);
WM_main_add_notifier(NC_OBJECT|ND_PARENT, ptr->id.data);
}
/* when changing the selection flag the scene needs updating */

@ -198,6 +198,7 @@ typedef struct wmNotifier {
#define ND_CONSTRAINT (24<<16)
#define ND_PARTICLE (25<<16)
#define ND_POINTCACHE (26<<16)
#define ND_PARENT (27<<16)
/* NC_MATERIAL Material */
#define ND_SHADING (30<<16)