Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-09-05 00:51:09 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-09-05 00:51:09 +0400
commit7df35db1b1364dcd81dd8247ad3707d40a78fd59 (patch)
treefb967409fddbb02ee70fbdfa1e404fae115a312e /source/blender/editors/metaball
parent5342f7930fb26855b92f337ace45f2ee51153957 (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/metaball')
-rw-r--r--source/blender/editors/metaball/editmball.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/source/blender/editors/metaball/editmball.c b/source/blender/editors/metaball/editmball.c
index b9bb219783f..9ab985fb3fb 100644
--- a/source/blender/editors/metaball/editmball.c
+++ b/source/blender/editors/metaball/editmball.c
@@ -212,8 +212,8 @@ static int select_deselect_all_metaelems_exec(bContext *C, wmOperator *op)
else ml->flag |= SELECT;
ml= ml->next;
}
- WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
- //DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_GEOM|ND_SELECT, mb);
+ //DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
}
return OPERATOR_FINISHED;
@@ -251,7 +251,7 @@ static int select_inverse_metaelems_exec(bContext *C, wmOperator *op)
ml->flag |= SELECT;
ml= ml->next;
}
- WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
+ WM_event_add_notifier(C, NC_GEOM|ND_SELECT, mb);
}
return OPERATOR_FINISHED;
@@ -296,7 +296,7 @@ static int select_random_metaelems_exec(bContext *C, wmOperator *op)
ml= ml->next;
}
- WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
+ WM_event_add_notifier(C, NC_GEOM|ND_SELECT, mb);
return OPERATOR_FINISHED;
}
@@ -325,7 +325,6 @@ void MBALL_OT_select_random_metaelems(struct wmOperatorType *ot)
/* Duplicate selected MetaElements */
static int duplicate_metaelems_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
Object *obedit= CTX_data_edit_object(C);
MetaBall *mb = (MetaBall*)obedit->data;
MetaElem *ml, *newml;
@@ -341,8 +340,8 @@ static int duplicate_metaelems_exec(bContext *C, wmOperator *op)
}
ml= ml->prev;
}
- WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit);
- DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_GEOM|ND_DATA, mb);
+ DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
}
return OPERATOR_FINISHED;
@@ -384,7 +383,6 @@ void MBALL_OT_duplicate_metaelems(wmOperatorType *ot)
/* Delete all selected MetaElems (not MetaBall) */
static int delete_metaelems_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
Object *obedit= CTX_data_edit_object(C);
MetaBall *mb= (MetaBall*)obedit->data;
MetaElem *ml, *next;
@@ -400,8 +398,8 @@ static int delete_metaelems_exec(bContext *C, wmOperator *op)
}
ml= next;
}
- WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit);
- DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_GEOM|ND_DATA, mb);
+ DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
}
return OPERATOR_FINISHED;
@@ -426,7 +424,6 @@ void MBALL_OT_delete_metaelems(wmOperatorType *ot)
/* Hide selected MetaElems */
static int hide_metaelems_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
Object *obedit= CTX_data_edit_object(C);
MetaBall *mb= (MetaBall*)obedit->data;
MetaElem *ml;
@@ -450,8 +447,8 @@ static int hide_metaelems_exec(bContext *C, wmOperator *op)
ml= ml->next;
}
}
- WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit);
- DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_GEOM|ND_DATA, mb);
+ DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
}
return OPERATOR_FINISHED;
@@ -479,7 +476,6 @@ void MBALL_OT_hide_metaelems(wmOperatorType *ot)
/* Unhide all edited MetaElems */
static int reveal_metaelems_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
Object *obedit= CTX_data_edit_object(C);
MetaBall *mb= (MetaBall*)obedit->data;
MetaElem *ml;
@@ -491,8 +487,8 @@ static int reveal_metaelems_exec(bContext *C, wmOperator *op)
ml->flag &= ~MB_HIDE;
ml= ml->next;
}
- WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit);
- DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_GEOM|ND_DATA, mb);
+ DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
}
return OPERATOR_FINISHED;
@@ -584,7 +580,7 @@ void mouse_mball(bContext *C, short mval[2], int extend)
}
mb->lastelem= act;
- WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
+ WM_event_add_notifier(C, NC_GEOM|ND_SELECT, mb);
}
}
}