From 7df35db1b1364dcd81dd8247ad3707d40a78fd59 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 4 Sep 2009 20:51:09 +0000 Subject: 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 --- source/blender/editors/mesh/editmesh.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/mesh/editmesh.c') diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index c3f1637d3af..980d699dda5 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -1280,7 +1280,7 @@ void load_editMesh(Scene *scene, Object *ob) void remake_editMesh(Scene *scene, Object *ob) { make_editMesh(scene, ob); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); BIF_undo_push("Undo all changes"); } @@ -1390,8 +1390,8 @@ static int mesh_separate_selected(Scene *scene, Base *editbase) /* hashedges are invalid now, make new! */ editMesh_set_hash(em); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - DAG_object_flush_update(scene, basenew->object, OB_RECALC_DATA); + DAG_id_flush_update(&obedit->id, OB_RECALC_DATA); + DAG_id_flush_update(&basenew->object->id, OB_RECALC_DATA); BKE_mesh_end_editmesh(me, em); @@ -1469,7 +1469,7 @@ static int mesh_separate_exec(bContext *C, wmOperator *op) retval= mesh_separate_loose(scene, base); if(retval) { - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, base->object); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, base->object->data); return OPERATOR_FINISHED; } return OPERATOR_CANCELLED; -- cgit v1.2.3