* x coordinate.
*/
int num;
- float ybase, y;
+ float y;
areamouseco_to_ipoco(G.v2d, mval, x, &y);
num = (int) ((CHANNELHEIGHT/2 - y) / (CHANNELHEIGHT+CHANNELSKIP));
/* snap to frame */
for (ale= act_data.first; ale; ale= ale->next) {
- snap_ipo_keys(ale->key_data, mode);
+ if (datatype==ACTCONT_ACTION && G.saction->pin==0 && OBACT) {
+ actstrip_map_ipo_keys(OBACT, ale->key_data, 0, 1);
+ snap_ipo_keys(ale->key_data, mode);
+ actstrip_map_ipo_keys(OBACT, ale->key_data, 1, 1);
+ }
+ else
+ snap_ipo_keys(ale->key_data, mode);
}
BLI_freelistN(&act_data);
/* mirror */
for (ale= act_data.first; ale; ale= ale->next) {
- mirror_ipo_keys(ale->key_data, mode);
+ if (datatype==ACTCONT_ACTION && G.saction->pin==0 && OBACT) {
+ actstrip_map_ipo_keys(OBACT, ale->key_data, 0, 1);
+ mirror_ipo_keys(ale->key_data, mode);
+ actstrip_map_ipo_keys(OBACT, ale->key_data, 1, 1);
+ }
+ else
+ mirror_ipo_keys(ale->key_data, mode);
}
BLI_freelistN(&act_data);
{
void *data;
short datatype;
- bAction *act;
- bActionChannel *achan;
+ bAction *act= NULL;
+ bActionChannel *achan= NULL;
bConstraintChannel *conchan= NULL;
IpoCurve *icu= NULL;
TimeMarker *marker;
void *act_channel;
short sel, act_type;
- float selx;
+ float selx;
/* determine what type of data we are operating on */
data = get_action_context(&datatype);
if (data == NULL) return;
+ if (datatype == ACTCONT_ACTION) act= (bAction *)data;
act_channel= get_nearest_action_key(&selx, &sel, &act_type, &achan);
marker=find_nearest_marker(1);
#include "BSE_editnla_types.h"
#include "BSE_headerbuttons.h"
#include "BSE_drawipo.h"
+#include "BSE_editaction_types.h"
#include "BSE_trans_types.h"
#include "BSE_edit.h"
#include "BSE_filesel.h"
}
}
}
+
+ /* object has ipo */
+ if (base->object->ipo) {
+ snap_ipo_keys(base->object->ipo, snap_mode);
+ }
+
+ /* object has action */
+ if (base->object->action) {
+ ListBase act_data = {NULL, NULL};
+ bActListElem *ale;
+ int filter;
+
+ /* filter action data */
+ filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS);
+ actdata_filter(&act_data, filter, base->object->action, ACTCONT_ACTION);
+
+ /* snap to frame */
+ for (ale= act_data.first; ale; ale= ale->next) {
+ actstrip_map_ipo_keys(base->object, ale->key_data, 0, 1);
+ snap_ipo_keys(ale->key_data, snap_mode);
+ actstrip_map_ipo_keys(base->object, ale->key_data, 1, 1);
+ }
+ BLI_freelistN(&act_data);
+
+ remake_action_ipos(base->object->action);
+ }
}
BIF_undo_push("Snap NLA strips");
allqueue (REDRAWVIEW3D, 0);
+ allqueue (REMAKEIPO, 0);
+ allqueue (REDRAWIPO, 0);
allqueue (REDRAWACTION, 0);
allqueue (REDRAWNLA, 0);
}