diff options
-rw-r--r-- | source/blender/blenkernel/BKE_scene.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 15 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 3 |
3 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index f9afb848c6d..4b3d3723ab5 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -76,6 +76,7 @@ char *scene_find_marker_name(struct Scene *scene, int frame); char *scene_find_last_marker_name(struct Scene *scene, int frame); int scene_marker_tfm_translate(struct Scene *scene, int delta, int flag); int scene_marker_tfm_extend(struct Scene *scene, int delta, int flag, int frame, char side); +int scene_marker_tfm_scale(struct Scene *scene, float value, int flag); struct Base *scene_add_base(struct Scene *sce, struct Object *ob); void scene_deselect_all(struct Scene *sce); diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index ec4495be82d..edbace71c6d 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -859,6 +859,21 @@ int scene_marker_tfm_extend(Scene *scene, int delta, int flag, int frame, char s return tot; } +int scene_marker_tfm_scale(struct Scene *scene, float value, int flag) +{ + TimeMarker *marker; + int tot= 0; + + for (marker= scene->markers.first; marker; marker= marker->next) { + if ((marker->flag & flag) == flag) { + marker->frame= CFRA + (int)floorf(((float)(marker->frame - CFRA) * value) + 0.5f); + tot++; + } + } + + return tot; +} + Base *scene_add_base(Scene *sce, Object *ob) { Base *b= MEM_callocN(sizeof(*b), "scene_add_base"); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index e1cda354872..305a9331d1d 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -4886,6 +4886,9 @@ void special_aftertrans_update(bContext *C, TransInfo *t) else if (ELEM(t->frame_side, 'L', 'R')) scene_marker_tfm_extend(t->scene, floor(t->vec[0] + 0.5f), SELECT, t->scene->r.cfra, t->frame_side); } + else if(t->mode == TFM_TIME_SCALE) { + scene_marker_tfm_scale(t->scene, t->vec[0], SELECT); + } } #if 0 // XXX future of this is still not clear |