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:
authorMartin Poirier <theeth@yahoo.com>2009-11-01 05:52:38 +0300
committerMartin Poirier <theeth@yahoo.com>2009-11-01 05:52:38 +0300
commit69feedf139d2c0e0e8eee5d89afdd13fd85aa689 (patch)
treed99df6dab68d69f8c4918444e23fbfcdb314ae73 /source/blender/editors
parentd96480884666247beba7085cf709c615a80ddc67 (diff)
Object PET works with autokey.
Reordering some function calls in transform cleanup to make it simpler (that means other fixes are possible too, sequencer probably don't need it's own freeing function anymore).
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/transform/transform.c9
-rw-r--r--source/blender/editors/transform/transform_conversions.c78
-rw-r--r--source/blender/editors/transform/transform_generics.c32
3 files changed, 67 insertions, 52 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index f582fd03ba8..2a2753436c2 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -1012,11 +1012,12 @@ int calculateTransformCenter(bContext *C, wmEvent *event, int centerMode, float
VECCOPY(vec, t->con.center);
}
- postTrans(t);
/* aftertrans does insert ipos and action channels, and clears base flags, doesnt read transdata */
special_aftertrans_update(t);
+ postTrans(t);
+
MEM_freeN(t);
return success;
@@ -1573,12 +1574,12 @@ int transformEnd(bContext *C, TransInfo *t)
exit_code = OPERATOR_FINISHED;
}
- /* free data */
- postTrans(t);
-
/* aftertrans does insert keyframes, and clears base flags, doesnt read transdata */
special_aftertrans_update(t);
+ /* free data */
+ postTrans(t);
+
/* send events out for redraws */
viewRedrawPost(t);
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 449994f2cec..5d6d6948a4b 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -4703,10 +4703,11 @@ void autokeyframe_pose_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode,
}
-/* inserting keys, refresh ipo-keys, pointcache, redraw events... (ton) */
-/* note: transdata has been freed already! */
-/* note: this runs even when createTransData exits early because (t->total==0), is this correct?... (campbell) */
-/* note: sequencer freeing has its own function now because of a conflict with transform's order of freeing (campbell)*/
+/* inserting keys, refresh ipo-keys, pointcache, redraw events... */
+/*
+ * note: sequencer freeing has its own function now because of a conflict with transform's order of freeing (campbell)
+ * Order changed, the sequencer stuff should go back in here
+ * */
void special_aftertrans_update(TransInfo *t)
{
Object *ob;
@@ -4714,6 +4715,10 @@ void special_aftertrans_update(TransInfo *t)
int cancelled= (t->state == TRANS_CANCEL);
short duplicate= (t->undostr && strstr(t->undostr, "Duplicate")) ? 1 : 0;
+ /* early out when nothing happened */
+ if (t->total == 0 || t->mode != TFM_DUMMY)
+ return;
+
if (t->spacetype==SPACE_VIEW3D) {
if (t->obedit) {
if (cancelled==0) {
@@ -4988,43 +4993,42 @@ void special_aftertrans_update(TransInfo *t)
else if(t->scene->basact && (ob = t->scene->basact->object) && (ob->mode & OB_MODE_PARTICLE_EDIT) && PE_get_current(t->scene, ob)) {
;
}
- else {
- /* Objects */
- // XXX ideally, this would go through context iterators, but we don't have context iterator access here,
- // so we make do with old data + access styles...
- Scene *scene= t->scene;
- Base *base;
-
- for (base= FIRSTBASE; base; base= base->next) {
- ob= base->object;
-
- if (base->flag & SELECT && (t->mode != TFM_DUMMY)) {
- ListBase pidlist;
- PTCacheID *pid;
-
- /* flag object caches as outdated */
- BKE_ptcache_ids_from_object(&pidlist, ob);
- for(pid=pidlist.first; pid; pid=pid->next) {
- if(pid->type != PTCACHE_TYPE_PARTICLES) /* particles don't need reset on geometry change */
- pid->cache->flag |= PTCACHE_OUTDATED;
- }
- BLI_freelistN(&pidlist);
+ else { /* Objects */
+ int i;
- /* pointcache refresh */
- if (BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_OUTDATED))
- ob->recalc |= OB_RECALC_DATA;
+ for (i = 0; i < t->total; i++) {
+ TransData *td = t->data + i;
+ Object *ob = td->ob;
+ ListBase pidlist;
+ PTCacheID *pid;
+
+ if (td->flag & TD_NOACTION)
+ break;
+
+ if (td->flag & TD_SKIP)
+ continue;
+
+ /* flag object caches as outdated */
+ BKE_ptcache_ids_from_object(&pidlist, ob);
+ for(pid=pidlist.first; pid; pid=pid->next) {
+ if(pid->type != PTCACHE_TYPE_PARTICLES) /* particles don't need reset on geometry change */
+ pid->cache->flag |= PTCACHE_OUTDATED;
+ }
+ BLI_freelistN(&pidlist);
- /* Needed for proper updating of "quick cached" dynamics. */
- /* 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_id_flush_update(&ob->id, OB_RECALC_OB);
+ /* pointcache refresh */
+ if (BKE_ptcache_object_reset(t->scene, ob, PTCACHE_RESET_OUTDATED))
+ ob->recalc |= OB_RECALC_DATA;
- /* Set autokey if necessary */
- if (!cancelled)
- autokeyframe_ob_cb_func(t->scene, (View3D *)t->view, ob, t->mode);
- }
+ /* Needed for proper updating of "quick cached" dynamics. */
+ /* 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_id_flush_update(&ob->id, OB_RECALC_OB);
+ /* Set autokey if necessary */
+ if (!cancelled)
+ autokeyframe_ob_cb_func(t->scene, (View3D *)t->view, ob, t->mode);
}
}
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index fc3661c1102..17818713b1e 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -776,6 +776,8 @@ void recalcData(TransInfo *t)
flushTransParticles(t);
}
else {
+ int i;
+
for(base= FIRSTBASE; base; base= base->next) {
Object *ob= base->object;
@@ -784,18 +786,26 @@ void recalcData(TransInfo *t)
ob->recalc |= OB_RECALC_OB;
if(base->flag & BA_HAS_RECALC_DATA)
ob->recalc |= OB_RECALC_DATA;
+ }
+
+ for (i = 0; i < t->total; i++) {
+ TransData *td = t->data + i;
+ Object *ob = td->ob;
- /* if object/base is selected */
- if ((base->flag & SELECT) || (ob->flag & SELECT)) {
- /* if animtimer is running, and the object already has animation data,
- * check if the auto-record feature means that we should record 'samples'
- * (i.e. uneditable animation values)
- */
- // TODO: autokeyframe calls need some setting to specify to add samples (FPoints) instead of keyframes?
- if ((t->animtimer) && IS_AUTOKEY_ON(t->scene)) {
- animrecord_check_state(t->scene, &ob->id, t->animtimer);
- autokeyframe_ob_cb_func(t->scene, (View3D *)t->view, ob, t->mode);
- }
+ if (td->flag & TD_NOACTION)
+ break;
+
+ if (td->flag & TD_SKIP)
+ continue;
+
+ /* if animtimer is running, and the object already has animation data,
+ * check if the auto-record feature means that we should record 'samples'
+ * (i.e. uneditable animation values)
+ */
+ // TODO: autokeyframe calls need some setting to specify to add samples (FPoints) instead of keyframes?
+ if ((t->animtimer) && IS_AUTOKEY_ON(t->scene)) {
+ animrecord_check_state(t->scene, &ob->id, t->animtimer);
+ autokeyframe_ob_cb_func(t->scene, (View3D *)t->view, ob, t->mode);
}
/* proxy exception */