Anim: Cleanup: Move CfraElem struct to editors #110527

Merged
Falk David merged 1 commits from filedescriptor/blender:cleanup-move-cfra-elem-to-editors into main 2023-07-27 15:11:38 +02:00
5 changed files with 12 additions and 45 deletions

View File

@ -34,14 +34,6 @@ struct StructRNA;
struct bAction;
struct bContext;
/* ************** Keyframe Tools ***************** */
typedef struct CfraElem {
struct CfraElem *next, *prev;
float cfra;
int sel;
} CfraElem;
/* ************** F-Curve Modifiers *************** */
/**

View File

@ -1011,43 +1011,6 @@ bool BKE_fcurve_is_keyframable(const FCurve *fcu)
/** \} */
/* -------------------------------------------------------------------- */
/** \name Keyframe Column Tools
* \{ */
static void UNUSED_FUNCTION(bezt_add_to_cfra_elem)(ListBase *lb, BezTriple *bezt)
{
CfraElem *ce, *cen;
for (ce = static_cast<CfraElem *>(lb->first); ce; ce = ce->next) {
/* Double key? */
if (IS_EQT(ce->cfra, bezt->vec[1][0], BEZT_BINARYSEARCH_THRESH)) {
if (bezt->f2 & SELECT) {
ce->sel = bezt->f2;
}
return;
}
/* Should key be inserted before this column? */
if (ce->cfra > bezt->vec[1][0]) {
break;
}
}
/* Create a new column */
cen = static_cast<CfraElem *>(MEM_callocN(sizeof(CfraElem), "add_to_cfra_elem"));
if (ce) {
BLI_insertlinkbefore(lb, ce, cen);
}
else {
BLI_addtail(lb, cen);
}
cen->cfra = bezt->vec[1][0];
cen->sel = bezt->f2;
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Samples Utilities
* \{ */

View File

@ -46,6 +46,7 @@
#include "UI_view2d.h"
#include "ED_anim_api.h"
#include "ED_keyframes_edit.h"
#include "ED_markers.h"
#include "ED_numinput.h"
#include "ED_object.h"

View File

@ -65,6 +65,7 @@
#include "UI_resources.h"
#include "ED_armature.h"
#include "ED_keyframes_edit.h"
#include "ED_keyframes_keylist.h"
#include "ED_keyframing.h"
#include "ED_markers.h"

View File

@ -160,6 +160,16 @@ ENUM_OPERATORS(eKeyframeIterFlags, KEYFRAME_ITER_HANDLES_DEFAULT_INVISIBLE)
/** \name Generic Properties for Keyframe Edit Tools
* \{ */
/**
* Temporary struct used to store frame time and selection status.
* Used for example by `columnselect_action_keys` to select all keyframes in a column.
*/
typedef struct CfraElem {
struct CfraElem *next, *prev;
float cfra;
int sel;
} CfraElem;
typedef struct KeyframeEditData {
/* generic properties/data access */
/** temp list for storing custom list of data to check */