forked from bartvdbraak/blender
style cleanup: space action
This commit is contained in:
parent
80a766cbd0
commit
855c11ff8c
@ -73,14 +73,14 @@ void draw_channel_names(bContext *C, bAnimContext *ac, ARegion *ar)
|
|||||||
bAnimListElem *ale;
|
bAnimListElem *ale;
|
||||||
int filter;
|
int filter;
|
||||||
|
|
||||||
View2D *v2d= &ar->v2d;
|
View2D *v2d = &ar->v2d;
|
||||||
float y= 0.0f;
|
float y = 0.0f;
|
||||||
size_t items;
|
size_t items;
|
||||||
int height;
|
int height;
|
||||||
|
|
||||||
/* build list of channels to draw */
|
/* build list of channels to draw */
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS);
|
||||||
items= ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
items = ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
/* Update max-extent of channels here (taking into account scrollers):
|
/* Update max-extent of channels here (taking into account scrollers):
|
||||||
* - this is done to allow the channel list to be scrollable, but must be done here
|
* - this is done to allow the channel list to be scrollable, but must be done here
|
||||||
@ -88,7 +88,7 @@ void draw_channel_names(bContext *C, bAnimContext *ac, ARegion *ar)
|
|||||||
* - offset of ACHANNEL_HEIGHT*2 is added to the height of the channels, as first is for
|
* - offset of ACHANNEL_HEIGHT*2 is added to the height of the channels, as first is for
|
||||||
* start of list offset, and the second is as a correction for the scrollers.
|
* start of list offset, and the second is as a correction for the scrollers.
|
||||||
*/
|
*/
|
||||||
height= ((items*ACHANNEL_STEP) + (ACHANNEL_HEIGHT*2));
|
height = ((items * ACHANNEL_STEP) + (ACHANNEL_HEIGHT * 2));
|
||||||
if (height > (v2d->mask.ymax - v2d->mask.ymin)) {
|
if (height > (v2d->mask.ymax - v2d->mask.ymin)) {
|
||||||
/* don't use totrect set, as the width stays the same
|
/* don't use totrect set, as the width stays the same
|
||||||
* (NOTE: this is ok here, the configuration is pretty straightforward)
|
* (NOTE: this is ok here, the configuration is pretty straightforward)
|
||||||
@ -100,14 +100,14 @@ void draw_channel_names(bContext *C, bAnimContext *ac, ARegion *ar)
|
|||||||
|
|
||||||
/* loop through channels, and set up drawing depending on their type */
|
/* loop through channels, and set up drawing depending on their type */
|
||||||
{ /* first pass: just the standard GL-drawing for backdrop + text */
|
{ /* first pass: just the standard GL-drawing for backdrop + text */
|
||||||
y= (float)ACHANNEL_FIRST;
|
y = (float)ACHANNEL_FIRST;
|
||||||
|
|
||||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||||
float yminc= (float)(y - ACHANNEL_HEIGHT_HALF);
|
float yminc = (float)(y - ACHANNEL_HEIGHT_HALF);
|
||||||
float ymaxc= (float)(y + ACHANNEL_HEIGHT_HALF);
|
float ymaxc = (float)(y + ACHANNEL_HEIGHT_HALF);
|
||||||
|
|
||||||
/* check if visible */
|
/* check if visible */
|
||||||
if ( IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
|
if (IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
|
||||||
IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) )
|
IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) )
|
||||||
{
|
{
|
||||||
/* draw all channels using standard channel-drawing API */
|
/* draw all channels using standard channel-drawing API */
|
||||||
@ -119,17 +119,17 @@ void draw_channel_names(bContext *C, bAnimContext *ac, ARegion *ar)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
{ /* second pass: widgets */
|
{ /* second pass: widgets */
|
||||||
uiBlock *block= uiBeginBlock(C, ar, __func__, UI_EMBOSS);
|
uiBlock *block = uiBeginBlock(C, ar, __func__, UI_EMBOSS);
|
||||||
size_t channel_index = 0;
|
size_t channel_index = 0;
|
||||||
|
|
||||||
y= (float)ACHANNEL_FIRST;
|
y = (float)ACHANNEL_FIRST;
|
||||||
|
|
||||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||||
float yminc= (float)(y - ACHANNEL_HEIGHT_HALF);
|
float yminc = (float)(y - ACHANNEL_HEIGHT_HALF);
|
||||||
float ymaxc= (float)(y + ACHANNEL_HEIGHT_HALF);
|
float ymaxc = (float)(y + ACHANNEL_HEIGHT_HALF);
|
||||||
|
|
||||||
/* check if visible */
|
/* check if visible */
|
||||||
if ( IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
|
if (IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
|
||||||
IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) )
|
IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) )
|
||||||
{
|
{
|
||||||
/* draw all channels using standard channel-drawing API */
|
/* draw all channels using standard channel-drawing API */
|
||||||
@ -162,9 +162,9 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
|
|||||||
bAnimListElem *ale;
|
bAnimListElem *ale;
|
||||||
int filter;
|
int filter;
|
||||||
|
|
||||||
View2D *v2d= &ar->v2d;
|
View2D *v2d = &ar->v2d;
|
||||||
bDopeSheet *ads= &saction->ads;
|
bDopeSheet *ads = &saction->ads;
|
||||||
AnimData *adt= NULL;
|
AnimData *adt = NULL;
|
||||||
|
|
||||||
float act_start, act_end, y;
|
float act_start, act_end, y;
|
||||||
size_t items;
|
size_t items;
|
||||||
@ -196,8 +196,8 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* build list of channels to draw */
|
/* build list of channels to draw */
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS);
|
||||||
items= ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
items = ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
/* Update max-extent of channels here (taking into account scrollers):
|
/* Update max-extent of channels here (taking into account scrollers):
|
||||||
* - this is done to allow the channel list to be scrollable, but must be done here
|
* - this is done to allow the channel list to be scrollable, but must be done here
|
||||||
@ -205,32 +205,32 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
|
|||||||
* - offset of ACHANNEL_HEIGHT*2 is added to the height of the channels, as first is for
|
* - offset of ACHANNEL_HEIGHT*2 is added to the height of the channels, as first is for
|
||||||
* start of list offset, and the second is as a correction for the scrollers.
|
* start of list offset, and the second is as a correction for the scrollers.
|
||||||
*/
|
*/
|
||||||
height= ((items*ACHANNEL_STEP) + (ACHANNEL_HEIGHT*2));
|
height = ((items * ACHANNEL_STEP) + (ACHANNEL_HEIGHT * 2));
|
||||||
/* don't use totrect set, as the width stays the same
|
/* don't use totrect set, as the width stays the same
|
||||||
* (NOTE: this is ok here, the configuration is pretty straightforward)
|
* (NOTE: this is ok here, the configuration is pretty straightforward)
|
||||||
*/
|
*/
|
||||||
v2d->tot.ymin = (float)(-height);
|
v2d->tot.ymin = (float)(-height);
|
||||||
|
|
||||||
/* first backdrop strips */
|
/* first backdrop strips */
|
||||||
y= (float)(-ACHANNEL_HEIGHT);
|
y = (float)(-ACHANNEL_HEIGHT);
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
|
|
||||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||||
const float yminc= (float)(y - ACHANNEL_HEIGHT_HALF);
|
const float yminc = (float)(y - ACHANNEL_HEIGHT_HALF);
|
||||||
const float ymaxc= (float)(y + ACHANNEL_HEIGHT_HALF);
|
const float ymaxc = (float)(y + ACHANNEL_HEIGHT_HALF);
|
||||||
|
|
||||||
/* check if visible */
|
/* check if visible */
|
||||||
if ( IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
|
if (IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
|
||||||
IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) )
|
IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) )
|
||||||
{
|
{
|
||||||
bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
|
bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale);
|
||||||
int sel=0;
|
int sel = 0;
|
||||||
|
|
||||||
/* determine if any need to draw channel */
|
/* determine if any need to draw channel */
|
||||||
if (ale->datatype != ALE_NONE) {
|
if (ale->datatype != ALE_NONE) {
|
||||||
/* determine if channel is selected */
|
/* determine if channel is selected */
|
||||||
if (acf->has_setting(ac, ale, ACHANNEL_SETTING_SELECT))
|
if (acf->has_setting(ac, ale, ACHANNEL_SETTING_SELECT))
|
||||||
sel= ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_SELECT);
|
sel = ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_SELECT);
|
||||||
|
|
||||||
if (ELEM3(ac->datatype, ANIMCONT_ACTION, ANIMCONT_DOPESHEET, ANIMCONT_SHAPEKEY)) {
|
if (ELEM3(ac->datatype, ANIMCONT_ACTION, ANIMCONT_DOPESHEET, ANIMCONT_SHAPEKEY)) {
|
||||||
switch (ale->type) {
|
switch (ale->type) {
|
||||||
@ -274,21 +274,21 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* draw region twice: firstly backdrop, then the current range */
|
/* draw region twice: firstly backdrop, then the current range */
|
||||||
glRectf(v2d->cur.xmin, (float)y-ACHANNEL_HEIGHT_HALF, v2d->cur.xmax+EXTRA_SCROLL_PAD, (float)y+ACHANNEL_HEIGHT_HALF);
|
glRectf(v2d->cur.xmin, (float)y - ACHANNEL_HEIGHT_HALF, v2d->cur.xmax + EXTRA_SCROLL_PAD, (float)y + ACHANNEL_HEIGHT_HALF);
|
||||||
|
|
||||||
if (ac->datatype == ANIMCONT_ACTION)
|
if (ac->datatype == ANIMCONT_ACTION)
|
||||||
glRectf(act_start, (float)y-ACHANNEL_HEIGHT_HALF, act_end, (float)y+ACHANNEL_HEIGHT_HALF);
|
glRectf(act_start, (float)y - ACHANNEL_HEIGHT_HALF, act_end, (float)y + ACHANNEL_HEIGHT_HALF);
|
||||||
}
|
}
|
||||||
else if (ac->datatype == ANIMCONT_GPENCIL) {
|
else if (ac->datatype == ANIMCONT_GPENCIL) {
|
||||||
/* frames less than one get less saturated background */
|
/* frames less than one get less saturated background */
|
||||||
if (sel) glColor4ub(col1[0], col1[1], col1[2], 0x22);
|
if (sel) glColor4ub(col1[0], col1[1], col1[2], 0x22);
|
||||||
else glColor4ub(col2[0], col2[1], col2[2], 0x22);
|
else glColor4ub(col2[0], col2[1], col2[2], 0x22);
|
||||||
glRectf(0.0f, (float)y-ACHANNEL_HEIGHT_HALF, v2d->cur.xmin, (float)y+ACHANNEL_HEIGHT_HALF);
|
glRectf(0.0f, (float)y - ACHANNEL_HEIGHT_HALF, v2d->cur.xmin, (float)y + ACHANNEL_HEIGHT_HALF);
|
||||||
|
|
||||||
/* frames one and higher get a saturated background */
|
/* frames one and higher get a saturated background */
|
||||||
if (sel) glColor4ub(col1[0], col1[1], col1[2], 0x44);
|
if (sel) glColor4ub(col1[0], col1[1], col1[2], 0x44);
|
||||||
else glColor4ub(col2[0], col2[1], col2[2], 0x44);
|
else glColor4ub(col2[0], col2[1], col2[2], 0x44);
|
||||||
glRectf(v2d->cur.xmin, (float)y-ACHANNEL_HEIGHT_HALF, v2d->cur.xmax+EXTRA_SCROLL_PAD, (float)y+ACHANNEL_HEIGHT_HALF);
|
glRectf(v2d->cur.xmin, (float)y - ACHANNEL_HEIGHT_HALF, v2d->cur.xmax + EXTRA_SCROLL_PAD, (float)y + ACHANNEL_HEIGHT_HALF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -303,19 +303,19 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
|
|||||||
* This is to try to optimize this for heavier data sets
|
* This is to try to optimize this for heavier data sets
|
||||||
* 2) Keyframes which are out of view horizontally are disregarded
|
* 2) Keyframes which are out of view horizontally are disregarded
|
||||||
*/
|
*/
|
||||||
y= (float)(-ACHANNEL_HEIGHT);
|
y = (float)(-ACHANNEL_HEIGHT);
|
||||||
|
|
||||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||||
const float yminc= (float)(y - ACHANNEL_HEIGHT_HALF);
|
const float yminc = (float)(y - ACHANNEL_HEIGHT_HALF);
|
||||||
const float ymaxc= (float)(y + ACHANNEL_HEIGHT_HALF);
|
const float ymaxc = (float)(y + ACHANNEL_HEIGHT_HALF);
|
||||||
|
|
||||||
/* check if visible */
|
/* check if visible */
|
||||||
if ( IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
|
if (IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
|
||||||
IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) )
|
IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) )
|
||||||
{
|
{
|
||||||
/* check if anything to show for this channel */
|
/* check if anything to show for this channel */
|
||||||
if (ale->datatype != ALE_NONE) {
|
if (ale->datatype != ALE_NONE) {
|
||||||
adt= ANIM_nla_mapping_get(ac, ale);
|
adt = ANIM_nla_mapping_get(ac, ale);
|
||||||
|
|
||||||
/* draw 'keyframes' for each specific datatype */
|
/* draw 'keyframes' for each specific datatype */
|
||||||
switch (ale->datatype) {
|
switch (ale->datatype) {
|
||||||
@ -344,7 +344,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
y-= ACHANNEL_STEP;
|
y -= ACHANNEL_STEP;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* free tempolary channels used for drawing */
|
/* free tempolary channels used for drawing */
|
||||||
@ -355,7 +355,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
|
|||||||
glColor3f(0.0f, 0.0f, 0.0f);
|
glColor3f(0.0f, 0.0f, 0.0f);
|
||||||
|
|
||||||
glBegin(GL_LINES);
|
glBegin(GL_LINES);
|
||||||
glVertex2f(saction->timeslide, v2d->cur.ymin-EXTRA_SCROLL_PAD);
|
glVertex2f(saction->timeslide, v2d->cur.ymin - EXTRA_SCROLL_PAD);
|
||||||
glVertex2f(saction->timeslide, v2d->cur.ymax);
|
glVertex2f(saction->timeslide, v2d->cur.ymax);
|
||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ static int act_new_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
uiIDContextProperty(C, &ptr, &prop);
|
uiIDContextProperty(C, &ptr, &prop);
|
||||||
|
|
||||||
if (prop) {
|
if (prop) {
|
||||||
bAction *action=NULL, *oldact=NULL;
|
bAction *action = NULL, *oldact = NULL;
|
||||||
PointerRNA oldptr;
|
PointerRNA oldptr;
|
||||||
|
|
||||||
/* create action - the way to do this depends on whether we've got an
|
/* create action - the way to do this depends on whether we've got an
|
||||||
@ -96,13 +96,13 @@ static int act_new_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
oldptr = RNA_property_pointer_get(&ptr, prop);
|
oldptr = RNA_property_pointer_get(&ptr, prop);
|
||||||
oldact = (bAction *)oldptr.id.data;
|
oldact = (bAction *)oldptr.id.data;
|
||||||
|
|
||||||
if (oldact && GS(oldact->id.name)==ID_AC) {
|
if (oldact && GS(oldact->id.name) == ID_AC) {
|
||||||
/* make a copy of the existing action */
|
/* make a copy of the existing action */
|
||||||
action= BKE_action_copy(oldact);
|
action = BKE_action_copy(oldact);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* just make a new (empty) action */
|
/* just make a new (empty) action */
|
||||||
action= add_empty_action("Action");
|
action = add_empty_action("Action");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* when creating new ID blocks, use is already 1 (fake user),
|
/* when creating new ID blocks, use is already 1 (fake user),
|
||||||
@ -116,7 +116,7 @@ static int act_new_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* set notifier that keyframes have changed */
|
/* set notifier that keyframes have changed */
|
||||||
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
@ -134,7 +134,7 @@ void ACTION_OT_new(wmOperatorType *ot)
|
|||||||
//ot->poll = ED_operator_action_active;
|
//ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
@ -170,14 +170,14 @@ static int act_markers_make_local_poll(bContext *C)
|
|||||||
return ED_markers_get_first_selected(ED_context_get_markers(C)) != NULL;
|
return ED_markers_get_first_selected(ED_context_get_markers(C)) != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int act_markers_make_local_exec (bContext *C, wmOperator *UNUSED(op))
|
static int act_markers_make_local_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
ListBase *markers = ED_context_get_markers(C);
|
ListBase *markers = ED_context_get_markers(C);
|
||||||
|
|
||||||
SpaceAction *sact = CTX_wm_space_action(C);
|
SpaceAction *sact = CTX_wm_space_action(C);
|
||||||
bAction *act = (sact)? sact->action : NULL;
|
bAction *act = (sact) ? sact->action : NULL;
|
||||||
|
|
||||||
TimeMarker *marker, *markern=NULL;
|
TimeMarker *marker, *markern = NULL;
|
||||||
|
|
||||||
/* sanity checks */
|
/* sanity checks */
|
||||||
if (ELEM(NULL, markers, act))
|
if (ELEM(NULL, markers, act))
|
||||||
@ -198,8 +198,8 @@ static int act_markers_make_local_exec (bContext *C, wmOperator *UNUSED(op))
|
|||||||
sact->flag |= SACTION_POSEMARKERS_SHOW;
|
sact->flag |= SACTION_POSEMARKERS_SHOW;
|
||||||
|
|
||||||
/* notifiers - both sets, as this change affects both */
|
/* notifiers - both sets, as this change affects both */
|
||||||
WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL);
|
WM_event_add_notifier(C, NC_SCENE | ND_MARKERS, NULL);
|
||||||
WM_event_add_notifier(C, NC_ANIMATION|ND_MARKERS, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_MARKERS, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
@ -216,7 +216,7 @@ void ACTION_OT_markers_make_local(wmOperatorType *ot)
|
|||||||
ot->poll = act_markers_make_local_poll;
|
ot->poll = act_markers_make_local_poll;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
@ -225,7 +225,7 @@ void ACTION_OT_markers_make_local(wmOperatorType *ot)
|
|||||||
/* *************************** Calculate Range ************************** */
|
/* *************************** Calculate Range ************************** */
|
||||||
|
|
||||||
/* Get the min/max keyframes*/
|
/* Get the min/max keyframes*/
|
||||||
static void get_keyframe_extents (bAnimContext *ac, float *min, float *max, const short onlySel)
|
static void get_keyframe_extents(bAnimContext *ac, float *min, float *max, const short onlySel)
|
||||||
{
|
{
|
||||||
ListBase anim_data = {NULL, NULL};
|
ListBase anim_data = {NULL, NULL};
|
||||||
bAnimListElem *ale;
|
bAnimListElem *ale;
|
||||||
@ -234,43 +234,43 @@ static void get_keyframe_extents (bAnimContext *ac, float *min, float *max, cons
|
|||||||
/* get data to filter, from Action or Dopesheet */
|
/* get data to filter, from Action or Dopesheet */
|
||||||
// XXX: what is sel doing here?!
|
// XXX: what is sel doing here?!
|
||||||
// Commented it, was breaking things (eg. the "auto preview range" tool).
|
// Commented it, was breaking things (eg. the "auto preview range" tool).
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_SEL *//*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_SEL *//*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
||||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
/* set large values to try to override */
|
/* set large values to try to override */
|
||||||
*min= 999999999.0f;
|
*min = 999999999.0f;
|
||||||
*max= -999999999.0f;
|
*max = -999999999.0f;
|
||||||
|
|
||||||
/* check if any channels to set range with */
|
/* check if any channels to set range with */
|
||||||
if (anim_data.first) {
|
if (anim_data.first) {
|
||||||
/* go through channels, finding max extents */
|
/* go through channels, finding max extents */
|
||||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||||
AnimData *adt= ANIM_nla_mapping_get(ac, ale);
|
AnimData *adt = ANIM_nla_mapping_get(ac, ale);
|
||||||
if (ale->datatype == ALE_GPFRAME) {
|
if (ale->datatype == ALE_GPFRAME) {
|
||||||
bGPDlayer *gpl= ale->data;
|
bGPDlayer *gpl = ale->data;
|
||||||
bGPDframe *gpf;
|
bGPDframe *gpf;
|
||||||
|
|
||||||
/* find gp-frame which is less than or equal to cframe */
|
/* find gp-frame which is less than or equal to cframe */
|
||||||
for (gpf= gpl->frames.first; gpf; gpf= gpf->next) {
|
for (gpf = gpl->frames.first; gpf; gpf = gpf->next) {
|
||||||
*min= MIN2(*min, gpf->framenum);
|
*min = MIN2(*min, gpf->framenum);
|
||||||
*max= MAX2(*max, gpf->framenum);
|
*max = MAX2(*max, gpf->framenum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
FCurve *fcu= (FCurve *)ale->key_data;
|
FCurve *fcu = (FCurve *)ale->key_data;
|
||||||
float tmin, tmax;
|
float tmin, tmax;
|
||||||
|
|
||||||
/* get range and apply necessary scaling before processing */
|
/* get range and apply necessary scaling before processing */
|
||||||
calc_fcurve_range(fcu, &tmin, &tmax, onlySel, TRUE);
|
calc_fcurve_range(fcu, &tmin, &tmax, onlySel, TRUE);
|
||||||
|
|
||||||
if (adt) {
|
if (adt) {
|
||||||
tmin= BKE_nla_tweakedit_remap(adt, tmin, NLATIME_CONVERT_MAP);
|
tmin = BKE_nla_tweakedit_remap(adt, tmin, NLATIME_CONVERT_MAP);
|
||||||
tmax= BKE_nla_tweakedit_remap(adt, tmax, NLATIME_CONVERT_MAP);
|
tmax = BKE_nla_tweakedit_remap(adt, tmax, NLATIME_CONVERT_MAP);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* try to set cur using these values, if they're more extreme than previously set values */
|
/* try to set cur using these values, if they're more extreme than previously set values */
|
||||||
*min= MIN2(*min, tmin);
|
*min = MIN2(*min, tmin);
|
||||||
*max= MAX2(*max, tmax);
|
*max = MAX2(*max, tmax);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,12 +280,12 @@ static void get_keyframe_extents (bAnimContext *ac, float *min, float *max, cons
|
|||||||
else {
|
else {
|
||||||
/* set default range */
|
/* set default range */
|
||||||
if (ac->scene) {
|
if (ac->scene) {
|
||||||
*min= (float)ac->scene->r.sfra;
|
*min = (float)ac->scene->r.sfra;
|
||||||
*max= (float)ac->scene->r.efra;
|
*max = (float)ac->scene->r.efra;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
*min= -5;
|
*min = -5;
|
||||||
*max= 100;
|
*max = 100;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -304,17 +304,17 @@ static int actkeys_previewrange_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
if (ac.scene == NULL)
|
if (ac.scene == NULL)
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
else
|
else
|
||||||
scene= ac.scene;
|
scene = ac.scene;
|
||||||
|
|
||||||
/* set the range directly */
|
/* set the range directly */
|
||||||
get_keyframe_extents(&ac, &min, &max, FALSE);
|
get_keyframe_extents(&ac, &min, &max, FALSE);
|
||||||
scene->r.flag |= SCER_PRV_RANGE;
|
scene->r.flag |= SCER_PRV_RANGE;
|
||||||
scene->r.psfra= (int)floor(min + 0.5f);
|
scene->r.psfra = (int)floor(min + 0.5f);
|
||||||
scene->r.pefra= (int)floor(max + 0.5f);
|
scene->r.pefra = (int)floor(max + 0.5f);
|
||||||
|
|
||||||
/* set notifier that things have changed */
|
/* set notifier that things have changed */
|
||||||
// XXX err... there's nothing for frame ranges yet, but this should do fine too
|
// XXX err... there's nothing for frame ranges yet, but this should do fine too
|
||||||
WM_event_add_notifier(C, NC_SCENE|ND_FRAME, ac.scene);
|
WM_event_add_notifier(C, NC_SCENE | ND_FRAME, ac.scene);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
@ -331,7 +331,7 @@ void ACTION_OT_previewrange_set(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ****************** View-All Operator ****************** */
|
/* ****************** View-All Operator ****************** */
|
||||||
@ -345,12 +345,12 @@ static int actkeys_viewall(bContext *C, const short onlySel)
|
|||||||
/* get editor data */
|
/* get editor data */
|
||||||
if (ANIM_animdata_get_context(C, &ac) == 0)
|
if (ANIM_animdata_get_context(C, &ac) == 0)
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
v2d= &ac.ar->v2d;
|
v2d = &ac.ar->v2d;
|
||||||
|
|
||||||
/* set the horizontal range, with an extra offset so that the extreme keys will be in view */
|
/* set the horizontal range, with an extra offset so that the extreme keys will be in view */
|
||||||
get_keyframe_extents(&ac, &v2d->cur.xmin, &v2d->cur.xmax, onlySel);
|
get_keyframe_extents(&ac, &v2d->cur.xmin, &v2d->cur.xmax, onlySel);
|
||||||
|
|
||||||
extra= 0.1f * (v2d->cur.xmax - v2d->cur.xmin);
|
extra = 0.1f * (v2d->cur.xmax - v2d->cur.xmin);
|
||||||
v2d->cur.xmin -= extra;
|
v2d->cur.xmin -= extra;
|
||||||
v2d->cur.xmax += extra;
|
v2d->cur.xmax += extra;
|
||||||
|
|
||||||
@ -393,7 +393,7 @@ void ACTION_OT_view_all(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ACTION_OT_view_selected(wmOperatorType *ot)
|
void ACTION_OT_view_selected(wmOperatorType *ot)
|
||||||
@ -408,7 +408,7 @@ void ACTION_OT_view_selected(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
@ -417,20 +417,20 @@ void ACTION_OT_view_selected(wmOperatorType *ot)
|
|||||||
/* ******************** Copy/Paste Keyframes Operator ************************* */
|
/* ******************** Copy/Paste Keyframes Operator ************************* */
|
||||||
/* NOTE: the backend code for this is shared with the graph editor */
|
/* NOTE: the backend code for this is shared with the graph editor */
|
||||||
|
|
||||||
static short copy_action_keys (bAnimContext *ac)
|
static short copy_action_keys(bAnimContext *ac)
|
||||||
{
|
{
|
||||||
ListBase anim_data = {NULL, NULL};
|
ListBase anim_data = {NULL, NULL};
|
||||||
int filter, ok=0;
|
int filter, ok = 0;
|
||||||
|
|
||||||
/* clear buffer first */
|
/* clear buffer first */
|
||||||
free_anim_copybuf();
|
free_anim_copybuf();
|
||||||
|
|
||||||
/* filter data */
|
/* filter data */
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
||||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
/* copy keyframes */
|
/* copy keyframes */
|
||||||
ok= copy_animedit_keys(ac, &anim_data);
|
ok = copy_animedit_keys(ac, &anim_data);
|
||||||
|
|
||||||
/* clean up */
|
/* clean up */
|
||||||
BLI_freelistN(&anim_data);
|
BLI_freelistN(&anim_data);
|
||||||
@ -439,18 +439,18 @@ static short copy_action_keys (bAnimContext *ac)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static short paste_action_keys (bAnimContext *ac,
|
static short paste_action_keys(bAnimContext *ac,
|
||||||
const eKeyPasteOffset offset_mode, const eKeyMergeMode merge_mode)
|
const eKeyPasteOffset offset_mode, const eKeyMergeMode merge_mode)
|
||||||
{
|
{
|
||||||
ListBase anim_data = {NULL, NULL};
|
ListBase anim_data = {NULL, NULL};
|
||||||
int filter, ok=0;
|
int filter, ok = 0;
|
||||||
|
|
||||||
/* filter data */
|
/* filter data */
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
||||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
/* paste keyframes */
|
/* paste keyframes */
|
||||||
ok= paste_animedit_keys(ac, &anim_data, offset_mode, merge_mode);
|
ok = paste_animedit_keys(ac, &anim_data, offset_mode, merge_mode);
|
||||||
|
|
||||||
/* clean up */
|
/* clean up */
|
||||||
BLI_freelistN(&anim_data);
|
BLI_freelistN(&anim_data);
|
||||||
@ -496,22 +496,22 @@ void ACTION_OT_copy(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int actkeys_paste_exec(bContext *C, wmOperator *op)
|
static int actkeys_paste_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
bAnimContext ac;
|
bAnimContext ac;
|
||||||
|
|
||||||
const eKeyPasteOffset offset_mode= RNA_enum_get(op->ptr, "offset");
|
const eKeyPasteOffset offset_mode = RNA_enum_get(op->ptr, "offset");
|
||||||
const eKeyMergeMode merge_mode= RNA_enum_get(op->ptr, "merge");
|
const eKeyMergeMode merge_mode = RNA_enum_get(op->ptr, "merge");
|
||||||
|
|
||||||
/* get editor data */
|
/* get editor data */
|
||||||
if (ANIM_animdata_get_context(C, &ac) == 0)
|
if (ANIM_animdata_get_context(C, &ac) == 0)
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
|
|
||||||
/* ac.reports by default will be the global reports list, which won't show warnings */
|
/* ac.reports by default will be the global reports list, which won't show warnings */
|
||||||
ac.reports= op->reports;
|
ac.reports = op->reports;
|
||||||
|
|
||||||
/* paste keyframes */
|
/* paste keyframes */
|
||||||
if (ac.datatype == ANIMCONT_GPENCIL) {
|
if (ac.datatype == ANIMCONT_GPENCIL) {
|
||||||
@ -530,7 +530,7 @@ static int actkeys_paste_exec(bContext *C, wmOperator *op)
|
|||||||
ANIM_editkeyframes_refresh(&ac);
|
ANIM_editkeyframes_refresh(&ac);
|
||||||
|
|
||||||
/* set notifier that keyframes have changed */
|
/* set notifier that keyframes have changed */
|
||||||
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
@ -548,7 +548,7 @@ void ACTION_OT_paste(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
|
|
||||||
/* props */
|
/* props */
|
||||||
RNA_def_enum(ot->srna, "offset", keyframe_paste_offset_items, KEYFRAME_PASTE_OFFSET_CFRA_START, "Offset", "Paste time offset of keys");
|
RNA_def_enum(ot->srna, "offset", keyframe_paste_offset_items, KEYFRAME_PASTE_OFFSET_CFRA_START, "Offset", "Paste time offset of keys");
|
||||||
@ -573,11 +573,11 @@ static void insert_action_keys(bAnimContext *ac, short mode)
|
|||||||
int filter;
|
int filter;
|
||||||
|
|
||||||
ReportList *reports = ac->reports;
|
ReportList *reports = ac->reports;
|
||||||
Scene *scene= ac->scene;
|
Scene *scene = ac->scene;
|
||||||
short flag = 0;
|
short flag = 0;
|
||||||
|
|
||||||
/* filter data */
|
/* filter data */
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
||||||
if (mode == 2) filter |= ANIMFILTER_SEL;
|
if (mode == 2) filter |= ANIMFILTER_SEL;
|
||||||
else if (mode == 3) filter |= ANIMFILTER_ACTGROUPED;
|
else if (mode == 3) filter |= ANIMFILTER_ACTGROUPED;
|
||||||
|
|
||||||
@ -587,20 +587,20 @@ static void insert_action_keys(bAnimContext *ac, short mode)
|
|||||||
flag = ANIM_get_keyframing_flags(scene, 1);
|
flag = ANIM_get_keyframing_flags(scene, 1);
|
||||||
|
|
||||||
/* insert keyframes */
|
/* insert keyframes */
|
||||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||||
AnimData *adt= ANIM_nla_mapping_get(ac, ale);
|
AnimData *adt = ANIM_nla_mapping_get(ac, ale);
|
||||||
FCurve *fcu= (FCurve *)ale->key_data;
|
FCurve *fcu = (FCurve *)ale->key_data;
|
||||||
float cfra;
|
float cfra;
|
||||||
|
|
||||||
/* adjust current frame for NLA-scaling */
|
/* adjust current frame for NLA-scaling */
|
||||||
if (adt)
|
if (adt)
|
||||||
cfra= BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP);
|
cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP);
|
||||||
else
|
else
|
||||||
cfra= (float)CFRA;
|
cfra = (float)CFRA;
|
||||||
|
|
||||||
/* if there's an id */
|
/* if there's an id */
|
||||||
if (ale->id)
|
if (ale->id)
|
||||||
insert_keyframe(reports, ale->id, NULL, ((fcu->grp)?(fcu->grp->name):(NULL)), fcu->rna_path, fcu->array_index, cfra, flag);
|
insert_keyframe(reports, ale->id, NULL, ((fcu->grp) ? (fcu->grp->name) : (NULL)), fcu->rna_path, fcu->array_index, cfra, flag);
|
||||||
else
|
else
|
||||||
insert_vert_fcurve(fcu, cfra, fcu->curval, 0);
|
insert_vert_fcurve(fcu, cfra, fcu->curval, 0);
|
||||||
}
|
}
|
||||||
@ -622,7 +622,7 @@ static int actkeys_insertkey_exec(bContext *C, wmOperator *op)
|
|||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
|
|
||||||
/* what channels to affect? */
|
/* what channels to affect? */
|
||||||
mode= RNA_enum_get(op->ptr, "type");
|
mode = RNA_enum_get(op->ptr, "type");
|
||||||
|
|
||||||
/* insert keyframes */
|
/* insert keyframes */
|
||||||
insert_action_keys(&ac, mode);
|
insert_action_keys(&ac, mode);
|
||||||
@ -631,7 +631,7 @@ static int actkeys_insertkey_exec(bContext *C, wmOperator *op)
|
|||||||
ANIM_editkeyframes_refresh(&ac);
|
ANIM_editkeyframes_refresh(&ac);
|
||||||
|
|
||||||
/* set notifier that keyframes have changed */
|
/* set notifier that keyframes have changed */
|
||||||
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
@ -649,7 +649,7 @@ void ACTION_OT_keyframe_insert(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
|
|
||||||
/* id-props */
|
/* id-props */
|
||||||
ot->prop = RNA_def_enum(ot->srna, "type", prop_actkeys_insertkey_types, 0, "Type", "");
|
ot->prop = RNA_def_enum(ot->srna, "type", prop_actkeys_insertkey_types, 0, "Type", "");
|
||||||
@ -657,7 +657,7 @@ void ACTION_OT_keyframe_insert(wmOperatorType *ot)
|
|||||||
|
|
||||||
/* ******************** Duplicate Keyframes Operator ************************* */
|
/* ******************** Duplicate Keyframes Operator ************************* */
|
||||||
|
|
||||||
static void duplicate_action_keys (bAnimContext *ac)
|
static void duplicate_action_keys(bAnimContext *ac)
|
||||||
{
|
{
|
||||||
ListBase anim_data = {NULL, NULL};
|
ListBase anim_data = {NULL, NULL};
|
||||||
bAnimListElem *ale;
|
bAnimListElem *ale;
|
||||||
@ -665,13 +665,13 @@ static void duplicate_action_keys (bAnimContext *ac)
|
|||||||
|
|
||||||
/* filter data */
|
/* filter data */
|
||||||
if (ac->datatype == ANIMCONT_GPENCIL)
|
if (ac->datatype == ANIMCONT_GPENCIL)
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS);
|
||||||
else
|
else
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
||||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
/* loop through filtered data and delete selected keys */
|
/* loop through filtered data and delete selected keys */
|
||||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||||
if (ale->type == ANIMTYPE_FCURVE)
|
if (ale->type == ANIMTYPE_FCURVE)
|
||||||
duplicate_fcurve_keys((FCurve *)ale->key_data);
|
duplicate_fcurve_keys((FCurve *)ale->key_data);
|
||||||
else
|
else
|
||||||
@ -700,7 +700,7 @@ static int actkeys_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
ANIM_editkeyframes_refresh(&ac);
|
ANIM_editkeyframes_refresh(&ac);
|
||||||
|
|
||||||
/* set notifier that keyframes have changed */
|
/* set notifier that keyframes have changed */
|
||||||
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
@ -725,12 +725,12 @@ void ACTION_OT_duplicate(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Delete Keyframes Operator ************************* */
|
/* ******************** Delete Keyframes Operator ************************* */
|
||||||
|
|
||||||
static void delete_action_keys (bAnimContext *ac)
|
static void delete_action_keys(bAnimContext *ac)
|
||||||
{
|
{
|
||||||
ListBase anim_data = {NULL, NULL};
|
ListBase anim_data = {NULL, NULL};
|
||||||
bAnimListElem *ale;
|
bAnimListElem *ale;
|
||||||
@ -738,16 +738,16 @@ static void delete_action_keys (bAnimContext *ac)
|
|||||||
|
|
||||||
/* filter data */
|
/* filter data */
|
||||||
if (ac->datatype == ANIMCONT_GPENCIL)
|
if (ac->datatype == ANIMCONT_GPENCIL)
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS);
|
||||||
else
|
else
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
||||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
/* loop through filtered data and delete selected keys */
|
/* loop through filtered data and delete selected keys */
|
||||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||||
if (ale->type != ANIMTYPE_GPLAYER) {
|
if (ale->type != ANIMTYPE_GPLAYER) {
|
||||||
FCurve *fcu= (FCurve *)ale->key_data;
|
FCurve *fcu = (FCurve *)ale->key_data;
|
||||||
AnimData *adt= ale->adt;
|
AnimData *adt = ale->adt;
|
||||||
|
|
||||||
/* delete selected keyframes only */
|
/* delete selected keyframes only */
|
||||||
delete_fcurve_keys(fcu);
|
delete_fcurve_keys(fcu);
|
||||||
@ -782,7 +782,7 @@ static int actkeys_delete_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
ANIM_editkeyframes_refresh(&ac);
|
ANIM_editkeyframes_refresh(&ac);
|
||||||
|
|
||||||
/* set notifier that keyframes have changed */
|
/* set notifier that keyframes have changed */
|
||||||
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
@ -800,23 +800,23 @@ void ACTION_OT_delete(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Clean Keyframes Operator ************************* */
|
/* ******************** Clean Keyframes Operator ************************* */
|
||||||
|
|
||||||
static void clean_action_keys (bAnimContext *ac, float thresh)
|
static void clean_action_keys(bAnimContext *ac, float thresh)
|
||||||
{
|
{
|
||||||
ListBase anim_data = {NULL, NULL};
|
ListBase anim_data = {NULL, NULL};
|
||||||
bAnimListElem *ale;
|
bAnimListElem *ale;
|
||||||
int filter;
|
int filter;
|
||||||
|
|
||||||
/* filter data */
|
/* filter data */
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_SEL /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_SEL /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
||||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
/* loop through filtered data and clean curves */
|
/* loop through filtered data and clean curves */
|
||||||
for (ale= anim_data.first; ale; ale= ale->next)
|
for (ale = anim_data.first; ale; ale = ale->next)
|
||||||
clean_fcurve((FCurve *)ale->key_data, thresh);
|
clean_fcurve((FCurve *)ale->key_data, thresh);
|
||||||
|
|
||||||
/* free temp data */
|
/* free temp data */
|
||||||
@ -837,7 +837,7 @@ static int actkeys_clean_exec(bContext *C, wmOperator *op)
|
|||||||
return OPERATOR_PASS_THROUGH;
|
return OPERATOR_PASS_THROUGH;
|
||||||
|
|
||||||
/* get cleaning threshold */
|
/* get cleaning threshold */
|
||||||
thresh= RNA_float_get(op->ptr, "threshold");
|
thresh = RNA_float_get(op->ptr, "threshold");
|
||||||
|
|
||||||
/* clean keyframes */
|
/* clean keyframes */
|
||||||
clean_action_keys(&ac, thresh);
|
clean_action_keys(&ac, thresh);
|
||||||
@ -846,7 +846,7 @@ static int actkeys_clean_exec(bContext *C, wmOperator *op)
|
|||||||
ANIM_editkeyframes_refresh(&ac);
|
ANIM_editkeyframes_refresh(&ac);
|
||||||
|
|
||||||
/* set notifier that keyframes have changed */
|
/* set notifier that keyframes have changed */
|
||||||
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
@ -864,7 +864,7 @@ void ACTION_OT_clean(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
|
|
||||||
/* properties */
|
/* properties */
|
||||||
ot->prop = RNA_def_float(ot->srna, "threshold", 0.001f, 0.0f, FLT_MAX, "Threshold", "", 0.0f, 1000.0f);
|
ot->prop = RNA_def_float(ot->srna, "threshold", 0.001f, 0.0f, FLT_MAX, "Threshold", "", 0.0f, 1000.0f);
|
||||||
@ -873,18 +873,18 @@ void ACTION_OT_clean(wmOperatorType *ot)
|
|||||||
/* ******************** Sample Keyframes Operator *********************** */
|
/* ******************** Sample Keyframes Operator *********************** */
|
||||||
|
|
||||||
/* Evaluates the curves between each selected keyframe on each frame, and keys the value */
|
/* Evaluates the curves between each selected keyframe on each frame, and keys the value */
|
||||||
static void sample_action_keys (bAnimContext *ac)
|
static void sample_action_keys(bAnimContext *ac)
|
||||||
{
|
{
|
||||||
ListBase anim_data = {NULL, NULL};
|
ListBase anim_data = {NULL, NULL};
|
||||||
bAnimListElem *ale;
|
bAnimListElem *ale;
|
||||||
int filter;
|
int filter;
|
||||||
|
|
||||||
/* filter data */
|
/* filter data */
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
||||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
/* loop through filtered data and add keys between selected keyframes on every frame */
|
/* loop through filtered data and add keys between selected keyframes on every frame */
|
||||||
for (ale= anim_data.first; ale; ale= ale->next)
|
for (ale = anim_data.first; ale; ale = ale->next)
|
||||||
sample_fcurve((FCurve *)ale->key_data);
|
sample_fcurve((FCurve *)ale->key_data);
|
||||||
|
|
||||||
/* admin and redraws */
|
/* admin and redraws */
|
||||||
@ -910,7 +910,7 @@ static int actkeys_sample_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
ANIM_editkeyframes_refresh(&ac);
|
ANIM_editkeyframes_refresh(&ac);
|
||||||
|
|
||||||
/* set notifier that keyframes have changed */
|
/* set notifier that keyframes have changed */
|
||||||
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
@ -927,7 +927,7 @@ void ACTION_OT_sample(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
@ -957,16 +957,16 @@ static void setexpo_action_keys(bAnimContext *ac, short mode)
|
|||||||
int filter;
|
int filter;
|
||||||
|
|
||||||
/* filter data */
|
/* filter data */
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_SEL /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_SEL /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
||||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
/* loop through setting mode per F-Curve */
|
/* loop through setting mode per F-Curve */
|
||||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||||
FCurve *fcu= (FCurve *)ale->data;
|
FCurve *fcu = (FCurve *)ale->data;
|
||||||
|
|
||||||
if (mode >= 0) {
|
if (mode >= 0) {
|
||||||
/* just set mode setting */
|
/* just set mode setting */
|
||||||
fcu->extend= mode;
|
fcu->extend = mode;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* shortcuts for managing Cycles F-Modifiers to make it easier to toggle cyclic animation
|
/* shortcuts for managing Cycles F-Modifiers to make it easier to toggle cyclic animation
|
||||||
@ -981,7 +981,7 @@ static void setexpo_action_keys(bAnimContext *ac, short mode)
|
|||||||
}
|
}
|
||||||
else if (mode == CLEAR_CYCLIC_EXPO) {
|
else if (mode == CLEAR_CYCLIC_EXPO) {
|
||||||
/* remove all the modifiers fitting this description */
|
/* remove all the modifiers fitting this description */
|
||||||
FModifier *fcm, *fcn=NULL;
|
FModifier *fcm, *fcn = NULL;
|
||||||
|
|
||||||
for (fcm = fcu->modifiers.first; fcm; fcm = fcn) {
|
for (fcm = fcu->modifiers.first; fcm; fcm = fcn) {
|
||||||
fcn = fcm->next;
|
fcn = fcm->next;
|
||||||
@ -1011,7 +1011,7 @@ static int actkeys_expo_exec(bContext *C, wmOperator *op)
|
|||||||
return OPERATOR_PASS_THROUGH;
|
return OPERATOR_PASS_THROUGH;
|
||||||
|
|
||||||
/* get handle setting mode */
|
/* get handle setting mode */
|
||||||
mode= RNA_enum_get(op->ptr, "type");
|
mode = RNA_enum_get(op->ptr, "type");
|
||||||
|
|
||||||
/* set handle type */
|
/* set handle type */
|
||||||
setexpo_action_keys(&ac, mode);
|
setexpo_action_keys(&ac, mode);
|
||||||
@ -1020,7 +1020,7 @@ static int actkeys_expo_exec(bContext *C, wmOperator *op)
|
|||||||
ANIM_editkeyframes_refresh(&ac);
|
ANIM_editkeyframes_refresh(&ac);
|
||||||
|
|
||||||
/* set notifier that keyframe properties have changed */
|
/* set notifier that keyframe properties have changed */
|
||||||
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
@ -1038,7 +1038,7 @@ void ACTION_OT_extrapolation_type(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
|
|
||||||
/* id-props */
|
/* id-props */
|
||||||
ot->prop = RNA_def_enum(ot->srna, "type", prop_actkeys_expo_types, 0, "Type", "");
|
ot->prop = RNA_def_enum(ot->srna, "type", prop_actkeys_expo_types, 0, "Type", "");
|
||||||
@ -1052,16 +1052,16 @@ static void setipo_action_keys(bAnimContext *ac, short mode)
|
|||||||
ListBase anim_data = {NULL, NULL};
|
ListBase anim_data = {NULL, NULL};
|
||||||
bAnimListElem *ale;
|
bAnimListElem *ale;
|
||||||
int filter;
|
int filter;
|
||||||
KeyframeEditFunc set_cb= ANIM_editkeyframes_ipo(mode);
|
KeyframeEditFunc set_cb = ANIM_editkeyframes_ipo(mode);
|
||||||
|
|
||||||
/* filter data */
|
/* filter data */
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
||||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
/* loop through setting BezTriple interpolation
|
/* loop through setting BezTriple interpolation
|
||||||
* Note: we do not supply KeyframeEditData to the looper yet. Currently that's not necessary here...
|
* Note: we do not supply KeyframeEditData to the looper yet. Currently that's not necessary here...
|
||||||
*/
|
*/
|
||||||
for (ale= anim_data.first; ale; ale= ale->next)
|
for (ale = anim_data.first; ale; ale = ale->next)
|
||||||
ANIM_fcurve_keyframes_loop(NULL, ale->key_data, NULL, set_cb, calchandles_fcurve);
|
ANIM_fcurve_keyframes_loop(NULL, ale->key_data, NULL, set_cb, calchandles_fcurve);
|
||||||
|
|
||||||
/* cleanup */
|
/* cleanup */
|
||||||
@ -1082,7 +1082,7 @@ static int actkeys_ipo_exec(bContext *C, wmOperator *op)
|
|||||||
return OPERATOR_PASS_THROUGH;
|
return OPERATOR_PASS_THROUGH;
|
||||||
|
|
||||||
/* get handle setting mode */
|
/* get handle setting mode */
|
||||||
mode= RNA_enum_get(op->ptr, "type");
|
mode = RNA_enum_get(op->ptr, "type");
|
||||||
|
|
||||||
/* set handle type */
|
/* set handle type */
|
||||||
setipo_action_keys(&ac, mode);
|
setipo_action_keys(&ac, mode);
|
||||||
@ -1091,7 +1091,7 @@ static int actkeys_ipo_exec(bContext *C, wmOperator *op)
|
|||||||
ANIM_editkeyframes_refresh(&ac);
|
ANIM_editkeyframes_refresh(&ac);
|
||||||
|
|
||||||
/* set notifier that keyframe properties have changed */
|
/* set notifier that keyframe properties have changed */
|
||||||
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
@ -1109,7 +1109,7 @@ void ACTION_OT_interpolation_type(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
|
|
||||||
/* id-props */
|
/* id-props */
|
||||||
ot->prop = RNA_def_enum(ot->srna, "type", beztriple_interpolation_mode_items, 0, "Type", "");
|
ot->prop = RNA_def_enum(ot->srna, "type", beztriple_interpolation_mode_items, 0, "Type", "");
|
||||||
@ -1124,18 +1124,18 @@ static void sethandles_action_keys(bAnimContext *ac, short mode)
|
|||||||
bAnimListElem *ale;
|
bAnimListElem *ale;
|
||||||
int filter;
|
int filter;
|
||||||
|
|
||||||
KeyframeEditFunc edit_cb= ANIM_editkeyframes_handles(mode);
|
KeyframeEditFunc edit_cb = ANIM_editkeyframes_handles(mode);
|
||||||
KeyframeEditFunc sel_cb= ANIM_editkeyframes_ok(BEZT_OK_SELECTED);
|
KeyframeEditFunc sel_cb = ANIM_editkeyframes_ok(BEZT_OK_SELECTED);
|
||||||
|
|
||||||
/* filter data */
|
/* filter data */
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
||||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
/* loop through setting flags for handles
|
/* loop through setting flags for handles
|
||||||
* Note: we do not supply KeyframeEditData to the looper yet. Currently that's not necessary here...
|
* Note: we do not supply KeyframeEditData to the looper yet. Currently that's not necessary here...
|
||||||
*/
|
*/
|
||||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||||
FCurve *fcu= (FCurve *)ale->key_data;
|
FCurve *fcu = (FCurve *)ale->key_data;
|
||||||
|
|
||||||
/* any selected keyframes for editing? */
|
/* any selected keyframes for editing? */
|
||||||
if (ANIM_fcurve_keyframes_loop(NULL, fcu, NULL, sel_cb, NULL)) {
|
if (ANIM_fcurve_keyframes_loop(NULL, fcu, NULL, sel_cb, NULL)) {
|
||||||
@ -1162,7 +1162,7 @@ static int actkeys_handletype_exec(bContext *C, wmOperator *op)
|
|||||||
return OPERATOR_PASS_THROUGH;
|
return OPERATOR_PASS_THROUGH;
|
||||||
|
|
||||||
/* get handle setting mode */
|
/* get handle setting mode */
|
||||||
mode= RNA_enum_get(op->ptr, "type");
|
mode = RNA_enum_get(op->ptr, "type");
|
||||||
|
|
||||||
/* set handle type */
|
/* set handle type */
|
||||||
sethandles_action_keys(&ac, mode);
|
sethandles_action_keys(&ac, mode);
|
||||||
@ -1171,7 +1171,7 @@ static int actkeys_handletype_exec(bContext *C, wmOperator *op)
|
|||||||
ANIM_editkeyframes_refresh(&ac);
|
ANIM_editkeyframes_refresh(&ac);
|
||||||
|
|
||||||
/* set notifier that keyframe properties have changed */
|
/* set notifier that keyframe properties have changed */
|
||||||
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
@ -1189,7 +1189,7 @@ void ACTION_OT_handle_type(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
|
|
||||||
/* id-props */
|
/* id-props */
|
||||||
ot->prop = RNA_def_enum(ot->srna, "type", keyframe_handle_type_items, 0, "Type", "");
|
ot->prop = RNA_def_enum(ot->srna, "type", keyframe_handle_type_items, 0, "Type", "");
|
||||||
@ -1203,16 +1203,16 @@ static void setkeytype_action_keys(bAnimContext *ac, short mode)
|
|||||||
ListBase anim_data = {NULL, NULL};
|
ListBase anim_data = {NULL, NULL};
|
||||||
bAnimListElem *ale;
|
bAnimListElem *ale;
|
||||||
int filter;
|
int filter;
|
||||||
KeyframeEditFunc set_cb= ANIM_editkeyframes_keytype(mode);
|
KeyframeEditFunc set_cb = ANIM_editkeyframes_keytype(mode);
|
||||||
|
|
||||||
/* filter data */
|
/* filter data */
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
||||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
/* loop through setting BezTriple interpolation
|
/* loop through setting BezTriple interpolation
|
||||||
* Note: we do not supply KeyframeEditData to the looper yet. Currently that's not necessary here...
|
* Note: we do not supply KeyframeEditData to the looper yet. Currently that's not necessary here...
|
||||||
*/
|
*/
|
||||||
for (ale= anim_data.first; ale; ale= ale->next)
|
for (ale = anim_data.first; ale; ale = ale->next)
|
||||||
ANIM_fcurve_keyframes_loop(NULL, ale->key_data, NULL, set_cb, NULL);
|
ANIM_fcurve_keyframes_loop(NULL, ale->key_data, NULL, set_cb, NULL);
|
||||||
|
|
||||||
/* cleanup */
|
/* cleanup */
|
||||||
@ -1233,7 +1233,7 @@ static int actkeys_keytype_exec(bContext *C, wmOperator *op)
|
|||||||
return OPERATOR_PASS_THROUGH;
|
return OPERATOR_PASS_THROUGH;
|
||||||
|
|
||||||
/* get handle setting mode */
|
/* get handle setting mode */
|
||||||
mode= RNA_enum_get(op->ptr, "type");
|
mode = RNA_enum_get(op->ptr, "type");
|
||||||
|
|
||||||
/* set handle type */
|
/* set handle type */
|
||||||
setkeytype_action_keys(&ac, mode);
|
setkeytype_action_keys(&ac, mode);
|
||||||
@ -1242,7 +1242,7 @@ static int actkeys_keytype_exec(bContext *C, wmOperator *op)
|
|||||||
ANIM_editkeyframes_refresh(&ac);
|
ANIM_editkeyframes_refresh(&ac);
|
||||||
|
|
||||||
/* set notifier that keyframe properties have changed */
|
/* set notifier that keyframe properties have changed */
|
||||||
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
@ -1260,7 +1260,7 @@ void ACTION_OT_keyframe_type(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
|
|
||||||
/* id-props */
|
/* id-props */
|
||||||
ot->prop = RNA_def_enum(ot->srna, "type", beztriple_keyframe_type_items, 0, "Type", "");
|
ot->prop = RNA_def_enum(ot->srna, "type", beztriple_keyframe_type_items, 0, "Type", "");
|
||||||
@ -1275,10 +1275,10 @@ void ACTION_OT_keyframe_type(wmOperatorType *ot)
|
|||||||
static int actkeys_framejump_exec(bContext *C, wmOperator *UNUSED(op))
|
static int actkeys_framejump_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
bAnimContext ac;
|
bAnimContext ac;
|
||||||
ListBase anim_data= {NULL, NULL};
|
ListBase anim_data = {NULL, NULL};
|
||||||
bAnimListElem *ale;
|
bAnimListElem *ale;
|
||||||
int filter;
|
int filter;
|
||||||
KeyframeEditData ked= {{NULL}};
|
KeyframeEditData ked = {{NULL}};
|
||||||
|
|
||||||
/* get editor data */
|
/* get editor data */
|
||||||
if (ANIM_animdata_get_context(C, &ac) == 0)
|
if (ANIM_animdata_get_context(C, &ac) == 0)
|
||||||
@ -1286,11 +1286,11 @@ static int actkeys_framejump_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
|
|
||||||
/* init edit data */
|
/* init edit data */
|
||||||
/* loop over action data, averaging values */
|
/* loop over action data, averaging values */
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY */ | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY */ | ANIMFILTER_NODUPLIS);
|
||||||
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
|
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
|
||||||
|
|
||||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||||
AnimData *adt= ANIM_nla_mapping_get(&ac, ale);
|
AnimData *adt = ANIM_nla_mapping_get(&ac, ale);
|
||||||
if (adt) {
|
if (adt) {
|
||||||
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1);
|
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1);
|
||||||
ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, bezt_calc_average, NULL);
|
ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, bezt_calc_average, NULL);
|
||||||
@ -1304,13 +1304,13 @@ static int actkeys_framejump_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
|
|
||||||
/* set the new current frame value, based on the average time */
|
/* set the new current frame value, based on the average time */
|
||||||
if (ked.i1) {
|
if (ked.i1) {
|
||||||
Scene *scene= ac.scene;
|
Scene *scene = ac.scene;
|
||||||
CFRA= (int)floor((ked.f1 / ked.i1) + 0.5f);
|
CFRA = (int)floor((ked.f1 / ked.i1) + 0.5f);
|
||||||
SUBFRA= 0.f;
|
SUBFRA = 0.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set notifier that things have changed */
|
/* set notifier that things have changed */
|
||||||
WM_event_add_notifier(C, NC_SCENE|ND_FRAME, ac.scene);
|
WM_event_add_notifier(C, NC_SCENE | ND_FRAME, ac.scene);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
@ -1327,7 +1327,7 @@ void ACTION_OT_frame_jump(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Snap Keyframes Operator *********************** */
|
/* ******************** Snap Keyframes Operator *********************** */
|
||||||
@ -1348,28 +1348,28 @@ static void snap_action_keys(bAnimContext *ac, short mode)
|
|||||||
bAnimListElem *ale;
|
bAnimListElem *ale;
|
||||||
int filter;
|
int filter;
|
||||||
|
|
||||||
KeyframeEditData ked= {{NULL}};
|
KeyframeEditData ked = {{NULL}};
|
||||||
KeyframeEditFunc edit_cb;
|
KeyframeEditFunc edit_cb;
|
||||||
|
|
||||||
/* filter data */
|
/* filter data */
|
||||||
if (ac->datatype == ANIMCONT_GPENCIL)
|
if (ac->datatype == ANIMCONT_GPENCIL)
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT);
|
||||||
else
|
else
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
||||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
/* get beztriple editing callbacks */
|
/* get beztriple editing callbacks */
|
||||||
edit_cb= ANIM_editkeyframes_snap(mode);
|
edit_cb = ANIM_editkeyframes_snap(mode);
|
||||||
|
|
||||||
ked.scene= ac->scene;
|
ked.scene = ac->scene;
|
||||||
if (mode == ACTKEYS_SNAP_NEAREST_MARKER) {
|
if (mode == ACTKEYS_SNAP_NEAREST_MARKER) {
|
||||||
ked.list.first= (ac->markers) ? ac->markers->first : NULL;
|
ked.list.first = (ac->markers) ? ac->markers->first : NULL;
|
||||||
ked.list.last= (ac->markers) ? ac->markers->last : NULL;
|
ked.list.last = (ac->markers) ? ac->markers->last : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* snap keyframes */
|
/* snap keyframes */
|
||||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||||
AnimData *adt= ANIM_nla_mapping_get(ac, ale);
|
AnimData *adt = ANIM_nla_mapping_get(ac, ale);
|
||||||
|
|
||||||
if (adt) {
|
if (adt) {
|
||||||
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1);
|
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1);
|
||||||
@ -1401,7 +1401,7 @@ static int actkeys_snap_exec(bContext *C, wmOperator *op)
|
|||||||
return OPERATOR_PASS_THROUGH;
|
return OPERATOR_PASS_THROUGH;
|
||||||
|
|
||||||
/* get snapping mode */
|
/* get snapping mode */
|
||||||
mode= RNA_enum_get(op->ptr, "type");
|
mode = RNA_enum_get(op->ptr, "type");
|
||||||
|
|
||||||
/* snap keyframes */
|
/* snap keyframes */
|
||||||
snap_action_keys(&ac, mode);
|
snap_action_keys(&ac, mode);
|
||||||
@ -1410,7 +1410,7 @@ static int actkeys_snap_exec(bContext *C, wmOperator *op)
|
|||||||
ANIM_editkeyframes_refresh(&ac);
|
ANIM_editkeyframes_refresh(&ac);
|
||||||
|
|
||||||
/* set notifier that keyframes have changed */
|
/* set notifier that keyframes have changed */
|
||||||
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
@ -1428,7 +1428,7 @@ void ACTION_OT_snap(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
|
|
||||||
/* id-props */
|
/* id-props */
|
||||||
ot->prop = RNA_def_enum(ot->srna, "type", prop_actkeys_snap_types, 0, "Type", "");
|
ot->prop = RNA_def_enum(ot->srna, "type", prop_actkeys_snap_types, 0, "Type", "");
|
||||||
@ -1451,39 +1451,39 @@ static void mirror_action_keys(bAnimContext *ac, short mode)
|
|||||||
bAnimListElem *ale;
|
bAnimListElem *ale;
|
||||||
int filter;
|
int filter;
|
||||||
|
|
||||||
KeyframeEditData ked= {{NULL}};
|
KeyframeEditData ked = {{NULL}};
|
||||||
KeyframeEditFunc edit_cb;
|
KeyframeEditFunc edit_cb;
|
||||||
|
|
||||||
/* get beztriple editing callbacks */
|
/* get beztriple editing callbacks */
|
||||||
edit_cb= ANIM_editkeyframes_mirror(mode);
|
edit_cb = ANIM_editkeyframes_mirror(mode);
|
||||||
|
|
||||||
ked.scene= ac->scene;
|
ked.scene = ac->scene;
|
||||||
|
|
||||||
/* for 'first selected marker' mode, need to find first selected marker first! */
|
/* for 'first selected marker' mode, need to find first selected marker first! */
|
||||||
// XXX should this be made into a helper func in the API?
|
// XXX should this be made into a helper func in the API?
|
||||||
if (mode == ACTKEYS_MIRROR_MARKER) {
|
if (mode == ACTKEYS_MIRROR_MARKER) {
|
||||||
TimeMarker *marker= NULL;
|
TimeMarker *marker = NULL;
|
||||||
|
|
||||||
/* find first selected marker */
|
/* find first selected marker */
|
||||||
marker= ED_markers_get_first_selected(ac->markers);
|
marker = ED_markers_get_first_selected(ac->markers);
|
||||||
|
|
||||||
/* store marker's time (if available) */
|
/* store marker's time (if available) */
|
||||||
if (marker)
|
if (marker)
|
||||||
ked.f1= (float)marker->frame;
|
ked.f1 = (float)marker->frame;
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* filter data */
|
/* filter data */
|
||||||
if (ac->datatype == ANIMCONT_GPENCIL)
|
if (ac->datatype == ANIMCONT_GPENCIL)
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS);
|
||||||
else
|
else
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
||||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
/* mirror keyframes */
|
/* mirror keyframes */
|
||||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||||
AnimData *adt= ANIM_nla_mapping_get(ac, ale);
|
AnimData *adt = ANIM_nla_mapping_get(ac, ale);
|
||||||
|
|
||||||
if (adt) {
|
if (adt) {
|
||||||
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1);
|
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1);
|
||||||
@ -1515,7 +1515,7 @@ static int actkeys_mirror_exec(bContext *C, wmOperator *op)
|
|||||||
return OPERATOR_PASS_THROUGH;
|
return OPERATOR_PASS_THROUGH;
|
||||||
|
|
||||||
/* get mirroring mode */
|
/* get mirroring mode */
|
||||||
mode= RNA_enum_get(op->ptr, "type");
|
mode = RNA_enum_get(op->ptr, "type");
|
||||||
|
|
||||||
/* mirror keyframes */
|
/* mirror keyframes */
|
||||||
mirror_action_keys(&ac, mode);
|
mirror_action_keys(&ac, mode);
|
||||||
@ -1524,7 +1524,7 @@ static int actkeys_mirror_exec(bContext *C, wmOperator *op)
|
|||||||
ANIM_editkeyframes_refresh(&ac);
|
ANIM_editkeyframes_refresh(&ac);
|
||||||
|
|
||||||
/* set notifier that keyframes have changed */
|
/* set notifier that keyframes have changed */
|
||||||
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
@ -1542,7 +1542,7 @@ void ACTION_OT_mirror(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
|
|
||||||
/* id-props */
|
/* id-props */
|
||||||
ot->prop = RNA_def_enum(ot->srna, "type", prop_actkeys_mirror_types, 0, "Type", "");
|
ot->prop = RNA_def_enum(ot->srna, "type", prop_actkeys_mirror_types, 0, "Type", "");
|
||||||
|
@ -96,7 +96,7 @@ void ED_operatormacros_action(void)
|
|||||||
|
|
||||||
ot = WM_operatortype_append_macro("ACTION_OT_duplicate_move", "Duplicate",
|
ot = WM_operatortype_append_macro("ACTION_OT_duplicate_move", "Duplicate",
|
||||||
"Make a copy of all selected keyframes and move them",
|
"Make a copy of all selected keyframes and move them",
|
||||||
OPTYPE_UNDO|OPTYPE_REGISTER);
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||||
if (ot) {
|
if (ot) {
|
||||||
WM_operatortype_macro_define(ot, "ACTION_OT_duplicate");
|
WM_operatortype_macro_define(ot, "ACTION_OT_duplicate");
|
||||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform");
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform");
|
||||||
@ -107,7 +107,7 @@ void ED_operatormacros_action(void)
|
|||||||
|
|
||||||
/* ************************** registration - keymaps **********************************/
|
/* ************************** registration - keymaps **********************************/
|
||||||
|
|
||||||
static void action_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap)
|
static void action_keymap_keyframes(wmKeyConfig *keyconf, wmKeyMap *keymap)
|
||||||
{
|
{
|
||||||
wmKeyMapItem *kmi;
|
wmKeyMapItem *kmi;
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ static void action_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap)
|
|||||||
kmi = WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0);
|
kmi = WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0);
|
||||||
RNA_boolean_set(kmi->ptr, "extend", TRUE);
|
RNA_boolean_set(kmi->ptr, "extend", TRUE);
|
||||||
RNA_boolean_set(kmi->ptr, "column", FALSE);
|
RNA_boolean_set(kmi->ptr, "column", FALSE);
|
||||||
kmi = WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT|KM_SHIFT, 0);
|
kmi = WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT | KM_SHIFT, 0);
|
||||||
RNA_boolean_set(kmi->ptr, "extend", TRUE);
|
RNA_boolean_set(kmi->ptr, "extend", TRUE);
|
||||||
RNA_boolean_set(kmi->ptr, "column", TRUE);
|
RNA_boolean_set(kmi->ptr, "column", TRUE);
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ static void action_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap)
|
|||||||
kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
|
kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
|
||||||
RNA_boolean_set(kmi->ptr, "extend", FALSE);
|
RNA_boolean_set(kmi->ptr, "extend", FALSE);
|
||||||
RNA_enum_set(kmi->ptr, "mode", ACTKEYS_LRSEL_TEST);
|
RNA_enum_set(kmi->ptr, "mode", ACTKEYS_LRSEL_TEST);
|
||||||
kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
|
kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
|
||||||
RNA_boolean_set(kmi->ptr, "extend", TRUE);
|
RNA_boolean_set(kmi->ptr, "extend", TRUE);
|
||||||
RNA_enum_set(kmi->ptr, "mode", ACTKEYS_LRSEL_TEST);
|
RNA_enum_set(kmi->ptr, "mode", ACTKEYS_LRSEL_TEST);
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ static void action_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap)
|
|||||||
/* action_edit.c */
|
/* action_edit.c */
|
||||||
/* snap - current frame to selected keys */
|
/* snap - current frame to selected keys */
|
||||||
// TODO: maybe since this is called jump, we're better to have it on <something>-J?
|
// TODO: maybe since this is called jump, we're better to have it on <something>-J?
|
||||||
WM_keymap_add_item(keymap, "ACTION_OT_frame_jump", SKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
|
WM_keymap_add_item(keymap, "ACTION_OT_frame_jump", SKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
|
||||||
|
|
||||||
/* menu + single-step transform */
|
/* menu + single-step transform */
|
||||||
WM_keymap_add_item(keymap, "ACTION_OT_snap", SKEY, KM_PRESS, KM_SHIFT, 0);
|
WM_keymap_add_item(keymap, "ACTION_OT_snap", SKEY, KM_PRESS, KM_SHIFT, 0);
|
||||||
@ -197,7 +197,7 @@ static void action_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap)
|
|||||||
WM_keymap_add_item(keymap, "ACTION_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0);
|
WM_keymap_add_item(keymap, "ACTION_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0);
|
||||||
|
|
||||||
/* auto-set range */
|
/* auto-set range */
|
||||||
WM_keymap_add_item(keymap, "ACTION_OT_previewrange_set", PKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
|
WM_keymap_add_item(keymap, "ACTION_OT_previewrange_set", PKEY, KM_PRESS, KM_CTRL | KM_ALT, 0);
|
||||||
WM_keymap_add_item(keymap, "ACTION_OT_view_all", HOMEKEY, KM_PRESS, 0, 0);
|
WM_keymap_add_item(keymap, "ACTION_OT_view_all", HOMEKEY, KM_PRESS, 0, 0);
|
||||||
WM_keymap_add_item(keymap, "ACTION_OT_view_selected", PADPERIOD, KM_PRESS, 0, 0);
|
WM_keymap_add_item(keymap, "ACTION_OT_view_selected", PADPERIOD, KM_PRESS, 0, 0);
|
||||||
|
|
||||||
|
@ -82,39 +82,39 @@
|
|||||||
* - test: check if select or deselect all
|
* - test: check if select or deselect all
|
||||||
* - sel: how to select keyframes (SELECT_*)
|
* - sel: how to select keyframes (SELECT_*)
|
||||||
*/
|
*/
|
||||||
static void deselect_action_keys (bAnimContext *ac, short test, short sel)
|
static void deselect_action_keys(bAnimContext *ac, short test, short sel)
|
||||||
{
|
{
|
||||||
ListBase anim_data = {NULL, NULL};
|
ListBase anim_data = {NULL, NULL};
|
||||||
bAnimListElem *ale;
|
bAnimListElem *ale;
|
||||||
int filter;
|
int filter;
|
||||||
|
|
||||||
KeyframeEditData ked= {{NULL}};
|
KeyframeEditData ked = {{NULL}};
|
||||||
KeyframeEditFunc test_cb, sel_cb;
|
KeyframeEditFunc test_cb, sel_cb;
|
||||||
|
|
||||||
/* determine type-based settings */
|
/* determine type-based settings */
|
||||||
if (ac->datatype == ANIMCONT_GPENCIL)
|
if (ac->datatype == ANIMCONT_GPENCIL)
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_NODUPLIS);
|
||||||
else
|
else
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
||||||
|
|
||||||
/* filter data */
|
/* filter data */
|
||||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
/* init BezTriple looping data */
|
/* init BezTriple looping data */
|
||||||
test_cb= ANIM_editkeyframes_ok(BEZT_OK_SELECTED);
|
test_cb = ANIM_editkeyframes_ok(BEZT_OK_SELECTED);
|
||||||
|
|
||||||
/* See if we should be selecting or deselecting */
|
/* See if we should be selecting or deselecting */
|
||||||
if (test) {
|
if (test) {
|
||||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||||
if (ale->type == ANIMTYPE_GPLAYER) {
|
if (ale->type == ANIMTYPE_GPLAYER) {
|
||||||
if (is_gplayer_frame_selected(ale->data)) {
|
if (is_gplayer_frame_selected(ale->data)) {
|
||||||
sel= SELECT_SUBTRACT;
|
sel = SELECT_SUBTRACT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, test_cb, NULL)) {
|
if (ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, test_cb, NULL)) {
|
||||||
sel= SELECT_SUBTRACT;
|
sel = SELECT_SUBTRACT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -122,10 +122,10 @@ static void deselect_action_keys (bAnimContext *ac, short test, short sel)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* convert sel to selectmode, and use that to get editor */
|
/* convert sel to selectmode, and use that to get editor */
|
||||||
sel_cb= ANIM_editkeyframes_select(sel);
|
sel_cb = ANIM_editkeyframes_select(sel);
|
||||||
|
|
||||||
/* Now set the flags */
|
/* Now set the flags */
|
||||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||||
if (ale->type == ANIMTYPE_GPLAYER)
|
if (ale->type == ANIMTYPE_GPLAYER)
|
||||||
set_gplayer_frame_selection(ale->data, sel);
|
set_gplayer_frame_selection(ale->data, sel);
|
||||||
else
|
else
|
||||||
@ -153,7 +153,7 @@ static int actkeys_deselectall_exec(bContext *C, wmOperator *op)
|
|||||||
deselect_action_keys(&ac, 1, SELECT_ADD);
|
deselect_action_keys(&ac, 1, SELECT_ADD);
|
||||||
|
|
||||||
/* set notifier that keyframe selection have changed */
|
/* set notifier that keyframe selection have changed */
|
||||||
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
@ -170,7 +170,7 @@ void ACTION_OT_select_all_toggle(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
|
|
||||||
/* props */
|
/* props */
|
||||||
ot->prop = RNA_def_boolean(ot->srna, "invert", 0, "Invert", "");
|
ot->prop = RNA_def_boolean(ot->srna, "invert", 0, "Invert", "");
|
||||||
@ -192,7 +192,7 @@ enum {
|
|||||||
} /*eActKeys_BorderSelect_Mode*/;
|
} /*eActKeys_BorderSelect_Mode*/;
|
||||||
|
|
||||||
|
|
||||||
static void borderselect_action (bAnimContext *ac, rcti rect, short mode, short selectmode)
|
static void borderselect_action(bAnimContext *ac, rcti rect, short mode, short selectmode)
|
||||||
{
|
{
|
||||||
ListBase anim_data = {NULL, NULL};
|
ListBase anim_data = {NULL, NULL};
|
||||||
bAnimListElem *ale;
|
bAnimListElem *ale;
|
||||||
@ -200,46 +200,46 @@ static void borderselect_action (bAnimContext *ac, rcti rect, short mode, short
|
|||||||
|
|
||||||
KeyframeEditData ked;
|
KeyframeEditData ked;
|
||||||
KeyframeEditFunc ok_cb, select_cb;
|
KeyframeEditFunc ok_cb, select_cb;
|
||||||
View2D *v2d= &ac->ar->v2d;
|
View2D *v2d = &ac->ar->v2d;
|
||||||
rctf rectf;
|
rctf rectf;
|
||||||
float ymin=0, ymax=(float)(-ACHANNEL_HEIGHT_HALF);
|
float ymin = 0, ymax = (float)(-ACHANNEL_HEIGHT_HALF);
|
||||||
|
|
||||||
/* convert mouse coordinates to frame ranges and channel coordinates corrected for view pan/zoom */
|
/* convert mouse coordinates to frame ranges and channel coordinates corrected for view pan/zoom */
|
||||||
UI_view2d_region_to_view(v2d, rect.xmin, rect.ymin+2, &rectf.xmin, &rectf.ymin);
|
UI_view2d_region_to_view(v2d, rect.xmin, rect.ymin + 2, &rectf.xmin, &rectf.ymin);
|
||||||
UI_view2d_region_to_view(v2d, rect.xmax, rect.ymax-2, &rectf.xmax, &rectf.ymax);
|
UI_view2d_region_to_view(v2d, rect.xmax, rect.ymax - 2, &rectf.xmax, &rectf.ymax);
|
||||||
|
|
||||||
/* filter data */
|
/* filter data */
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS | ANIMFILTER_NODUPLIS);
|
||||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
/* get beztriple editing/validation funcs */
|
/* get beztriple editing/validation funcs */
|
||||||
select_cb= ANIM_editkeyframes_select(selectmode);
|
select_cb = ANIM_editkeyframes_select(selectmode);
|
||||||
|
|
||||||
if (ELEM(mode, ACTKEYS_BORDERSEL_FRAMERANGE, ACTKEYS_BORDERSEL_ALLKEYS))
|
if (ELEM(mode, ACTKEYS_BORDERSEL_FRAMERANGE, ACTKEYS_BORDERSEL_ALLKEYS))
|
||||||
ok_cb= ANIM_editkeyframes_ok(BEZT_OK_FRAMERANGE);
|
ok_cb = ANIM_editkeyframes_ok(BEZT_OK_FRAMERANGE);
|
||||||
else
|
else
|
||||||
ok_cb= NULL;
|
ok_cb = NULL;
|
||||||
|
|
||||||
/* init editing data */
|
/* init editing data */
|
||||||
memset(&ked, 0, sizeof(KeyframeEditData));
|
memset(&ked, 0, sizeof(KeyframeEditData));
|
||||||
|
|
||||||
/* loop over data, doing border select */
|
/* loop over data, doing border select */
|
||||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||||
AnimData *adt= ANIM_nla_mapping_get(ac, ale);
|
AnimData *adt = ANIM_nla_mapping_get(ac, ale);
|
||||||
|
|
||||||
/* get new vertical minimum extent of channel */
|
/* get new vertical minimum extent of channel */
|
||||||
ymin= ymax - ACHANNEL_STEP;
|
ymin = ymax - ACHANNEL_STEP;
|
||||||
|
|
||||||
/* set horizontal range (if applicable) */
|
/* set horizontal range (if applicable) */
|
||||||
if (ELEM(mode, ACTKEYS_BORDERSEL_FRAMERANGE, ACTKEYS_BORDERSEL_ALLKEYS)) {
|
if (ELEM(mode, ACTKEYS_BORDERSEL_FRAMERANGE, ACTKEYS_BORDERSEL_ALLKEYS)) {
|
||||||
/* if channel is mapped in NLA, apply correction */
|
/* if channel is mapped in NLA, apply correction */
|
||||||
if (adt) {
|
if (adt) {
|
||||||
ked.f1= BKE_nla_tweakedit_remap(adt, rectf.xmin, NLATIME_CONVERT_UNMAP);
|
ked.f1 = BKE_nla_tweakedit_remap(adt, rectf.xmin, NLATIME_CONVERT_UNMAP);
|
||||||
ked.f2= BKE_nla_tweakedit_remap(adt, rectf.xmax, NLATIME_CONVERT_UNMAP);
|
ked.f2 = BKE_nla_tweakedit_remap(adt, rectf.xmax, NLATIME_CONVERT_UNMAP);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ked.f1= rectf.xmin;
|
ked.f1 = rectf.xmin;
|
||||||
ked.f2= rectf.xmax;
|
ked.f2 = rectf.xmax;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,7 +255,7 @@ static void borderselect_action (bAnimContext *ac, rcti rect, short mode, short
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* set minimum extent to be the maximum of the next channel */
|
/* set minimum extent to be the maximum of the next channel */
|
||||||
ymax=ymin;
|
ymax = ymin;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* cleanup */
|
/* cleanup */
|
||||||
@ -268,7 +268,7 @@ static int actkeys_borderselect_exec(bContext *C, wmOperator *op)
|
|||||||
{
|
{
|
||||||
bAnimContext ac;
|
bAnimContext ac;
|
||||||
rcti rect;
|
rcti rect;
|
||||||
short mode=0, selectmode=0;
|
short mode = 0, selectmode = 0;
|
||||||
int gesture_mode, extend;
|
int gesture_mode, extend;
|
||||||
|
|
||||||
/* get editor data */
|
/* get editor data */
|
||||||
@ -276,7 +276,7 @@ static int actkeys_borderselect_exec(bContext *C, wmOperator *op)
|
|||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
|
|
||||||
/* clear all selection if not extending selection */
|
/* clear all selection if not extending selection */
|
||||||
extend= RNA_boolean_get(op->ptr, "extend");
|
extend = RNA_boolean_get(op->ptr, "extend");
|
||||||
if (!extend)
|
if (!extend)
|
||||||
deselect_action_keys(&ac, 1, SELECT_SUBTRACT);
|
deselect_action_keys(&ac, 1, SELECT_SUBTRACT);
|
||||||
|
|
||||||
@ -286,7 +286,7 @@ static int actkeys_borderselect_exec(bContext *C, wmOperator *op)
|
|||||||
rect.xmax = RNA_int_get(op->ptr, "xmax");
|
rect.xmax = RNA_int_get(op->ptr, "xmax");
|
||||||
rect.ymax = RNA_int_get(op->ptr, "ymax");
|
rect.ymax = RNA_int_get(op->ptr, "ymax");
|
||||||
|
|
||||||
gesture_mode= RNA_int_get(op->ptr, "gesture_mode");
|
gesture_mode = RNA_int_get(op->ptr, "gesture_mode");
|
||||||
if (gesture_mode == GESTURE_MODAL_SELECT)
|
if (gesture_mode == GESTURE_MODAL_SELECT)
|
||||||
selectmode = SELECT_ADD;
|
selectmode = SELECT_ADD;
|
||||||
else
|
else
|
||||||
@ -300,18 +300,18 @@ static int actkeys_borderselect_exec(bContext *C, wmOperator *op)
|
|||||||
* used for tweaking timing when "blocking", while channels is not that useful...
|
* used for tweaking timing when "blocking", while channels is not that useful...
|
||||||
*/
|
*/
|
||||||
if ((rect.xmax - rect.xmin) >= (rect.ymax - rect.ymin))
|
if ((rect.xmax - rect.xmin) >= (rect.ymax - rect.ymin))
|
||||||
mode= ACTKEYS_BORDERSEL_FRAMERANGE;
|
mode = ACTKEYS_BORDERSEL_FRAMERANGE;
|
||||||
else
|
else
|
||||||
mode= ACTKEYS_BORDERSEL_CHANNELS;
|
mode = ACTKEYS_BORDERSEL_CHANNELS;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
mode= ACTKEYS_BORDERSEL_ALLKEYS;
|
mode = ACTKEYS_BORDERSEL_ALLKEYS;
|
||||||
|
|
||||||
/* apply borderselect action */
|
/* apply borderselect action */
|
||||||
borderselect_action(&ac, rect, mode, selectmode);
|
borderselect_action(&ac, rect, mode, selectmode);
|
||||||
|
|
||||||
/* set notifier that keyframe selection have changed */
|
/* set notifier that keyframe selection have changed */
|
||||||
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
@ -332,7 +332,7 @@ void ACTION_OT_select_border(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
|
|
||||||
/* rna */
|
/* rna */
|
||||||
WM_operator_properties_gesture_border(ot, TRUE);
|
WM_operator_properties_gesture_border(ot, TRUE);
|
||||||
@ -362,14 +362,14 @@ static EnumPropertyItem prop_column_select_types[] = {
|
|||||||
/* Selects all visible keyframes between the specified markers */
|
/* Selects all visible keyframes between the specified markers */
|
||||||
/* TODO, this is almost an _exact_ duplicate of a function of the same name in graph_select.c
|
/* TODO, this is almost an _exact_ duplicate of a function of the same name in graph_select.c
|
||||||
* should de-duplicate - campbell */
|
* should de-duplicate - campbell */
|
||||||
static void markers_selectkeys_between (bAnimContext *ac)
|
static void markers_selectkeys_between(bAnimContext *ac)
|
||||||
{
|
{
|
||||||
ListBase anim_data = {NULL, NULL};
|
ListBase anim_data = {NULL, NULL};
|
||||||
bAnimListElem *ale;
|
bAnimListElem *ale;
|
||||||
int filter;
|
int filter;
|
||||||
|
|
||||||
KeyframeEditFunc ok_cb, select_cb;
|
KeyframeEditFunc ok_cb, select_cb;
|
||||||
KeyframeEditData ked= {{NULL}};
|
KeyframeEditData ked = {{NULL}};
|
||||||
float min, max;
|
float min, max;
|
||||||
|
|
||||||
/* get extreme markers */
|
/* get extreme markers */
|
||||||
@ -378,19 +378,19 @@ static void markers_selectkeys_between (bAnimContext *ac)
|
|||||||
max += 0.5f;
|
max += 0.5f;
|
||||||
|
|
||||||
/* get editing funcs + data */
|
/* get editing funcs + data */
|
||||||
ok_cb= ANIM_editkeyframes_ok(BEZT_OK_FRAMERANGE);
|
ok_cb = ANIM_editkeyframes_ok(BEZT_OK_FRAMERANGE);
|
||||||
select_cb= ANIM_editkeyframes_select(SELECT_ADD);
|
select_cb = ANIM_editkeyframes_select(SELECT_ADD);
|
||||||
|
|
||||||
ked.f1= min;
|
ked.f1 = min;
|
||||||
ked.f2= max;
|
ked.f2 = max;
|
||||||
|
|
||||||
/* filter data */
|
/* filter data */
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY */ | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY */ | ANIMFILTER_NODUPLIS);
|
||||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
/* select keys in-between */
|
/* select keys in-between */
|
||||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||||
AnimData *adt= ANIM_nla_mapping_get(ac, ale);
|
AnimData *adt = ANIM_nla_mapping_get(ac, ale);
|
||||||
|
|
||||||
if (adt) {
|
if (adt) {
|
||||||
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1);
|
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1);
|
||||||
@ -411,16 +411,16 @@ static void markers_selectkeys_between (bAnimContext *ac)
|
|||||||
|
|
||||||
|
|
||||||
/* Selects all visible keyframes in the same frames as the specified elements */
|
/* Selects all visible keyframes in the same frames as the specified elements */
|
||||||
static void columnselect_action_keys (bAnimContext *ac, short mode)
|
static void columnselect_action_keys(bAnimContext *ac, short mode)
|
||||||
{
|
{
|
||||||
ListBase anim_data= {NULL, NULL};
|
ListBase anim_data = {NULL, NULL};
|
||||||
bAnimListElem *ale;
|
bAnimListElem *ale;
|
||||||
int filter;
|
int filter;
|
||||||
|
|
||||||
Scene *scene= ac->scene;
|
Scene *scene = ac->scene;
|
||||||
CfraElem *ce;
|
CfraElem *ce;
|
||||||
KeyframeEditFunc select_cb, ok_cb;
|
KeyframeEditFunc select_cb, ok_cb;
|
||||||
KeyframeEditData ked= {{NULL}};
|
KeyframeEditData ked = {{NULL}};
|
||||||
|
|
||||||
/* initialize keyframe editing data */
|
/* initialize keyframe editing data */
|
||||||
|
|
||||||
@ -428,17 +428,17 @@ static void columnselect_action_keys (bAnimContext *ac, short mode)
|
|||||||
switch (mode) {
|
switch (mode) {
|
||||||
case ACTKEYS_COLUMNSEL_KEYS: /* list of selected keys */
|
case ACTKEYS_COLUMNSEL_KEYS: /* list of selected keys */
|
||||||
if (ac->datatype == ANIMCONT_GPENCIL) {
|
if (ac->datatype == ANIMCONT_GPENCIL) {
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE);
|
||||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
for (ale= anim_data.first; ale; ale= ale->next)
|
for (ale = anim_data.first; ale; ale = ale->next)
|
||||||
gplayer_make_cfra_list(ale->data, &ked.list, 1);
|
gplayer_make_cfra_list(ale->data, &ked.list, 1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY*/);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY*/);
|
||||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
for (ale= anim_data.first; ale; ale= ale->next)
|
for (ale = anim_data.first; ale; ale = ale->next)
|
||||||
ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, bezt_to_cfraelem, NULL);
|
ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, bezt_to_cfraelem, NULL);
|
||||||
}
|
}
|
||||||
BLI_freelistN(&anim_data);
|
BLI_freelistN(&anim_data);
|
||||||
@ -446,10 +446,10 @@ static void columnselect_action_keys (bAnimContext *ac, short mode)
|
|||||||
|
|
||||||
case ACTKEYS_COLUMNSEL_CFRA: /* current frame */
|
case ACTKEYS_COLUMNSEL_CFRA: /* current frame */
|
||||||
/* make a single CfraElem for storing this */
|
/* make a single CfraElem for storing this */
|
||||||
ce= MEM_callocN(sizeof(CfraElem), "cfraElem");
|
ce = MEM_callocN(sizeof(CfraElem), "cfraElem");
|
||||||
BLI_addtail(&ked.list, ce);
|
BLI_addtail(&ked.list, ce);
|
||||||
|
|
||||||
ce->cfra= (float)CFRA;
|
ce->cfra = (float)CFRA;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACTKEYS_COLUMNSEL_MARKERS_COLUMN: /* list of selected markers */
|
case ACTKEYS_COLUMNSEL_MARKERS_COLUMN: /* list of selected markers */
|
||||||
@ -461,30 +461,30 @@ static void columnselect_action_keys (bAnimContext *ac, short mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* set up BezTriple edit callbacks */
|
/* set up BezTriple edit callbacks */
|
||||||
select_cb= ANIM_editkeyframes_select(SELECT_ADD);
|
select_cb = ANIM_editkeyframes_select(SELECT_ADD);
|
||||||
ok_cb= ANIM_editkeyframes_ok(BEZT_OK_FRAME);
|
ok_cb = ANIM_editkeyframes_ok(BEZT_OK_FRAME);
|
||||||
|
|
||||||
/* loop through all of the keys and select additional keyframes
|
/* loop through all of the keys and select additional keyframes
|
||||||
* based on the keys found to be selected above
|
* based on the keys found to be selected above
|
||||||
*/
|
*/
|
||||||
if (ac->datatype == ANIMCONT_GPENCIL)
|
if (ac->datatype == ANIMCONT_GPENCIL)
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE);
|
||||||
else
|
else
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY*/);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY*/);
|
||||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||||
AnimData *adt= ANIM_nla_mapping_get(ac, ale);
|
AnimData *adt = ANIM_nla_mapping_get(ac, ale);
|
||||||
|
|
||||||
/* loop over cfraelems (stored in the KeyframeEditData->list)
|
/* loop over cfraelems (stored in the KeyframeEditData->list)
|
||||||
* - we need to do this here, as we can apply fewer NLA-mapping conversions
|
* - we need to do this here, as we can apply fewer NLA-mapping conversions
|
||||||
*/
|
*/
|
||||||
for (ce= ked.list.first; ce; ce= ce->next) {
|
for (ce = ked.list.first; ce; ce = ce->next) {
|
||||||
/* set frame for validation callback to refer to */
|
/* set frame for validation callback to refer to */
|
||||||
if (adt)
|
if (adt)
|
||||||
ked.f1= BKE_nla_tweakedit_remap(adt, ce->cfra, NLATIME_CONVERT_UNMAP);
|
ked.f1 = BKE_nla_tweakedit_remap(adt, ce->cfra, NLATIME_CONVERT_UNMAP);
|
||||||
else
|
else
|
||||||
ked.f1= ce->cfra;
|
ked.f1 = ce->cfra;
|
||||||
|
|
||||||
/* select elements with frame number matching cfraelem */
|
/* select elements with frame number matching cfraelem */
|
||||||
if (ale->type == ANIMTYPE_GPLAYER)
|
if (ale->type == ANIMTYPE_GPLAYER)
|
||||||
@ -511,7 +511,7 @@ static int actkeys_columnselect_exec(bContext *C, wmOperator *op)
|
|||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
|
|
||||||
/* action to take depends on the mode */
|
/* action to take depends on the mode */
|
||||||
mode= RNA_enum_get(op->ptr, "mode");
|
mode = RNA_enum_get(op->ptr, "mode");
|
||||||
|
|
||||||
if (mode == ACTKEYS_COLUMNSEL_MARKERS_BETWEEN)
|
if (mode == ACTKEYS_COLUMNSEL_MARKERS_BETWEEN)
|
||||||
markers_selectkeys_between(&ac);
|
markers_selectkeys_between(&ac);
|
||||||
@ -519,7 +519,7 @@ static int actkeys_columnselect_exec(bContext *C, wmOperator *op)
|
|||||||
columnselect_action_keys(&ac, mode);
|
columnselect_action_keys(&ac, mode);
|
||||||
|
|
||||||
/* set notifier that keyframe selection have changed */
|
/* set notifier that keyframe selection have changed */
|
||||||
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
@ -536,7 +536,7 @@ void ACTION_OT_select_column(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
|
|
||||||
/* props */
|
/* props */
|
||||||
ot->prop = RNA_def_enum(ot->srna, "mode", prop_column_select_types, 0, "Mode", "");
|
ot->prop = RNA_def_enum(ot->srna, "mode", prop_column_select_types, 0, "Mode", "");
|
||||||
@ -544,11 +544,11 @@ void ACTION_OT_select_column(wmOperatorType *ot)
|
|||||||
|
|
||||||
/* ******************** Select Linked Operator *********************** */
|
/* ******************** Select Linked Operator *********************** */
|
||||||
|
|
||||||
static int actkeys_select_linked_exec (bContext *C, wmOperator *UNUSED(op))
|
static int actkeys_select_linked_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
bAnimContext ac;
|
bAnimContext ac;
|
||||||
|
|
||||||
ListBase anim_data= {NULL, NULL};
|
ListBase anim_data = {NULL, NULL};
|
||||||
bAnimListElem *ale;
|
bAnimListElem *ale;
|
||||||
int filter;
|
int filter;
|
||||||
|
|
||||||
@ -560,11 +560,11 @@ static int actkeys_select_linked_exec (bContext *C, wmOperator *UNUSED(op))
|
|||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
|
|
||||||
/* loop through all of the keys and select additional keyframes based on these */
|
/* loop through all of the keys and select additional keyframes based on these */
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
||||||
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
|
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
|
||||||
|
|
||||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||||
FCurve *fcu= (FCurve *)ale->key_data;
|
FCurve *fcu = (FCurve *)ale->key_data;
|
||||||
|
|
||||||
/* check if anything selected? */
|
/* check if anything selected? */
|
||||||
if (ANIM_fcurve_keyframes_loop(NULL, fcu, NULL, ok_cb, NULL)) {
|
if (ANIM_fcurve_keyframes_loop(NULL, fcu, NULL, ok_cb, NULL)) {
|
||||||
@ -577,7 +577,7 @@ static int actkeys_select_linked_exec (bContext *C, wmOperator *UNUSED(op))
|
|||||||
BLI_freelistN(&anim_data);
|
BLI_freelistN(&anim_data);
|
||||||
|
|
||||||
/* set notifier that keyframe selection has changed */
|
/* set notifier that keyframe selection has changed */
|
||||||
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
@ -594,38 +594,38 @@ void ACTION_OT_select_linked(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
|
ot->flag = OPTYPE_REGISTER /*|OPTYPE_UNDO*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Select More/Less Operators *********************** */
|
/* ******************** Select More/Less Operators *********************** */
|
||||||
|
|
||||||
/* Common code to perform selection */
|
/* Common code to perform selection */
|
||||||
static void select_moreless_action_keys (bAnimContext *ac, short mode)
|
static void select_moreless_action_keys(bAnimContext *ac, short mode)
|
||||||
{
|
{
|
||||||
ListBase anim_data= {NULL, NULL};
|
ListBase anim_data = {NULL, NULL};
|
||||||
bAnimListElem *ale;
|
bAnimListElem *ale;
|
||||||
int filter;
|
int filter;
|
||||||
|
|
||||||
KeyframeEditData ked= {{NULL}};
|
KeyframeEditData ked = {{NULL}};
|
||||||
KeyframeEditFunc build_cb;
|
KeyframeEditFunc build_cb;
|
||||||
|
|
||||||
|
|
||||||
/* init selmap building data */
|
/* init selmap building data */
|
||||||
build_cb= ANIM_editkeyframes_buildselmap(mode);
|
build_cb = ANIM_editkeyframes_buildselmap(mode);
|
||||||
|
|
||||||
/* loop through all of the keys and select additional keyframes based on these */
|
/* loop through all of the keys and select additional keyframes based on these */
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
||||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||||
FCurve *fcu= (FCurve *)ale->key_data;
|
FCurve *fcu = (FCurve *)ale->key_data;
|
||||||
|
|
||||||
/* only continue if F-Curve has keyframes */
|
/* only continue if F-Curve has keyframes */
|
||||||
if (fcu->bezt == NULL)
|
if (fcu->bezt == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* build up map of whether F-Curve's keyframes should be selected or not */
|
/* build up map of whether F-Curve's keyframes should be selected or not */
|
||||||
ked.data= MEM_callocN(fcu->totvert, "selmap actEdit more");
|
ked.data = MEM_callocN(fcu->totvert, "selmap actEdit more");
|
||||||
ANIM_fcurve_keyframes_loop(&ked, fcu, NULL, build_cb, NULL);
|
ANIM_fcurve_keyframes_loop(&ked, fcu, NULL, build_cb, NULL);
|
||||||
|
|
||||||
/* based on this map, adjust the selection status of the keyframes */
|
/* based on this map, adjust the selection status of the keyframes */
|
||||||
@ -633,7 +633,7 @@ static void select_moreless_action_keys (bAnimContext *ac, short mode)
|
|||||||
|
|
||||||
/* free the selmap used here */
|
/* free the selmap used here */
|
||||||
MEM_freeN(ked.data);
|
MEM_freeN(ked.data);
|
||||||
ked.data= NULL;
|
ked.data = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Cleanup */
|
/* Cleanup */
|
||||||
@ -642,7 +642,7 @@ static void select_moreless_action_keys (bAnimContext *ac, short mode)
|
|||||||
|
|
||||||
/* ----------------- */
|
/* ----------------- */
|
||||||
|
|
||||||
static int actkeys_select_more_exec (bContext *C, wmOperator *UNUSED(op))
|
static int actkeys_select_more_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
bAnimContext ac;
|
bAnimContext ac;
|
||||||
|
|
||||||
@ -654,7 +654,7 @@ static int actkeys_select_more_exec (bContext *C, wmOperator *UNUSED(op))
|
|||||||
select_moreless_action_keys(&ac, SELMAP_MORE);
|
select_moreless_action_keys(&ac, SELMAP_MORE);
|
||||||
|
|
||||||
/* set notifier that keyframe selection has changed */
|
/* set notifier that keyframe selection has changed */
|
||||||
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
@ -671,12 +671,12 @@ void ACTION_OT_select_more(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
|
ot->flag = OPTYPE_REGISTER /*|OPTYPE_UNDO*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------- */
|
/* ----------------- */
|
||||||
|
|
||||||
static int actkeys_select_less_exec (bContext *C, wmOperator *UNUSED(op))
|
static int actkeys_select_less_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
bAnimContext ac;
|
bAnimContext ac;
|
||||||
|
|
||||||
@ -688,7 +688,7 @@ static int actkeys_select_less_exec (bContext *C, wmOperator *UNUSED(op))
|
|||||||
select_moreless_action_keys(&ac, SELMAP_LESS);
|
select_moreless_action_keys(&ac, SELMAP_LESS);
|
||||||
|
|
||||||
/* set notifier that keyframe selection has changed */
|
/* set notifier that keyframe selection has changed */
|
||||||
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
@ -705,7 +705,7 @@ void ACTION_OT_select_less(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
|
ot->flag = OPTYPE_REGISTER /*|OPTYPE_UNDO*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Select Left/Right Operator ************************* */
|
/* ******************** Select Left/Right Operator ************************* */
|
||||||
@ -721,19 +721,19 @@ static EnumPropertyItem prop_actkeys_leftright_select_types[] = {
|
|||||||
|
|
||||||
/* --------------------------------- */
|
/* --------------------------------- */
|
||||||
|
|
||||||
static void actkeys_select_leftright (bAnimContext *ac, short leftright, short select_mode)
|
static void actkeys_select_leftright(bAnimContext *ac, short leftright, short select_mode)
|
||||||
{
|
{
|
||||||
ListBase anim_data = {NULL, NULL};
|
ListBase anim_data = {NULL, NULL};
|
||||||
bAnimListElem *ale;
|
bAnimListElem *ale;
|
||||||
int filter;
|
int filter;
|
||||||
|
|
||||||
KeyframeEditFunc ok_cb, select_cb;
|
KeyframeEditFunc ok_cb, select_cb;
|
||||||
KeyframeEditData ked= {{NULL}};
|
KeyframeEditData ked = {{NULL}};
|
||||||
Scene *scene= ac->scene;
|
Scene *scene = ac->scene;
|
||||||
|
|
||||||
/* if select mode is replace, deselect all keyframes (and channels) first */
|
/* if select mode is replace, deselect all keyframes (and channels) first */
|
||||||
if (select_mode==SELECT_REPLACE) {
|
if (select_mode == SELECT_REPLACE) {
|
||||||
select_mode= SELECT_ADD;
|
select_mode = SELECT_ADD;
|
||||||
|
|
||||||
/* - deselect all other keyframes, so that just the newly selected remain
|
/* - deselect all other keyframes, so that just the newly selected remain
|
||||||
* - channels aren't deselected, since we don't re-select any as a consequence
|
* - channels aren't deselected, since we don't re-select any as a consequence
|
||||||
@ -742,8 +742,8 @@ static void actkeys_select_leftright (bAnimContext *ac, short leftright, short s
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* set callbacks and editing data */
|
/* set callbacks and editing data */
|
||||||
ok_cb= ANIM_editkeyframes_ok(BEZT_OK_FRAMERANGE);
|
ok_cb = ANIM_editkeyframes_ok(BEZT_OK_FRAMERANGE);
|
||||||
select_cb= ANIM_editkeyframes_select(select_mode);
|
select_cb = ANIM_editkeyframes_select(select_mode);
|
||||||
|
|
||||||
if (leftright == ACTKEYS_LRSEL_LEFT) {
|
if (leftright == ACTKEYS_LRSEL_LEFT) {
|
||||||
ked.f1 = MINAFRAMEF;
|
ked.f1 = MINAFRAMEF;
|
||||||
@ -756,14 +756,14 @@ static void actkeys_select_leftright (bAnimContext *ac, short leftright, short s
|
|||||||
|
|
||||||
/* filter data */
|
/* filter data */
|
||||||
if (ac->datatype == ANIMCONT_GPENCIL)
|
if (ac->datatype == ANIMCONT_GPENCIL)
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_NODUPLIS);
|
||||||
else
|
else
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
|
||||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
/* select keys */
|
/* select keys */
|
||||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||||
AnimData *adt= ANIM_nla_mapping_get(ac, ale);
|
AnimData *adt = ANIM_nla_mapping_get(ac, ale);
|
||||||
|
|
||||||
if (adt) {
|
if (adt) {
|
||||||
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1);
|
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1);
|
||||||
@ -777,14 +777,14 @@ static void actkeys_select_leftright (bAnimContext *ac, short leftright, short s
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Sync marker support */
|
/* Sync marker support */
|
||||||
if (select_mode==SELECT_ADD) {
|
if (select_mode == SELECT_ADD) {
|
||||||
SpaceAction *saction= (SpaceAction *)ac->sl;
|
SpaceAction *saction = (SpaceAction *)ac->sl;
|
||||||
|
|
||||||
if ((saction) && (saction->flag & SACTION_MARKERS_MOVE)) {
|
if ((saction) && (saction->flag & SACTION_MARKERS_MOVE)) {
|
||||||
ListBase *markers = ED_animcontext_get_markers(ac);
|
ListBase *markers = ED_animcontext_get_markers(ac);
|
||||||
TimeMarker *marker;
|
TimeMarker *marker;
|
||||||
|
|
||||||
for (marker= markers->first; marker; marker= marker->next) {
|
for (marker = markers->first; marker; marker = marker->next) {
|
||||||
if ( ((leftright == ACTKEYS_LRSEL_LEFT) && (marker->frame < CFRA)) ||
|
if ( ((leftright == ACTKEYS_LRSEL_LEFT) && (marker->frame < CFRA)) ||
|
||||||
((leftright == ACTKEYS_LRSEL_RIGHT) && (marker->frame >= CFRA)) )
|
((leftright == ACTKEYS_LRSEL_RIGHT) && (marker->frame >= CFRA)) )
|
||||||
{
|
{
|
||||||
@ -803,7 +803,7 @@ static void actkeys_select_leftright (bAnimContext *ac, short leftright, short s
|
|||||||
|
|
||||||
/* ----------------- */
|
/* ----------------- */
|
||||||
|
|
||||||
static int actkeys_select_leftright_exec (bContext *C, wmOperator *op)
|
static int actkeys_select_leftright_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
bAnimContext ac;
|
bAnimContext ac;
|
||||||
short leftright = RNA_enum_get(op->ptr, "mode");
|
short leftright = RNA_enum_get(op->ptr, "mode");
|
||||||
@ -815,9 +815,9 @@ static int actkeys_select_leftright_exec (bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
/* select mode is either replace (deselect all, then add) or add/extend */
|
/* select mode is either replace (deselect all, then add) or add/extend */
|
||||||
if (RNA_boolean_get(op->ptr, "extend"))
|
if (RNA_boolean_get(op->ptr, "extend"))
|
||||||
selectmode= SELECT_INVERT;
|
selectmode = SELECT_INVERT;
|
||||||
else
|
else
|
||||||
selectmode= SELECT_REPLACE;
|
selectmode = SELECT_REPLACE;
|
||||||
|
|
||||||
/* if "test" mode is set, we don't have any info to set this with */
|
/* if "test" mode is set, we don't have any info to set this with */
|
||||||
if (leftright == ACTKEYS_LRSEL_TEST)
|
if (leftright == ACTKEYS_LRSEL_TEST)
|
||||||
@ -827,12 +827,12 @@ static int actkeys_select_leftright_exec (bContext *C, wmOperator *op)
|
|||||||
actkeys_select_leftright(&ac, leftright, selectmode);
|
actkeys_select_leftright(&ac, leftright, selectmode);
|
||||||
|
|
||||||
/* set notifier that keyframe selection (and channels too) have changed */
|
/* set notifier that keyframe selection (and channels too) have changed */
|
||||||
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|ND_ANIMCHAN|NA_SELECTED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | ND_ANIMCHAN | NA_SELECTED, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int actkeys_select_leftright_invoke (bContext *C, wmOperator *op, wmEvent *event)
|
static int actkeys_select_leftright_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||||
{
|
{
|
||||||
bAnimContext ac;
|
bAnimContext ac;
|
||||||
short leftright = RNA_enum_get(op->ptr, "mode");
|
short leftright = RNA_enum_get(op->ptr, "mode");
|
||||||
@ -843,9 +843,9 @@ static int actkeys_select_leftright_invoke (bContext *C, wmOperator *op, wmEvent
|
|||||||
|
|
||||||
/* handle mode-based testing */
|
/* handle mode-based testing */
|
||||||
if (leftright == ACTKEYS_LRSEL_TEST) {
|
if (leftright == ACTKEYS_LRSEL_TEST) {
|
||||||
Scene *scene= ac.scene;
|
Scene *scene = ac.scene;
|
||||||
ARegion *ar= ac.ar;
|
ARegion *ar = ac.ar;
|
||||||
View2D *v2d= &ar->v2d;
|
View2D *v2d = &ar->v2d;
|
||||||
float x;
|
float x;
|
||||||
|
|
||||||
/* determine which side of the current frame mouse is on */
|
/* determine which side of the current frame mouse is on */
|
||||||
@ -873,7 +873,7 @@ void ACTION_OT_select_leftright(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
|
|
||||||
/* id-props */
|
/* id-props */
|
||||||
ot->prop = RNA_def_enum(ot->srna, "mode", prop_actkeys_leftright_select_types, ACTKEYS_LRSEL_TEST, "Mode", "");
|
ot->prop = RNA_def_enum(ot->srna, "mode", prop_actkeys_leftright_select_types, ACTKEYS_LRSEL_TEST, "Mode", "");
|
||||||
@ -896,15 +896,15 @@ void ACTION_OT_select_leftright(wmOperatorType *ot)
|
|||||||
/* ------------------- */
|
/* ------------------- */
|
||||||
|
|
||||||
/* option 1) select keyframe directly under mouse */
|
/* option 1) select keyframe directly under mouse */
|
||||||
static void actkeys_mselect_single (bAnimContext *ac, bAnimListElem *ale, short select_mode, float selx)
|
static void actkeys_mselect_single(bAnimContext *ac, bAnimListElem *ale, short select_mode, float selx)
|
||||||
{
|
{
|
||||||
KeyframeEditData ked= {{NULL}};
|
KeyframeEditData ked = {{NULL}};
|
||||||
KeyframeEditFunc select_cb, ok_cb;
|
KeyframeEditFunc select_cb, ok_cb;
|
||||||
|
|
||||||
/* get functions for selecting keyframes */
|
/* get functions for selecting keyframes */
|
||||||
select_cb= ANIM_editkeyframes_select(select_mode);
|
select_cb = ANIM_editkeyframes_select(select_mode);
|
||||||
ok_cb= ANIM_editkeyframes_ok(BEZT_OK_FRAME);
|
ok_cb = ANIM_editkeyframes_ok(BEZT_OK_FRAME);
|
||||||
ked.f1= selx;
|
ked.f1 = selx;
|
||||||
|
|
||||||
/* select the nominated keyframe on the given frame */
|
/* select the nominated keyframe on the given frame */
|
||||||
if (ale->type == ANIMTYPE_GPLAYER)
|
if (ale->type == ANIMTYPE_GPLAYER)
|
||||||
@ -919,34 +919,34 @@ static void actkeys_mselect_single (bAnimContext *ac, bAnimListElem *ale, short
|
|||||||
/* Option 3) Selects all visible keyframes in the same frame as the mouse click */
|
/* Option 3) Selects all visible keyframes in the same frame as the mouse click */
|
||||||
static void actkeys_mselect_column(bAnimContext *ac, short select_mode, float selx)
|
static void actkeys_mselect_column(bAnimContext *ac, short select_mode, float selx)
|
||||||
{
|
{
|
||||||
ListBase anim_data= {NULL, NULL};
|
ListBase anim_data = {NULL, NULL};
|
||||||
bAnimListElem *ale;
|
bAnimListElem *ale;
|
||||||
int filter;
|
int filter;
|
||||||
|
|
||||||
KeyframeEditFunc select_cb, ok_cb;
|
KeyframeEditFunc select_cb, ok_cb;
|
||||||
KeyframeEditData ked= {{NULL}};
|
KeyframeEditData ked = {{NULL}};
|
||||||
|
|
||||||
/* set up BezTriple edit callbacks */
|
/* set up BezTriple edit callbacks */
|
||||||
select_cb= ANIM_editkeyframes_select(select_mode);
|
select_cb = ANIM_editkeyframes_select(select_mode);
|
||||||
ok_cb= ANIM_editkeyframes_ok(BEZT_OK_FRAME);
|
ok_cb = ANIM_editkeyframes_ok(BEZT_OK_FRAME);
|
||||||
|
|
||||||
/* loop through all of the keys and select additional keyframes
|
/* loop through all of the keys and select additional keyframes
|
||||||
* based on the keys found to be selected above
|
* based on the keys found to be selected above
|
||||||
*/
|
*/
|
||||||
if (ac->datatype == ANIMCONT_GPENCIL)
|
if (ac->datatype == ANIMCONT_GPENCIL)
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY */ | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY */ | ANIMFILTER_NODUPLIS);
|
||||||
else
|
else
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_NODUPLIS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_NODUPLIS);
|
||||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||||
AnimData *adt= ANIM_nla_mapping_get(ac, ale);
|
AnimData *adt = ANIM_nla_mapping_get(ac, ale);
|
||||||
|
|
||||||
/* set frame for validation callback to refer to */
|
/* set frame for validation callback to refer to */
|
||||||
if (adt)
|
if (adt)
|
||||||
ked.f1= BKE_nla_tweakedit_remap(adt, selx, NLATIME_CONVERT_UNMAP);
|
ked.f1 = BKE_nla_tweakedit_remap(adt, selx, NLATIME_CONVERT_UNMAP);
|
||||||
else
|
else
|
||||||
ked.f1= selx;
|
ked.f1 = selx;
|
||||||
|
|
||||||
/* select elements with frame number matching cfra */
|
/* select elements with frame number matching cfra */
|
||||||
if (ale->type == ANIMTYPE_GPLAYER)
|
if (ale->type == ANIMTYPE_GPLAYER)
|
||||||
@ -962,14 +962,14 @@ static void actkeys_mselect_column(bAnimContext *ac, short select_mode, float se
|
|||||||
|
|
||||||
/* ------------------- */
|
/* ------------------- */
|
||||||
|
|
||||||
static void mouse_action_keys (bAnimContext *ac, const int mval[2], short select_mode, short column)
|
static void mouse_action_keys(bAnimContext *ac, const int mval[2], short select_mode, short column)
|
||||||
{
|
{
|
||||||
ListBase anim_data = {NULL, NULL};
|
ListBase anim_data = {NULL, NULL};
|
||||||
DLRBT_Tree anim_keys;
|
DLRBT_Tree anim_keys;
|
||||||
bAnimListElem *ale;
|
bAnimListElem *ale;
|
||||||
int filter;
|
int filter;
|
||||||
|
|
||||||
View2D *v2d= &ac->ar->v2d;
|
View2D *v2d = &ac->ar->v2d;
|
||||||
bDopeSheet *ads = NULL;
|
bDopeSheet *ads = NULL;
|
||||||
int channel_index;
|
int channel_index;
|
||||||
short found = 0;
|
short found = 0;
|
||||||
@ -979,22 +979,22 @@ static void mouse_action_keys (bAnimContext *ac, const int mval[2], short select
|
|||||||
|
|
||||||
/* get dopesheet info */
|
/* get dopesheet info */
|
||||||
if (ac->datatype == ANIMCONT_DOPESHEET)
|
if (ac->datatype == ANIMCONT_DOPESHEET)
|
||||||
ads= ac->data;
|
ads = ac->data;
|
||||||
|
|
||||||
/* use View2D to determine the index of the channel (i.e a row in the list) where keyframe was */
|
/* use View2D to determine the index of the channel (i.e a row in the list) where keyframe was */
|
||||||
UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, &y);
|
UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, &y);
|
||||||
UI_view2d_listview_view_to_cell(v2d, 0, ACHANNEL_STEP, 0, (float)ACHANNEL_HEIGHT_HALF, x, y, NULL, &channel_index);
|
UI_view2d_listview_view_to_cell(v2d, 0, ACHANNEL_STEP, 0, (float)ACHANNEL_HEIGHT_HALF, x, y, NULL, &channel_index);
|
||||||
|
|
||||||
/* x-range to check is +/- 7 (in screen/region-space) on either side of mouse click (size of keyframe icon) */
|
/* x-range to check is +/- 7 (in screen/region-space) on either side of mouse click (size of keyframe icon) */
|
||||||
UI_view2d_region_to_view(v2d, mval[0]-7, mval[1], &rectf.xmin, &rectf.ymin);
|
UI_view2d_region_to_view(v2d, mval[0] - 7, mval[1], &rectf.xmin, &rectf.ymin);
|
||||||
UI_view2d_region_to_view(v2d, mval[0]+7, mval[1], &rectf.xmax, &rectf.ymax);
|
UI_view2d_region_to_view(v2d, mval[0] + 7, mval[1], &rectf.xmax, &rectf.ymax);
|
||||||
|
|
||||||
/* filter data */
|
/* filter data */
|
||||||
filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS);
|
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS);
|
||||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||||
|
|
||||||
/* try to get channel */
|
/* try to get channel */
|
||||||
ale= BLI_findlink(&anim_data, channel_index);
|
ale = BLI_findlink(&anim_data, channel_index);
|
||||||
if (ale == NULL) {
|
if (ale == NULL) {
|
||||||
/* channel not found */
|
/* channel not found */
|
||||||
printf("Error: animation channel (index = %d) not found in mouse_action_keys()\n", channel_index);
|
printf("Error: animation channel (index = %d) not found in mouse_action_keys()\n", channel_index);
|
||||||
@ -1003,8 +1003,8 @@ static void mouse_action_keys (bAnimContext *ac, const int mval[2], short select
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* found match - must return here... */
|
/* found match - must return here... */
|
||||||
AnimData *adt= ANIM_nla_mapping_get(ac, ale);
|
AnimData *adt = ANIM_nla_mapping_get(ac, ale);
|
||||||
ActKeyColumn *ak, *akn=NULL;
|
ActKeyColumn *ak, *akn = NULL;
|
||||||
|
|
||||||
/* make list of keyframes */
|
/* make list of keyframes */
|
||||||
BLI_dlrbTree_init(&anim_keys);
|
BLI_dlrbTree_init(&anim_keys);
|
||||||
@ -1013,25 +1013,25 @@ static void mouse_action_keys (bAnimContext *ac, const int mval[2], short select
|
|||||||
switch (ale->datatype) {
|
switch (ale->datatype) {
|
||||||
case ALE_SCE:
|
case ALE_SCE:
|
||||||
{
|
{
|
||||||
Scene *scene= (Scene *)ale->key_data;
|
Scene *scene = (Scene *)ale->key_data;
|
||||||
scene_to_keylist(ads, scene, &anim_keys, NULL);
|
scene_to_keylist(ads, scene, &anim_keys, NULL);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ALE_OB:
|
case ALE_OB:
|
||||||
{
|
{
|
||||||
Object *ob= (Object *)ale->key_data;
|
Object *ob = (Object *)ale->key_data;
|
||||||
ob_to_keylist(ads, ob, &anim_keys, NULL);
|
ob_to_keylist(ads, ob, &anim_keys, NULL);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ALE_ACT:
|
case ALE_ACT:
|
||||||
{
|
{
|
||||||
bAction *act= (bAction *)ale->key_data;
|
bAction *act = (bAction *)ale->key_data;
|
||||||
action_to_keylist(adt, act, &anim_keys, NULL);
|
action_to_keylist(adt, act, &anim_keys, NULL);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ALE_FCURVE:
|
case ALE_FCURVE:
|
||||||
{
|
{
|
||||||
FCurve *fcu= (FCurve *)ale->key_data;
|
FCurve *fcu = (FCurve *)ale->key_data;
|
||||||
fcurve_to_keylist(adt, fcu, &anim_keys, NULL);
|
fcurve_to_keylist(adt, fcu, &anim_keys, NULL);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1043,7 +1043,7 @@ static void mouse_action_keys (bAnimContext *ac, const int mval[2], short select
|
|||||||
}
|
}
|
||||||
else if (ale->type == ANIMTYPE_GROUP) {
|
else if (ale->type == ANIMTYPE_GROUP) {
|
||||||
// TODO: why don't we just give groups key_data too?
|
// TODO: why don't we just give groups key_data too?
|
||||||
bActionGroup *agrp= (bActionGroup *)ale->data;
|
bActionGroup *agrp = (bActionGroup *)ale->data;
|
||||||
agroup_to_keylist(adt, agrp, &anim_keys, NULL);
|
agroup_to_keylist(adt, agrp, &anim_keys, NULL);
|
||||||
}
|
}
|
||||||
else if (ale->type == ANIMTYPE_GPLAYER) {
|
else if (ale->type == ANIMTYPE_GPLAYER) {
|
||||||
@ -1053,20 +1053,20 @@ static void mouse_action_keys (bAnimContext *ac, const int mval[2], short select
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* start from keyframe at root of BST, traversing until we find one within the range that was clicked on */
|
/* start from keyframe at root of BST, traversing until we find one within the range that was clicked on */
|
||||||
for (ak= anim_keys.root; ak; ak= akn) {
|
for (ak = anim_keys.root; ak; ak = akn) {
|
||||||
if (IN_RANGE(ak->cfra, rectf.xmin, rectf.xmax)) {
|
if (IN_RANGE(ak->cfra, rectf.xmin, rectf.xmax)) {
|
||||||
/* set the frame to use, and apply inverse-correction for NLA-mapping
|
/* set the frame to use, and apply inverse-correction for NLA-mapping
|
||||||
* so that the frame will get selected by the selection functions without
|
* so that the frame will get selected by the selection functions without
|
||||||
* requiring to map each frame once again...
|
* requiring to map each frame once again...
|
||||||
*/
|
*/
|
||||||
selx= BKE_nla_tweakedit_remap(adt, ak->cfra, NLATIME_CONVERT_UNMAP);
|
selx = BKE_nla_tweakedit_remap(adt, ak->cfra, NLATIME_CONVERT_UNMAP);
|
||||||
found= 1;
|
found = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (ak->cfra < rectf.xmin)
|
else if (ak->cfra < rectf.xmin)
|
||||||
akn= ak->right;
|
akn = ak->right;
|
||||||
else
|
else
|
||||||
akn= ak->left;
|
akn = ak->left;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove active channel from list of channels for separate treatment (since it's needed later on) */
|
/* remove active channel from list of channels for separate treatment (since it's needed later on) */
|
||||||
@ -1095,13 +1095,13 @@ static void mouse_action_keys (bAnimContext *ac, const int mval[2], short select
|
|||||||
/* Highlight Action-Group or F-Curve? */
|
/* Highlight Action-Group or F-Curve? */
|
||||||
if (ale && ale->data) {
|
if (ale && ale->data) {
|
||||||
if (ale->type == ANIMTYPE_GROUP) {
|
if (ale->type == ANIMTYPE_GROUP) {
|
||||||
bActionGroup *agrp= ale->data;
|
bActionGroup *agrp = ale->data;
|
||||||
|
|
||||||
agrp->flag |= AGRP_SELECTED;
|
agrp->flag |= AGRP_SELECTED;
|
||||||
ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, agrp, ANIMTYPE_GROUP);
|
ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, agrp, ANIMTYPE_GROUP);
|
||||||
}
|
}
|
||||||
else if (ale->type == ANIMTYPE_FCURVE) {
|
else if (ale->type == ANIMTYPE_FCURVE) {
|
||||||
FCurve *fcu= ale->data;
|
FCurve *fcu = ale->data;
|
||||||
|
|
||||||
fcu->flag |= FCURVE_SELECTED;
|
fcu->flag |= FCURVE_SELECTED;
|
||||||
ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, fcu, ANIMTYPE_FCURVE);
|
ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, fcu, ANIMTYPE_FCURVE);
|
||||||
@ -1157,21 +1157,21 @@ static int actkeys_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *even
|
|||||||
|
|
||||||
/* select mode is either replace (deselect all, then add) or add/extend */
|
/* select mode is either replace (deselect all, then add) or add/extend */
|
||||||
if (RNA_boolean_get(op->ptr, "extend"))
|
if (RNA_boolean_get(op->ptr, "extend"))
|
||||||
selectmode= SELECT_INVERT;
|
selectmode = SELECT_INVERT;
|
||||||
else
|
else
|
||||||
selectmode= SELECT_REPLACE;
|
selectmode = SELECT_REPLACE;
|
||||||
|
|
||||||
/* column selection */
|
/* column selection */
|
||||||
column= RNA_boolean_get(op->ptr, "column");
|
column = RNA_boolean_get(op->ptr, "column");
|
||||||
|
|
||||||
/* select keyframe(s) based upon mouse position*/
|
/* select keyframe(s) based upon mouse position*/
|
||||||
mouse_action_keys(&ac, event->mval, selectmode, column);
|
mouse_action_keys(&ac, event->mval, selectmode, column);
|
||||||
|
|
||||||
/* set notifier that keyframe selection (and channels too) have changed */
|
/* set notifier that keyframe selection (and channels too) have changed */
|
||||||
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|ND_ANIMCHAN|NA_SELECTED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | ND_ANIMCHAN | NA_SELECTED, NULL);
|
||||||
|
|
||||||
/* for tweak grab to work */
|
/* for tweak grab to work */
|
||||||
return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH;
|
return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ACTION_OT_clickselect(wmOperatorType *ot)
|
void ACTION_OT_clickselect(wmOperatorType *ot)
|
||||||
@ -1186,7 +1186,7 @@ void ACTION_OT_clickselect(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_action_active;
|
ot->poll = ED_operator_action_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
|
|
||||||
/* id-props */
|
/* id-props */
|
||||||
RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", ""); // SHIFTKEY
|
RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", ""); // SHIFTKEY
|
||||||
|
@ -60,67 +60,67 @@
|
|||||||
#include "ED_anim_api.h"
|
#include "ED_anim_api.h"
|
||||||
#include "ED_markers.h"
|
#include "ED_markers.h"
|
||||||
|
|
||||||
#include "action_intern.h" // own include
|
#include "action_intern.h" /* own include */
|
||||||
|
|
||||||
/* ******************** default callbacks for action space ***************** */
|
/* ******************** default callbacks for action space ***************** */
|
||||||
|
|
||||||
static SpaceLink *action_new(const bContext *C)
|
static SpaceLink *action_new(const bContext *C)
|
||||||
{
|
{
|
||||||
ScrArea *sa= CTX_wm_area(C);
|
ScrArea *sa = CTX_wm_area(C);
|
||||||
SpaceAction *saction;
|
SpaceAction *saction;
|
||||||
ARegion *ar;
|
ARegion *ar;
|
||||||
|
|
||||||
saction= MEM_callocN(sizeof(SpaceAction), "initaction");
|
saction = MEM_callocN(sizeof(SpaceAction), "initaction");
|
||||||
saction->spacetype= SPACE_ACTION;
|
saction->spacetype = SPACE_ACTION;
|
||||||
|
|
||||||
saction->autosnap = SACTSNAP_FRAME;
|
saction->autosnap = SACTSNAP_FRAME;
|
||||||
saction->mode= SACTCONT_DOPESHEET;
|
saction->mode = SACTCONT_DOPESHEET;
|
||||||
|
|
||||||
saction->ads.filterflag |= ADS_FILTER_SUMMARY;
|
saction->ads.filterflag |= ADS_FILTER_SUMMARY;
|
||||||
|
|
||||||
/* header */
|
/* header */
|
||||||
ar= MEM_callocN(sizeof(ARegion), "header for action");
|
ar = MEM_callocN(sizeof(ARegion), "header for action");
|
||||||
|
|
||||||
BLI_addtail(&saction->regionbase, ar);
|
BLI_addtail(&saction->regionbase, ar);
|
||||||
ar->regiontype= RGN_TYPE_HEADER;
|
ar->regiontype = RGN_TYPE_HEADER;
|
||||||
ar->alignment= RGN_ALIGN_BOTTOM;
|
ar->alignment = RGN_ALIGN_BOTTOM;
|
||||||
|
|
||||||
/* channel list region */
|
/* channel list region */
|
||||||
ar= MEM_callocN(sizeof(ARegion), "channel area for action");
|
ar = MEM_callocN(sizeof(ARegion), "channel area for action");
|
||||||
BLI_addtail(&saction->regionbase, ar);
|
BLI_addtail(&saction->regionbase, ar);
|
||||||
ar->regiontype= RGN_TYPE_CHANNELS;
|
ar->regiontype = RGN_TYPE_CHANNELS;
|
||||||
ar->alignment= RGN_ALIGN_LEFT;
|
ar->alignment = RGN_ALIGN_LEFT;
|
||||||
|
|
||||||
/* only need to set scroll settings, as this will use 'listview' v2d configuration */
|
/* only need to set scroll settings, as this will use 'listview' v2d configuration */
|
||||||
ar->v2d.scroll = V2D_SCROLL_BOTTOM;
|
ar->v2d.scroll = V2D_SCROLL_BOTTOM;
|
||||||
ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
|
ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
|
||||||
|
|
||||||
/* main area */
|
/* main area */
|
||||||
ar= MEM_callocN(sizeof(ARegion), "main area for action");
|
ar = MEM_callocN(sizeof(ARegion), "main area for action");
|
||||||
|
|
||||||
BLI_addtail(&saction->regionbase, ar);
|
BLI_addtail(&saction->regionbase, ar);
|
||||||
ar->regiontype= RGN_TYPE_WINDOW;
|
ar->regiontype = RGN_TYPE_WINDOW;
|
||||||
|
|
||||||
ar->v2d.tot.xmin = -10.0f;
|
ar->v2d.tot.xmin = -10.0f;
|
||||||
ar->v2d.tot.ymin = (float)(-sa->winy)/3.0f;
|
ar->v2d.tot.ymin = (float)(-sa->winy) / 3.0f;
|
||||||
ar->v2d.tot.xmax = (float)(sa->winx);
|
ar->v2d.tot.xmax = (float)(sa->winx);
|
||||||
ar->v2d.tot.ymax = 0.0f;
|
ar->v2d.tot.ymax = 0.0f;
|
||||||
|
|
||||||
ar->v2d.cur = ar->v2d.tot;
|
ar->v2d.cur = ar->v2d.tot;
|
||||||
|
|
||||||
ar->v2d.min[0]= 0.0f;
|
ar->v2d.min[0] = 0.0f;
|
||||||
ar->v2d.min[1]= 0.0f;
|
ar->v2d.min[1] = 0.0f;
|
||||||
|
|
||||||
ar->v2d.max[0]= MAXFRAMEF;
|
ar->v2d.max[0] = MAXFRAMEF;
|
||||||
ar->v2d.max[1]= FLT_MAX;
|
ar->v2d.max[1] = FLT_MAX;
|
||||||
|
|
||||||
ar->v2d.minzoom= 0.01f;
|
ar->v2d.minzoom = 0.01f;
|
||||||
ar->v2d.maxzoom= 50;
|
ar->v2d.maxzoom = 50;
|
||||||
ar->v2d.scroll = (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
|
ar->v2d.scroll = (V2D_SCROLL_BOTTOM | V2D_SCROLL_SCALE_HORIZONTAL);
|
||||||
ar->v2d.scroll |= (V2D_SCROLL_RIGHT);
|
ar->v2d.scroll |= (V2D_SCROLL_RIGHT);
|
||||||
ar->v2d.keepzoom= V2D_LOCKZOOM_Y;
|
ar->v2d.keepzoom = V2D_LOCKZOOM_Y;
|
||||||
ar->v2d.keepofs= V2D_KEEPOFS_Y;
|
ar->v2d.keepofs = V2D_KEEPOFS_Y;
|
||||||
ar->v2d.align= V2D_ALIGN_NO_POS_Y;
|
ar->v2d.align = V2D_ALIGN_NO_POS_Y;
|
||||||
ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
|
ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
|
||||||
|
|
||||||
return (SpaceLink *)saction;
|
return (SpaceLink *)saction;
|
||||||
@ -143,7 +143,7 @@ static void action_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa)
|
|||||||
|
|
||||||
static SpaceLink *action_duplicate(SpaceLink *sl)
|
static SpaceLink *action_duplicate(SpaceLink *sl)
|
||||||
{
|
{
|
||||||
SpaceAction *sactionn= MEM_dupallocN(sl);
|
SpaceAction *sactionn = MEM_dupallocN(sl);
|
||||||
|
|
||||||
/* clear or remove stuff from old */
|
/* clear or remove stuff from old */
|
||||||
|
|
||||||
@ -167,12 +167,12 @@ static void action_main_area_init(wmWindowManager *wm, ARegion *ar)
|
|||||||
static void action_main_area_draw(const bContext *C, ARegion *ar)
|
static void action_main_area_draw(const bContext *C, ARegion *ar)
|
||||||
{
|
{
|
||||||
/* draw entirely, view changes should be handled here */
|
/* draw entirely, view changes should be handled here */
|
||||||
SpaceAction *saction= CTX_wm_space_action(C);
|
SpaceAction *saction = CTX_wm_space_action(C);
|
||||||
bAnimContext ac;
|
bAnimContext ac;
|
||||||
View2D *v2d= &ar->v2d;
|
View2D *v2d = &ar->v2d;
|
||||||
View2DGrid *grid;
|
View2DGrid *grid;
|
||||||
View2DScrollers *scrollers;
|
View2DScrollers *scrollers;
|
||||||
short unit=0, flag=0;
|
short unit = 0, flag = 0;
|
||||||
|
|
||||||
/* clear and setup matrix */
|
/* clear and setup matrix */
|
||||||
UI_ThemeClearColor(TH_BACK);
|
UI_ThemeClearColor(TH_BACK);
|
||||||
@ -181,8 +181,8 @@ static void action_main_area_draw(const bContext *C, ARegion *ar)
|
|||||||
UI_view2d_view_ortho(v2d);
|
UI_view2d_view_ortho(v2d);
|
||||||
|
|
||||||
/* time grid */
|
/* time grid */
|
||||||
unit= (saction->flag & SACTION_DRAWTIME)? V2D_UNIT_SECONDS : V2D_UNIT_FRAMES;
|
unit = (saction->flag & SACTION_DRAWTIME) ? V2D_UNIT_SECONDS : V2D_UNIT_FRAMES;
|
||||||
grid= UI_view2d_grid_calc(CTX_data_scene(C), v2d, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY, ar->winx, ar->winy);
|
grid = UI_view2d_grid_calc(CTX_data_scene(C), v2d, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY, ar->winx, ar->winy);
|
||||||
UI_view2d_grid_draw(v2d, grid, V2D_GRIDLINES_ALL);
|
UI_view2d_grid_draw(v2d, grid, V2D_GRIDLINES_ALL);
|
||||||
UI_view2d_grid_free(grid);
|
UI_view2d_grid_free(grid);
|
||||||
|
|
||||||
@ -193,13 +193,13 @@ static void action_main_area_draw(const bContext *C, ARegion *ar)
|
|||||||
|
|
||||||
/* current frame */
|
/* current frame */
|
||||||
if (saction->flag & SACTION_DRAWTIME) flag |= DRAWCFRA_UNIT_SECONDS;
|
if (saction->flag & SACTION_DRAWTIME) flag |= DRAWCFRA_UNIT_SECONDS;
|
||||||
if ((saction->flag & SACTION_NODRAWCFRANUM)==0) flag |= DRAWCFRA_SHOW_NUMBOX;
|
if ((saction->flag & SACTION_NODRAWCFRANUM) == 0) flag |= DRAWCFRA_SHOW_NUMBOX;
|
||||||
ANIM_draw_cfra(C, v2d, flag);
|
ANIM_draw_cfra(C, v2d, flag);
|
||||||
|
|
||||||
/* markers */
|
/* markers */
|
||||||
UI_view2d_view_orthoSpecial(ar, v2d, 1);
|
UI_view2d_view_orthoSpecial(ar, v2d, 1);
|
||||||
|
|
||||||
flag = (ac.markers && (ac.markers != &ac.scene->markers))? DRAW_MARKERS_LOCAL : 0;
|
flag = (ac.markers && (ac.markers != &ac.scene->markers)) ? DRAW_MARKERS_LOCAL : 0;
|
||||||
draw_markers_time(C, flag);
|
draw_markers_time(C, flag);
|
||||||
|
|
||||||
/* preview range */
|
/* preview range */
|
||||||
@ -210,7 +210,7 @@ static void action_main_area_draw(const bContext *C, ARegion *ar)
|
|||||||
UI_view2d_view_restore(C);
|
UI_view2d_view_restore(C);
|
||||||
|
|
||||||
/* scrollers */
|
/* scrollers */
|
||||||
scrollers= UI_view2d_scrollers_calc(C, v2d, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
|
scrollers = UI_view2d_scrollers_calc(C, v2d, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
|
||||||
UI_view2d_scrollers_draw(C, v2d, scrollers);
|
UI_view2d_scrollers_draw(C, v2d, scrollers);
|
||||||
UI_view2d_scrollers_free(scrollers);
|
UI_view2d_scrollers_free(scrollers);
|
||||||
}
|
}
|
||||||
@ -231,7 +231,7 @@ static void action_channel_area_draw(const bContext *C, ARegion *ar)
|
|||||||
{
|
{
|
||||||
/* draw entirely, view changes should be handled here */
|
/* draw entirely, view changes should be handled here */
|
||||||
bAnimContext ac;
|
bAnimContext ac;
|
||||||
View2D *v2d= &ar->v2d;
|
View2D *v2d = &ar->v2d;
|
||||||
View2DScrollers *scrollers;
|
View2DScrollers *scrollers;
|
||||||
|
|
||||||
/* clear and setup matrix */
|
/* clear and setup matrix */
|
||||||
@ -249,7 +249,7 @@ static void action_channel_area_draw(const bContext *C, ARegion *ar)
|
|||||||
UI_view2d_view_restore(C);
|
UI_view2d_view_restore(C);
|
||||||
|
|
||||||
/* scrollers */
|
/* scrollers */
|
||||||
scrollers= UI_view2d_scrollers_calc(C, v2d, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
|
scrollers = UI_view2d_scrollers_calc(C, v2d, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
|
||||||
UI_view2d_scrollers_draw(C, v2d, scrollers);
|
UI_view2d_scrollers_draw(C, v2d, scrollers);
|
||||||
UI_view2d_scrollers_free(scrollers);
|
UI_view2d_scrollers_free(scrollers);
|
||||||
}
|
}
|
||||||
@ -299,7 +299,7 @@ static void action_channel_area_listener(ARegion *ar, wmNotifier *wmn)
|
|||||||
ED_region_tag_redraw(ar);
|
ED_region_tag_redraw(ar);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (wmn->data==ND_KEYS)
|
if (wmn->data == ND_KEYS)
|
||||||
ED_region_tag_redraw(ar);
|
ED_region_tag_redraw(ar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -346,7 +346,7 @@ static void action_main_area_listener(ARegion *ar, wmNotifier *wmn)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (wmn->data==ND_KEYS)
|
if (wmn->data == ND_KEYS)
|
||||||
ED_region_tag_redraw(ar);
|
ED_region_tag_redraw(ar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -354,7 +354,7 @@ static void action_main_area_listener(ARegion *ar, wmNotifier *wmn)
|
|||||||
/* editor level listener */
|
/* editor level listener */
|
||||||
static void action_listener(ScrArea *sa, wmNotifier *wmn)
|
static void action_listener(ScrArea *sa, wmNotifier *wmn)
|
||||||
{
|
{
|
||||||
SpaceAction *saction= (SpaceAction *)sa->spacedata.first;
|
SpaceAction *saction = (SpaceAction *)sa->spacedata.first;
|
||||||
|
|
||||||
/* context changes */
|
/* context changes */
|
||||||
switch (wmn->category) {
|
switch (wmn->category) {
|
||||||
@ -446,7 +446,7 @@ static void action_header_area_listener(ARegion *ar, wmNotifier *wmn)
|
|||||||
|
|
||||||
static void action_refresh(const bContext *C, ScrArea *sa)
|
static void action_refresh(const bContext *C, ScrArea *sa)
|
||||||
{
|
{
|
||||||
SpaceAction *saction= (SpaceAction *)sa->spacedata.first;
|
SpaceAction *saction = (SpaceAction *)sa->spacedata.first;
|
||||||
|
|
||||||
/* update the state of the animchannels in response to changes from the data they represent
|
/* update the state of the animchannels in response to changes from the data they represent
|
||||||
* NOTE: the temp flag is used to indicate when this needs to be done, and will be cleared once handled
|
* NOTE: the temp flag is used to indicate when this needs to be done, and will be cleared once handled
|
||||||
@ -464,52 +464,52 @@ static void action_refresh(const bContext *C, ScrArea *sa)
|
|||||||
/* only called once, from space/spacetypes.c */
|
/* only called once, from space/spacetypes.c */
|
||||||
void ED_spacetype_action(void)
|
void ED_spacetype_action(void)
|
||||||
{
|
{
|
||||||
SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype action");
|
SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype action");
|
||||||
ARegionType *art;
|
ARegionType *art;
|
||||||
|
|
||||||
st->spaceid= SPACE_ACTION;
|
st->spaceid = SPACE_ACTION;
|
||||||
strncpy(st->name, "Action", BKE_ST_MAXNAME);
|
strncpy(st->name, "Action", BKE_ST_MAXNAME);
|
||||||
|
|
||||||
st->new= action_new;
|
st->new = action_new;
|
||||||
st->free= action_free;
|
st->free = action_free;
|
||||||
st->init= action_init;
|
st->init = action_init;
|
||||||
st->duplicate= action_duplicate;
|
st->duplicate = action_duplicate;
|
||||||
st->operatortypes= action_operatortypes;
|
st->operatortypes = action_operatortypes;
|
||||||
st->keymap= action_keymap;
|
st->keymap = action_keymap;
|
||||||
st->listener= action_listener;
|
st->listener = action_listener;
|
||||||
st->refresh= action_refresh;
|
st->refresh = action_refresh;
|
||||||
|
|
||||||
/* regions: main window */
|
/* regions: main window */
|
||||||
art= MEM_callocN(sizeof(ARegionType), "spacetype action region");
|
art = MEM_callocN(sizeof(ARegionType), "spacetype action region");
|
||||||
art->regionid = RGN_TYPE_WINDOW;
|
art->regionid = RGN_TYPE_WINDOW;
|
||||||
art->init= action_main_area_init;
|
art->init = action_main_area_init;
|
||||||
art->draw= action_main_area_draw;
|
art->draw = action_main_area_draw;
|
||||||
art->listener= action_main_area_listener;
|
art->listener = action_main_area_listener;
|
||||||
art->keymapflag= ED_KEYMAP_VIEW2D|ED_KEYMAP_MARKERS|ED_KEYMAP_ANIMATION|ED_KEYMAP_FRAMES;
|
art->keymapflag = ED_KEYMAP_VIEW2D | ED_KEYMAP_MARKERS | ED_KEYMAP_ANIMATION | ED_KEYMAP_FRAMES;
|
||||||
|
|
||||||
BLI_addhead(&st->regiontypes, art);
|
BLI_addhead(&st->regiontypes, art);
|
||||||
|
|
||||||
/* regions: header */
|
/* regions: header */
|
||||||
art= MEM_callocN(sizeof(ARegionType), "spacetype action region");
|
art = MEM_callocN(sizeof(ARegionType), "spacetype action region");
|
||||||
art->regionid = RGN_TYPE_HEADER;
|
art->regionid = RGN_TYPE_HEADER;
|
||||||
art->prefsizey= HEADERY;
|
art->prefsizey = HEADERY;
|
||||||
art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMAP_FRAMES|ED_KEYMAP_HEADER;
|
art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_FRAMES | ED_KEYMAP_HEADER;
|
||||||
|
|
||||||
art->init= action_header_area_init;
|
art->init = action_header_area_init;
|
||||||
art->draw= action_header_area_draw;
|
art->draw = action_header_area_draw;
|
||||||
art->listener= action_header_area_listener;
|
art->listener = action_header_area_listener;
|
||||||
|
|
||||||
BLI_addhead(&st->regiontypes, art);
|
BLI_addhead(&st->regiontypes, art);
|
||||||
|
|
||||||
/* regions: channels */
|
/* regions: channels */
|
||||||
art= MEM_callocN(sizeof(ARegionType), "spacetype action region");
|
art = MEM_callocN(sizeof(ARegionType), "spacetype action region");
|
||||||
art->regionid = RGN_TYPE_CHANNELS;
|
art->regionid = RGN_TYPE_CHANNELS;
|
||||||
art->prefsizex= 200;
|
art->prefsizex = 200;
|
||||||
art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
|
art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D;
|
||||||
|
|
||||||
art->init= action_channel_area_init;
|
art->init = action_channel_area_init;
|
||||||
art->draw= action_channel_area_draw;
|
art->draw = action_channel_area_draw;
|
||||||
art->listener= action_channel_area_listener;
|
art->listener = action_channel_area_listener;
|
||||||
|
|
||||||
BLI_addhead(&st->regiontypes, art);
|
BLI_addhead(&st->regiontypes, art);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user