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>2007-04-28 13:35:16 +0400
committerJoshua Leung <aligorith@gmail.com>2007-04-28 13:35:16 +0400
commit6bb16e0c86c553697f6cade8c6e1cd166f993d2c (patch)
tree43774cd31992ce005b975327e558443f8d5cedb1 /source/blender/src/editipo_mods.c
parent705671ebaac3648f67ebc3c12b441e0a2b09df2d (diff)
== IPO Editor - Scaled Curves for NLA-Strip Curves ==
This commit resolves an issue dating back a few releases. When the IPO block being displayed in the IPO editor came from an Action being used as an Action Strip in the NLA editor, the keyframes in the IPO editor were not displayed in 'NLA-time'. There are however a number of things that still need work on so that they will play nicely with these changes. Having said that, the IPO editor is still generally stable for use (or should be). In case anything plays up, 'pin' the IPO view you're using to turn off these changes. This resolves Todo #4335. Known Issues: * When 'K' (show keys) mode is on, it doesn't work too too well yet. The display in such situations will be a bit confusing. * Pressing IKEY in the IPO editor (for inserting a keyframe on the current frame) also doesn't work too well yet. It will insert a keyframe on the wrong frame. * Transforms don't get any correction for scaling yet. This is only an issue when snapping transforms to the grid, or relying on the delta numbers printed in the header.
Diffstat (limited to 'source/blender/src/editipo_mods.c')
-rw-r--r--source/blender/src/editipo_mods.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/source/blender/src/editipo_mods.c b/source/blender/src/editipo_mods.c
index 4555853cc62..af635aa5368 100644
--- a/source/blender/src/editipo_mods.c
+++ b/source/blender/src/editipo_mods.c
@@ -695,20 +695,35 @@ 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)
+/* restore = whether to map points back to ipo-time
+ * only_keys = whether to only adjust the location of the center point of beztriples
+ */
+void actstrip_map_ipo_keys(Object *ob, Ipo *ipo, short restore, short only_keys)
{
IpoCurve *icu;
BezTriple *bezt;
int a;
+ if (ipo==NULL) return;
+
/* 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)
+ if (restore) {
+ if (only_keys == 0) {
+ bezt->vec[0][0]= get_action_frame(ob, bezt->vec[0][0]);
+ bezt->vec[2][0]= get_action_frame(ob, bezt->vec[2][0]);
+ }
bezt->vec[1][0]= get_action_frame(ob, bezt->vec[1][0]);
- else
+ }
+ else {
+ if (only_keys == 0) {
+ bezt->vec[0][0]= get_action_frame_inv(ob, bezt->vec[0][0]);
+ bezt->vec[2][0]= get_action_frame_inv(ob, bezt->vec[2][0]);
+ }
bezt->vec[1][0]= get_action_frame_inv(ob, bezt->vec[1][0]);
+ }
}
}
}
@@ -894,6 +909,13 @@ void borderselect_ipo(void)
val= get_border(&rect, 3);
if(val) {
+ /* map ipo-points for editing if scaled ipo */
+ if (OBACT && OBACT->action && G.sipo->pin==0) {
+ if (G.sipo->actname || G.sipo->constname) {
+ actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 0, 0);
+ }
+ }
+
mval[0]= rect.xmin;
mval[1]= rect.ymin;
areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
@@ -940,6 +962,14 @@ void borderselect_ipo(void)
}
}
}
+
+ /* undo mapping of ipo-points for drawing if scaled ipo */
+ if (OBACT && OBACT->action && G.sipo->pin==0) {
+ if (G.sipo->actname || G.sipo->constname) {
+ actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 1, 0);
+ }
+ }
+
BIF_undo_push("Border select Ipo");
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);