diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-09-05 00:51:09 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-09-05 00:51:09 +0400 |
commit | 7df35db1b1364dcd81dd8247ad3707d40a78fd59 (patch) | |
tree | fb967409fddbb02ee70fbdfa1e404fae115a312e /source/blender/editors/space_outliner | |
parent | 5342f7930fb26855b92f337ace45f2ee51153957 (diff) |
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r-- | source/blender/editors/space_outliner/outliner.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/space_outliner.c | 8 |
2 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index a9a9a5dab5f..a3b47d505fd 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -1994,7 +1994,7 @@ static int tree_element_active_defgroup(bContext *C, Scene *scene, TreeElement * ob= (Object *)tselem->id; if(set) { ob->actdef= te->index+1; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, ob); } else { @@ -2121,7 +2121,7 @@ static int tree_element_active_psys(bContext *C, Scene *scene, TreeElement *te, if(set) { Object *ob= (Object *)tselem->id; - WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, ob); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, ob); // XXX extern_set_butspace(F7KEY, 0); } @@ -4682,7 +4682,7 @@ static void restrictbutton_modifier_cb(bContext *C, void *poin, void *poin2) Scene *scene = (Scene *)poin; Object *ob = (Object *)poin2; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); object_handle_update(scene, ob); WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, ob); diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index f57445a32f1..5058a167a29 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -137,6 +137,10 @@ static void outliner_main_area_listener(ARegion *ar, wmNotifier *wmn) /* all actions now, todo: check outliner view mode? */ ED_region_tag_redraw(ar); break; + case NC_SPACE: + if(wmn->data == ND_SPACE_OUTLINER) + ED_region_tag_redraw(ar); + break; } } @@ -190,6 +194,10 @@ static void outliner_header_area_listener(ARegion *ar, wmNotifier *wmn) if(wmn->data == ND_KEYINGSET) ED_region_tag_redraw(ar); break; + case NC_SPACE: + if(wmn->data == ND_SPACE_OUTLINER) + ED_region_tag_redraw(ar); + break; } } |