Fix #94080: clicking empty space in timeline creates undo step #105913
|
@ -1726,6 +1726,10 @@ static int mouse_action_keys(bAnimContext *ac,
|
||||||
/* deselect all keyframes */
|
/* deselect all keyframes */
|
||||||
deselect_action_keys(ac, 0, SELECT_SUBTRACT);
|
deselect_action_keys(ac, 0, SELECT_SUBTRACT);
|
||||||
|
|
||||||
|
/* If nothing selected, return OPERATOR_CANCELLED.*/
|
||||||
|
if (!found && ale == NULL) {
|
||||||
|
ret_value = OPERATOR_CANCELLED;
|
||||||
|
}
|
||||||
/* highlight channel clicked on */
|
/* highlight channel clicked on */
|
||||||
if (ELEM(ac->datatype, ANIMCONT_ACTION, ANIMCONT_DOPESHEET, ANIMCONT_TIMELINE)) {
|
if (ELEM(ac->datatype, ANIMCONT_ACTION, ANIMCONT_DOPESHEET, ANIMCONT_TIMELINE)) {
|
||||||
/* deselect all other channels first */
|
/* deselect all other channels first */
|
||||||
|
@ -1733,6 +1737,7 @@ static int mouse_action_keys(bAnimContext *ac,
|
||||||
|
|
||||||
/* Highlight Action-Group or F-Curve? */
|
/* Highlight Action-Group or F-Curve? */
|
||||||
if (ale != NULL && ale->data) {
|
if (ale != NULL && ale->data) {
|
||||||
|
|
||||||
if (ale->type == ANIMTYPE_GROUP) {
|
if (ale->type == ANIMTYPE_GROUP) {
|
||||||
bActionGroup *agrp = ale->data;
|
bActionGroup *agrp = ale->data;
|
||||||
|
|
||||||
|
@ -1756,7 +1761,6 @@ static int mouse_action_keys(bAnimContext *ac,
|
||||||
else if (ac->datatype == ANIMCONT_GPENCIL) {
|
else if (ac->datatype == ANIMCONT_GPENCIL) {
|
||||||
Melissa-Goon marked this conversation as resolved
Outdated
|
|||||||
/* deselect all other channels first */
|
/* deselect all other channels first */
|
||||||
ANIM_anim_channels_select_set(ac, ACHANNEL_SETFLAG_CLEAR);
|
ANIM_anim_channels_select_set(ac, ACHANNEL_SETFLAG_CLEAR);
|
||||||
|
|
||||||
/* Highlight GPencil Layer */
|
/* Highlight GPencil Layer */
|
||||||
if (ale != NULL && ale->data != NULL && ale->type == ANIMTYPE_GPLAYER) {
|
if (ale != NULL && ale->data != NULL && ale->type == ANIMTYPE_GPLAYER) {
|
||||||
bGPdata *gpd = (bGPdata *)ale->id;
|
bGPdata *gpd = (bGPdata *)ale->id;
|
||||||
|
@ -1808,7 +1812,6 @@ static int mouse_action_keys(bAnimContext *ac,
|
||||||
/* free this channel */
|
/* free this channel */
|
||||||
MEM_freeN(ale);
|
MEM_freeN(ale);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret_value;
|
return ret_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
This condition doesn't depend on anything inside this
else
clause, so it can be moved outside of it. I think that's also better, because afterdeselect_action_keys()
has called something may have changed, and having that undo step is important.found
andale
do not change after the call toactkeys_find_key_at_position()
, so this code can be moved directly after that.