From c4860afba3d1bf18dfc36bf2ec76332267394f5b Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 24 Sep 2007 11:29:25 +0000 Subject: == Action and NLA Editor Transform == I've refactored the Action and NLA Editor Transform tools to use the Transform System instead of setting up their own transform loops. This should have happened ages ago, but no-one got around to doing so. * There are still a few bugs left to iron out of a few features, but on the whole it should work as well as it used to. These are: the values which get displayed when working with NLA-scaled actions may not all be correct yet; and the Time-Slide tool in the Action Editor is currently kindof broken. * One of the main benefits of this work, is that it is now possible to use Numeric Input during Transforms. * Also, a bug that meant that it was not possible to negatively scale keyframes in the Action Editor has been resolved. --- source/blender/src/transform_generics.c | 45 ++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) (limited to 'source/blender/src/transform_generics.c') diff --git a/source/blender/src/transform_generics.c b/source/blender/src/transform_generics.c index 357623ea494..562277ecff5 100644 --- a/source/blender/src/transform_generics.c +++ b/source/blender/src/transform_generics.c @@ -54,8 +54,10 @@ #include "BIF_resources.h" #include "BIF_mywindow.h" #include "BIF_gl.h" +#include "BIF_editaction.h" #include "BIF_editarmature.h" #include "BIF_editmesh.h" +#include "BIF_editnla.h" #include "BIF_editsima.h" #include "BIF_meshtools.h" #include "BIF_retopo.h" @@ -75,6 +77,7 @@ #include "BKE_group.h" #include "BKE_ipo.h" #include "BKE_lattice.h" +#include "BKE_key.h" #include "BKE_mesh.h" #include "BKE_modifier.h" #include "BKE_object.h" @@ -85,6 +88,7 @@ #endif #include "BSE_view.h" +#include "BSE_editaction_types.h" #include "BDR_unwrapper.h" #include "BLI_arithb.h" @@ -215,8 +219,47 @@ void recalcData(TransInfo *t) #ifdef WITH_VERSE struct TransData *td; #endif + + if (t->spacetype == SPACE_ACTION) { + Object *ob= OBACT; + void *data; + short context; - if (G.obedit) { + /* determine what type of data we are operating on */ + data = get_action_context(&context); + if (data == NULL) return; + + if (G.saction->lock) { + if (context == ACTCONT_ACTION) { + if(ob) { + ob->ctime= -1234567.0f; + if(ob->pose || ob_get_key(ob)) + DAG_object_flush_update(G.scene, ob, OB_RECALC); + else + DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); + } + } + else if (context == ACTCONT_SHAPEKEY) { + DAG_object_flush_update(G.scene, OBACT, OB_RECALC_OB|OB_RECALC_DATA); + } + } + } + else if (t->spacetype == SPACE_NLA) { + if (G.snla->lock) { + for (base=G.scene->base.first; base; base=base->next) { + if (base->flag & BA_HAS_RECALC_OB) + base->object->recalc |= OB_RECALC_OB; + if (base->flag & BA_HAS_RECALC_DATA) + base->object->recalc |= OB_RECALC_DATA; + + if (base->object->recalc) + base->object->ctime= -1234567.0f; // eveil! + } + + DAG_scene_flush_update(G.scene, screen_view3d_layers()); + } + } + else if (G.obedit) { if (G.obedit->type == OB_MESH) { if(t->spacetype==SPACE_IMAGE) { flushTransUVs(t); -- cgit v1.2.3