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/transform
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/transform')
-rw-r--r--source/blender/editors/transform/transform.c2
-rw-r--r--source/blender/editors/transform/transform_conversions.c14
-rw-r--r--source/blender/editors/transform/transform_generics.c14
3 files changed, 15 insertions, 15 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index f0de28476f0..370e98ebd07 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -333,7 +333,7 @@ static void viewRedrawForce(bContext *C, TransInfo *t)
else force_draw(0);
#endif
- WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, t->obedit);
+ WM_event_add_notifier(C, NC_GEOM|ND_DATA, t->obedit->data);
}
}
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 302d9b675a0..0fce9592d1d 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -4722,9 +4722,9 @@ void special_aftertrans_update(TransInfo *t)
ob->ctime= -1234567.0f;
if (ob->pose || ob_get_key(ob))
- DAG_object_flush_update(scene, ob, OB_RECALC);
+ DAG_id_flush_update(&ob->id, OB_RECALC);
else
- DAG_object_flush_update(scene, ob, OB_RECALC_OB);
+ DAG_id_flush_update(&ob->id, OB_RECALC_OB);
}
/* Do curve cleanups? */
@@ -4748,7 +4748,7 @@ void special_aftertrans_update(TransInfo *t)
}
#endif // XXX old animation system
- DAG_object_flush_update(scene, OBACT, OB_RECALC_DATA);
+ DAG_id_flush_update(&OBACT->id, OB_RECALC_DATA);
}
#if 0 // XXX future of this is still not clear
else if (ac.datatype == ANIMCONT_GPENCIL) {
@@ -4912,15 +4912,15 @@ void special_aftertrans_update(TransInfo *t)
/* automatic inserting of keys and unkeyed tagging - only if transform wasn't cancelled (or TFM_DUMMY) */
if (!cancelled && (t->mode != TFM_DUMMY)) {
autokeyframe_pose_cb_func(t->scene, (View3D *)t->view, ob, t->mode, targetless_ik);
- DAG_object_flush_update(t->scene, ob, OB_RECALC_DATA);
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
}
else if (arm->flag & ARM_DELAYDEFORM) {
/* old optimize trick... this enforces to bypass the depgraph */
- DAG_object_flush_update(t->scene, ob, OB_RECALC_DATA);
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
ob->recalc= 0; // is set on OK position already by recalcData()
}
else
- DAG_object_flush_update(t->scene, ob, OB_RECALC_DATA);
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
//if (t->mode==TFM_BONESIZE || t->mode==TFM_BONE_ENVELOPE)
// allqueue(REDRAWBUTSEDIT, 0);
@@ -4948,7 +4948,7 @@ void special_aftertrans_update(TransInfo *t)
/* Creates troubles for moving animated objects without */
/* autokey though, probably needed is an anim sys override? */
/* Please remove if some other solution is found. -jahka */
- DAG_object_flush_update(scene, ob, OB_RECALC_OB);
+ DAG_id_flush_update(&ob->id, OB_RECALC_OB);
/* Set autokey if necessary */
if (!cancelled)
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 0f715f1d35a..0b7029adde0 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -283,7 +283,7 @@ static void animedit_refresh_id_tags (Scene *scene, ID *id)
case ID_OB:
{
Object *ob= (Object *)id;
- DAG_object_flush_update(scene, ob, OB_RECALC_DATA); /* sets recalc flags */
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA); /* sets recalc flags */
}
break;
}
@@ -621,7 +621,7 @@ void recalcData(TransInfo *t)
Curve *cu= t->obedit->data;
Nurb *nu= cu->editnurb->first;
- DAG_object_flush_update(scene, t->obedit, OB_RECALC_DATA); /* sets recalc flags */
+ DAG_id_flush_update(t->obedit->data, OB_RECALC_DATA); /* sets recalc flags */
if (t->state == TRANS_CANCEL) {
while(nu) {
@@ -641,7 +641,7 @@ void recalcData(TransInfo *t)
}
else if(t->obedit->type==OB_LATTICE) {
Lattice *la= t->obedit->data;
- DAG_object_flush_update(scene, t->obedit, OB_RECALC_DATA); /* sets recalc flags */
+ DAG_id_flush_update(t->obedit->data, OB_RECALC_DATA); /* sets recalc flags */
if(la->editlatt->flag & LT_OUTSIDE) outside_lattice(la->editlatt);
}
@@ -653,7 +653,7 @@ void recalcData(TransInfo *t)
if(sima->flag & SI_LIVE_UNWRAP)
ED_uvedit_live_unwrap_re_solve();
- DAG_object_flush_update(scene, t->obedit, OB_RECALC_DATA);
+ DAG_id_flush_update(t->obedit->data, OB_RECALC_DATA);
} else {
EditMesh *em = ((Mesh*)t->obedit->data)->edit_mesh;
/* mirror modifier clipping? */
@@ -668,7 +668,7 @@ void recalcData(TransInfo *t)
if((t->options & CTX_NO_MIRROR) == 0 && (t->flag & T_MIRROR))
editmesh_apply_to_mirror(t);
- DAG_object_flush_update(scene, t->obedit, OB_RECALC_DATA); /* sets recalc flags */
+ DAG_id_flush_update(t->obedit->data, OB_RECALC_DATA); /* sets recalc flags */
recalc_editnormals(em);
}
@@ -752,7 +752,7 @@ void recalcData(TransInfo *t)
}
else
- DAG_object_flush_update(scene, t->obedit, OB_RECALC_DATA); /* sets recalc flags */
+ DAG_id_flush_update(t->obedit->data, OB_RECALC_DATA); /* sets recalc flags */
}
else if( (t->flag & T_POSE) && t->poseobj) {
Object *ob= t->poseobj;
@@ -772,7 +772,7 @@ void recalcData(TransInfo *t)
/* old optimize trick... this enforces to bypass the depgraph */
if (!(arm->flag & ARM_DELAYDEFORM)) {
- DAG_object_flush_update(scene, ob, OB_RECALC_DATA); /* sets recalc flags */
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA); /* sets recalc flags */
}
else
where_is_pose(scene, ob);