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:
authorJoshua Leung <aligorith@gmail.com>2006-12-18 03:21:47 +0300
committerJoshua Leung <aligorith@gmail.com>2006-12-18 03:21:47 +0300
commitd1c9de7cd6656bb56b4047f6532ca235bfc990be (patch)
tree19369d9d7731634a4277b56b7befbdf61af722f1 /source/blender/src/editipo_mods.c
parenta3468fd0bdf3d1a780362782e557668ba5e4e200 (diff)
== Action Editor ==
When the current action is the active strip in the nla editor and that strip is scaled, snapping keys to the current frame didn't work correct. Now, I've added a correction for snapping and mirroring keyframes in action editor for such cases.
Diffstat (limited to 'source/blender/src/editipo_mods.c')
-rw-r--r--source/blender/src/editipo_mods.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/src/editipo_mods.c b/source/blender/src/editipo_mods.c
index 1a9408500c4..9c2aba3aa8b 100644
--- a/source/blender/src/editipo_mods.c
+++ b/source/blender/src/editipo_mods.c
@@ -53,6 +53,7 @@
#include "DNA_view3d_types.h"
#include "BKE_global.h"
+#include "BKE_action.h"
#include "BKE_ipo.h"
#include "BKE_key.h"
#include "BKE_utildefines.h"
@@ -617,6 +618,25 @@ void mirror_ipo_keys(Ipo *ipo, short mirror_type)
}
}
+/* currently only used by some action editor tools, but may soon get used by ipo editor */
+void actstrip_map_ipo_keys(Object *ob, Ipo *ipo, short restore)
+{
+ IpoCurve *icu;
+ BezTriple *bezt;
+ int a;
+
+ /* loop through all ipo curves, adjusting the times of the selected keys */
+ for (icu= ipo->curve.first; icu; icu= icu->next) {
+ for (a=0, bezt=icu->bezt; a<icu->totvert; a++, bezt++) {
+ /* are the times being adjusted for editing, or has editing finished */
+ if (restore)
+ bezt->vec[1][0]= get_action_frame(ob, bezt->vec[1][0]);
+ else
+ bezt->vec[1][0]= get_action_frame_inv(ob, bezt->vec[1][0]);
+ }
+ }
+}
+
static void ipo_curves_auto_horiz(void)
{
EditIpo *ei;