Refactor: adding function to check if an animation container has grease pencil layer keyframes.
Used in action_select to refactor the selection operators. No functional changes. Reviewed By: Sybren A. Stüvel Differential Revision: http://developer.blender.org/D16168
This commit is contained in:
@@ -417,6 +417,11 @@ bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
|
|||||||
return ANIM_animdata_context_getdata(ac);
|
return ANIM_animdata_context_getdata(ac);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ANIM_animdata_can_have_greasepencil(const eAnimCont_Types type)
|
||||||
|
{
|
||||||
|
return type == ANIMCONT_GPENCIL;
|
||||||
|
}
|
||||||
|
|
||||||
/* ************************************************************ */
|
/* ************************************************************ */
|
||||||
/* Blender Data <-- Filter --> Channels to be operated on */
|
/* Blender Data <-- Filter --> Channels to be operated on */
|
||||||
|
|
||||||
|
|||||||
@@ -519,6 +519,11 @@ void ANIM_animdata_update(bAnimContext *ac, ListBase *anim_data);
|
|||||||
|
|
||||||
void ANIM_animdata_freelist(ListBase *anim_data);
|
void ANIM_animdata_freelist(ListBase *anim_data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the given animation container can contain grease pencil layer keyframes.
|
||||||
|
*/
|
||||||
|
bool ANIM_animdata_can_have_greasepencil(const eAnimCont_Types type);
|
||||||
|
|
||||||
/* ************************************************ */
|
/* ************************************************ */
|
||||||
/* ANIMATION CHANNELS LIST */
|
/* ANIMATION CHANNELS LIST */
|
||||||
/* anim_channels_*.c */
|
/* anim_channels_*.c */
|
||||||
|
|||||||
@@ -322,7 +322,7 @@ static int actkeys_deselectall_exec(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
/* 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);
|
||||||
if (ac.datatype == ANIMCONT_GPENCIL) {
|
if (ANIM_animdata_can_have_greasepencil(ac.datatype)) {
|
||||||
WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL);
|
||||||
}
|
}
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
@@ -563,7 +563,7 @@ static int actkeys_box_select_exec(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
/* 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);
|
||||||
if (ac.datatype == ANIMCONT_GPENCIL) {
|
if (ANIM_animdata_can_have_greasepencil(ac.datatype)) {
|
||||||
WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL);
|
||||||
}
|
}
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
@@ -800,7 +800,7 @@ static int actkeys_lassoselect_exec(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
/* send notifier that keyframe selection has changed */
|
/* send 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);
|
||||||
if (ac.datatype == ANIMCONT_GPENCIL) {
|
if (ANIM_animdata_can_have_greasepencil(ac.datatype)) {
|
||||||
WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL);
|
||||||
}
|
}
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
@@ -868,7 +868,7 @@ static int action_circle_select_exec(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
/* send notifier that keyframe selection has changed */
|
/* send 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);
|
||||||
if (ac.datatype == ANIMCONT_GPENCIL) {
|
if (ANIM_animdata_can_have_greasepencil(ac.datatype)) {
|
||||||
WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL);
|
||||||
}
|
}
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
@@ -1107,7 +1107,7 @@ static int actkeys_columnselect_exec(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
/* 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);
|
||||||
if (ac.datatype == ANIMCONT_GPENCIL) {
|
if (ANIM_animdata_can_have_greasepencil(ac.datatype)) {
|
||||||
WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL);
|
||||||
}
|
}
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
@@ -1170,7 +1170,7 @@ static int actkeys_select_linked_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
|
|
||||||
/* 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);
|
||||||
if (ac.datatype == ANIMCONT_GPENCIL) {
|
if (ANIM_animdata_can_have_greasepencil(ac.datatype)) {
|
||||||
WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL);
|
||||||
}
|
}
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
@@ -1256,7 +1256,7 @@ static int actkeys_select_more_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
|
|
||||||
/* 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);
|
||||||
if (ac.datatype == ANIMCONT_GPENCIL) {
|
if (ANIM_animdata_can_have_greasepencil(ac.datatype)) {
|
||||||
WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL);
|
||||||
}
|
}
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
@@ -1293,7 +1293,7 @@ static int actkeys_select_less_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
|
|
||||||
/* 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);
|
||||||
if (ac.datatype == ANIMCONT_GPENCIL) {
|
if (ANIM_animdata_can_have_greasepencil(ac.datatype)) {
|
||||||
WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL);
|
||||||
}
|
}
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
|
|||||||
Reference in New Issue
Block a user