13 #include "testing/testing.h"
17 TEST(action_groups, ReconstructGroupsWithReordering)
21 FCurve groupAcurve1 = {
nullptr};
22 FCurve groupAcurve2 = {
nullptr};
23 FCurve groupBcurve1 = {
nullptr};
24 FCurve groupBcurve2 = {
nullptr};
25 FCurve groupBcurve3 = {
nullptr};
27 FCurve groupDcurve1 = {
nullptr};
28 FCurve groupDcurve2 = {
nullptr};
30 groupAcurve1.
rna_path = (
char *)
"groupAcurve1";
31 groupAcurve2.
rna_path = (
char *)
"groupAcurve2";
32 groupBcurve1.
rna_path = (
char *)
"groupBcurve1";
33 groupBcurve2.
rna_path = (
char *)
"groupBcurve2";
34 groupDcurve1.
rna_path = (
char *)
"groupDcurve1";
35 groupBcurve3.
rna_path = (
char *)
"groupBcurve3";
36 groupDcurve2.
rna_path = (
char *)
"groupDcurve2";
47 groupBcurve1.
prev =
nullptr;
48 groupBcurve3.
prev = &groupBcurve2;
49 groupDcurve1.
prev = &groupBcurve3;
55 strcpy(groupA.
name,
"groupA");
56 strcpy(groupB.
name,
"groupB");
57 strcpy(groupC.
name,
"groupC");
58 strcpy(groupD.
name,
"groupD");
65 groupAcurve1.
grp = &groupA;
66 groupAcurve2.
grp = &groupA;
67 groupBcurve1.
grp = &groupB;
68 groupBcurve2.
grp = &groupB;
69 groupBcurve3.
grp = &groupB;
70 groupDcurve1.
grp = &groupD;
71 groupDcurve2.
grp = &groupD;
133 std::unique_ptr<BezTriple[]> allocate_keyframes(
FCurve *fcu,
const size_t num_keyframes)
135 auto bezt_uptr = std::make_unique<BezTriple[]>(num_keyframes);
136 fcu->
bezt = bezt_uptr.get();
141 void add_keyframe(
FCurve *fcu,
float x,
float y)
145 memset(&the_keyframe, 0,
sizeof(the_keyframe));
148 the_keyframe.
vec[0][0] =
x - 1.0f;
149 the_keyframe.
vec[0][1] =
y;
150 the_keyframe.
vec[1][0] =
x;
151 the_keyframe.
vec[1][1] =
y;
152 the_keyframe.
vec[2][0] =
x + 1.0f;
153 the_keyframe.
vec[2][1] =
y;
155 memcpy(&fcu->
bezt[fcu->
totvert], &the_keyframe,
sizeof(the_keyframe));
168 const bAction empty = {{
nullptr}};
170 <<
"Action without FCurves cannot have a single frame.";
176 std::unique_ptr<BezTriple[]> bezt = allocate_keyframes(&fcu, 1);
177 add_keyframe(&fcu, 1.0f, 2.0f);
183 <<
"Action with one FCurve and one key should have single frame.";
190 std::unique_ptr<BezTriple[]> bezt1 = allocate_keyframes(&fcu1, 1);
191 std::unique_ptr<BezTriple[]> bezt2 = allocate_keyframes(&fcu2, 1);
192 add_keyframe(&fcu1, 1.0f, 327.0f);
193 add_keyframe(&fcu2, 1.0f, 47.0f);
200 <<
"Two FCurves with keys on the same frame should have single frame.";
205 <<
"Two FCurves with keys on different frames should have animation.";
211 std::unique_ptr<BezTriple[]> bezt = allocate_keyframes(&fcu, 2);
212 add_keyframe(&fcu, 1.0f, 2.0f);
213 add_keyframe(&fcu, 2.0f, 2.5f);
219 <<
"Action with one FCurve and two keys must have animation.";
Blender kernel action and pose functionality.
void BKE_action_groups_reconstruct(struct bAction *act)
bool BKE_action_has_single_frame(const struct bAction *act)
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
Read Guarded memory(de)allocation.
TEST(action_groups, ReconstructGroupsWithReordering)
struct bActionGroup * prev
struct bActionGroup * next