summaryrefslogtreecommitdiffstats
path: root/src/Authoring/Studio/Palettes/Timeline/Bindings/KeyframesManager.cpp
blob: a4adefbc2f34d7cc1b410dfbfd2d0b91cf8cd05b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
/****************************************************************************
**
** Copyright (C) 2008 NVIDIA Corporation.
** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt 3D Studio.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/

//==============================================================================
//	Prefix
//==============================================================================
#include "stdafx.h"

#include "KeyframesManager.h"
#include "IDoc.h"
#include "TimeEditDlg.h"
#include "TimelineTranslationManager.h"
#include "UICDMTimelineKeyframe.h"
#include "UICDMTimelineItemBinding.h"
#include "CmdDataModelRemoveKeyframe.h"
#include "CmdDataModelInsertKeyframe.h"
#include "CmdDataModelChangeKeyframe.h"
#include "UICDMAnimation.h"
#include "ClientDataModelBridge.h"
#include "PasteKeyframesCommandHelper.h"
#include "IDocumentEditor.h"
#include "IKeyframe.h"
#include "Dispatch.h"
#include "StudioPreferences.h"

#include "StudioApp.h" //for CommitCurrentCommand
#include "Core.h"
#include "Dialogs.h"

using namespace UICDM;

bool SortKeyframeInstancePairByTime(const CKeyframesManager::SKeyframeInstancePair &inLHS,
                                    const CKeyframesManager::SKeyframeInstancePair &inRHS)
{
    return inLHS.m_Keyframe->GetTime() < inRHS.m_Keyframe->GetTime();
}

//==============================================================================
//	Keyframe specific.
//  UICDM selection is handled by CTimelineTranslationManager.
//==============================================================================
CKeyframesManager::CKeyframesManager(CTimelineTranslationManager *inTransMgr)
    : m_TransMgr(inTransMgr)
    , m_OffsetKeyframeCommandHelper(*(g_StudioApp.GetCore()->GetDoc()))
    , m_PasteKeyframeCommandHelper(nullptr)
{
    g_StudioApp.GetCore()->GetDoc()->SetKeyframesManager(this);
}

CKeyframesManager::~CKeyframesManager()
{
    delete m_PasteKeyframeCommandHelper;
}

bool CKeyframesManager::HasSelectedKeyframes(bool inOnlyDynamic /*= false */)
{
    // specifically only to know if there are any selected keyframes that are dynamic
    if (inOnlyDynamic) {
        for (size_t theIndex = 0; theIndex < m_SelectedKeyframes.size(); ++theIndex)
            if (m_SelectedKeyframes[theIndex].m_Keyframe->IsDynamic())
                return true;

        return false;
    }

    bool theRetVal = !m_SelectedKeyframes.empty();

    return theRetVal;
}

bool CKeyframesManager::CanPerformKeyframeCopy()
{
    bool theCanCopyNewData = false;
    // Legacy system actually prevents copy/pasting between different instances, so let's preserve
    // that
    if (!m_SelectedKeyframes.empty()) {
        theCanCopyNewData = true;
        if (m_SelectedKeyframes.size() > 1) {
            CUICDMTimelineItemBinding *theInstance = m_SelectedKeyframes[0].m_Instance;
            TSelectedKeyframeList::iterator theIter = m_SelectedKeyframes.begin();
            ++theIter;
            for (; theIter != m_SelectedKeyframes.end() && theCanCopyNewData; ++theIter) {
                if (theIter->m_Instance != theInstance) // fail!
                    theCanCopyNewData = false;
            }
        }
    }
    return theCanCopyNewData;
}

bool CKeyframesManager::CanPerformKeyframePaste()
{
    if (m_PasteKeyframeCommandHelper && m_PasteKeyframeCommandHelper->HasCopiedKeyframes()) {
        UICDM::CUICDMInstanceHandle theSelectedInstance =
            g_StudioApp.GetCore()->GetDoc()->GetSelectedInstance();
        if (theSelectedInstance.Valid()) {
            return true;
        }
    }
    return false;
}

void CKeyframesManager::CopyKeyframes()
{
    CopySelectedKeyframes();
}

// legacy stuff that we have to support for animation tracks in the old data model to work
inline void PostExecuteCommand(IDoc *inDoc)
{
    CDoc *theDoc = dynamic_cast<CDoc *>(inDoc);
    theDoc->GetCore()->CommitCurrentCommand();
    // fire render event.
    // theDoc->UpdateClientScene( true );
}

//@param inPerformCopy true if that is a copy/cut command. false if this is a delete.
// Note: Keyframes are never explicitly copied to the clipboard (only as part of a asset copy),
// hence that means that the keyframes (only) are never copied across different instances of studio.
bool CKeyframesManager::RemoveKeyframes(bool inPerformCopy)
{
    bool theRetVal = HasSelectedKeyframes();

    CDoc *theDoc = g_StudioApp.GetCore()->GetDoc();

    if (inPerformCopy) // copy prior to removing the keyframes
        CopySelectedKeyframes();

    CCmdDataModelRemoveKeyframe *theCmd = nullptr;
    if (!m_SelectedKeyframes.empty()) {
        TSelectedKeyframeList::iterator theKeyIter = m_SelectedKeyframes.begin();
        for (; theKeyIter != m_SelectedKeyframes.end(); ++theKeyIter) {
            CUICDMTimelineKeyframe::TKeyframeHandleList theKeyframeHandles;
            theKeyIter->m_Keyframe->GetKeyframeHandles(theKeyframeHandles);
            ASSERT(!theKeyframeHandles.empty());
            CUICDMTimelineKeyframe::TKeyframeHandleList::iterator theIter =
                theKeyframeHandles.begin();
            if (!theCmd) {
                theCmd = new CCmdDataModelRemoveKeyframe(theDoc, *theIter);
                ++theIter;
            }
            for (; theIter != theKeyframeHandles.end(); ++theIter)
                theCmd->AddKeyframeHandle(*theIter);
        }
    }

    if (theCmd) {
        g_StudioApp.GetCore()->ExecuteCommand(theCmd);
        PostExecuteCommand(theDoc);
    }
    return theRetVal;
}

// note: we can't paste data from old data model system to the new one, and vice versa. so either
// the old Or the new system succeeds in pasting, never both.
void CKeyframesManager::PasteKeyframes()
{
    CDoc *theDoc = g_StudioApp.GetCore()->GetDoc();

    if (m_PasteKeyframeCommandHelper && m_PasteKeyframeCommandHelper->HasCopiedKeyframes()) {
        UICDM::CUICDMInstanceHandle theSelectedInstance = theDoc->GetSelectedInstance();
        if (theSelectedInstance.Valid()) {
            long theCurrentViewTimeInMilliseconds = theDoc->GetCurrentViewTime();
            CCmdDataModelInsertKeyframe *theInsertKeyframesCommand =
                m_PasteKeyframeCommandHelper->GetCommand(theDoc, theCurrentViewTimeInMilliseconds,
                                                         theSelectedInstance);
            if (theInsertKeyframesCommand)
                g_StudioApp.GetCore()->ExecuteCommand(theInsertKeyframesCommand);
        }
    }
}

//=============================================================================
/**
 * Sets interpolation values of all selected keyframes to the values specified
 * by the user.  Pops up a dialog prompting the user to choose new ease in and
 * ease out values.  Values in the dialog are initialized to the left-most
 * selected keyframe's interpolation values.
 */
void CKeyframesManager::SetKeyframeInterpolation()
{
    if (!HasSelectedKeyframes())
        return;

    float theEaseIn = 0;
    float theEaseOut = 0;
    if (CStudioPreferences::GetInterpolation())
        theEaseIn = theEaseOut = 100;

    IAnimationCore *theAnimationCore = m_TransMgr->GetStudioSystem()->GetAnimationCore();

    if (!m_SelectedKeyframes.empty()) // this is a sorted list, so we only need to grab tge ease
                                      // in/out values from the first item in this list.
    {
        CUICDMTimelineKeyframe *theTimelineKeyframe = m_SelectedKeyframes.front().m_Keyframe;
        CUICDMTimelineKeyframe::TKeyframeHandleList theKeyframeHandles;
        theTimelineKeyframe->GetKeyframeHandles(theKeyframeHandles);
        TKeyframe theKeyframeData = theAnimationCore->GetKeyframeData(theKeyframeHandles[0]);
        GetEaseInOutValues(theKeyframeData, theEaseIn, theEaseOut);
    }

    if (g_StudioApp.GetDialogs()->PromptForKeyframeInterpolation(theEaseIn, theEaseOut)) {
        CDoc *theDoc = g_StudioApp.GetCore()->GetDoc();
        Q3DStudio::ScopedDocumentEditor editor(*theDoc, L"Set Keyframe Interpolation", __FILE__,
                                               __LINE__);
        TSelectedKeyframeList::iterator theKeyIter = m_SelectedKeyframes.begin();
        for (; theKeyIter != m_SelectedKeyframes.end(); ++theKeyIter) {
            CUICDMTimelineKeyframe *theTimelineKeyframe = theKeyIter->m_Keyframe;
            CUICDMTimelineKeyframe::TKeyframeHandleList theKeyframeHandles;
            theTimelineKeyframe->GetKeyframeHandles(theKeyframeHandles);
            for (size_t i = 0; i < theKeyframeHandles.size(); ++i) {
                TKeyframe theKeyframeData =
                    theAnimationCore->GetKeyframeData(theKeyframeHandles[i]);
                SetEaseInOutValues(theKeyframeData, theEaseIn, theEaseOut);
                theAnimationCore->SetKeyframeData(theKeyframeHandles[i], theKeyframeData);
            }
        }
    }
}

bool CKeyframesManager::HasDynamicKeyframes()
{
    CUICDMTimelineItemBinding *theBinding = m_TransMgr->GetSelectedBinding();
    if (theBinding) {
        return theBinding->HasDynamicKeyframes(-1);
    }
    return false;
}

void CKeyframesManager::SelectAllKeyframes()
{
    ITimelineItemBinding *theBinding = m_TransMgr->GetSelectedBinding();
    if (theBinding)
        theBinding->SelectKeyframes(true);
}

void CKeyframesManager::DeselectAllKeyframes()
{
    m_TransMgr->ClearBindingsKeyframeSelection();
    m_SelectedKeyframes.clear();
}

//==============================================================================
/**
 * Sets keyframes on all the changed properties of the selected object.
 * Also known as autoset keyframes, but it only applies to one object, and is
 * the result of an F6 key press.  Tells the TimelineCtrl to autoset keyframes.
 */
void CKeyframesManager::SetChangedKeyframes()
{

    CDoc *theDoc = g_StudioApp.GetCore()->GetDoc();
    UICDM::CUICDMInstanceHandle theSelectedInstance = theDoc->GetSelectedInstance();
    if (theSelectedInstance.Valid()) {
        using namespace Q3DStudio;
        Q3DStudio::ScopedDocumentEditor editor(*theDoc, L"Set Changed Keyframes", __FILE__,
                                               __LINE__);
        CStudioSystem *theStudioSystem = theDoc->GetStudioSystem();
        // Get all animated properties.
        TPropertyHandleList theProperties;
        theStudioSystem->GetPropertySystem()->GetAggregateInstanceProperties(theSelectedInstance,
                                                                             theProperties);
        for (size_t thePropertyIndex = 0; thePropertyIndex < theProperties.size();
             ++thePropertyIndex) {
            if (theStudioSystem->GetAnimationSystem()->IsPropertyAnimated(
                    theSelectedInstance, theProperties[thePropertyIndex]))
                editor->KeyframeProperty(theSelectedInstance, theProperties[thePropertyIndex],
                                         true);
        }
    }
}

void CKeyframesManager::SetKeyframeTime(long inTime)
{
    CTimeEditDlg theTimeEditDlg;
    theTimeEditDlg.SetKeyframesManager(this);
    theTimeEditDlg.ShowDialog(inTime, 0, g_StudioApp.GetCore()->GetDoc(), ASSETKEYFRAME);
}

void CKeyframesManager::SetKeyframeDynamic(CUICDMTimelineKeyframe *inKeyframe, bool inDynamic)
{
    CDoc *theDoc = g_StudioApp.GetCore()->GetDoc();
    UICDM::TKeyframeHandleList theKeyframeHandle;
    CCmdDataModelChangeDynamicKeyframe *theCmd = nullptr;

    if (inKeyframe != nullptr)
        inKeyframe->GetKeyframeHandles(theKeyframeHandle);

    UICDM::IAnimationCore *theAnimationCore = theDoc->GetStudioSystem()->GetAnimationCore();
    for (size_t theKeyframe = 0; theKeyframe < theKeyframeHandle.size(); ++theKeyframe) {
        UICDM::CUICDMAnimationHandle theAnimation(
            theAnimationCore->GetAnimationForKeyframe(theKeyframeHandle.at(theKeyframe)));
        if (!theCmd)
            theCmd = new CCmdDataModelChangeDynamicKeyframe(theDoc, theAnimation, inDynamic);
        else
            theCmd->AddHandle(theAnimation);
    }

    if (theCmd)
        g_StudioApp.GetCore()->ExecuteCommand(theCmd);
}

void CKeyframesManager::SetKeyframesDynamic(bool inDynamic)
{

    CUICDMTimelineKeyframe *theKeyframe;

    if (m_SelectedKeyframes.size() == 0) {
        CUICDMTimelineItemBinding *theBinding = m_TransMgr->GetSelectedBinding();
        IKeyframe *key = theBinding->GetKeyframeByIndex(0);
        theKeyframe = dynamic_cast<CUICDMTimelineKeyframe *>(key);
        SetKeyframeDynamic(theKeyframe, inDynamic);
    } else {
        for (int i = 0; i < (int)m_SelectedKeyframes.size(); ++i) {
            theKeyframe = m_SelectedKeyframes[i].m_Keyframe;
            SetKeyframeDynamic(theKeyframe, inDynamic);
        }
    }
}

long CKeyframesManager::OffsetSelectedKeyframes(long inOffset)
{
    m_InstanceSet.clear();
    m_InstanceList.clear();
    std::set<CUICDMTimelineItemBinding *> &theInstances(m_InstanceSet);

    TSelectedKeyframeList::iterator theKeyIter = m_SelectedKeyframes.begin();
    for (; theKeyIter != m_SelectedKeyframes.end(); ++theKeyIter) {
        // since this list is sorted by time and we are iterating from the first in the list
        long theKeyframeTime = theKeyIter->m_Keyframe->GetTime();
        if (inOffset < 0 && theKeyframeTime + inOffset < 0)
            inOffset = -theKeyframeTime;

        theKeyIter->m_Keyframe->UpdateKeyframesTime(&m_OffsetKeyframeCommandHelper,
                                                    theKeyframeTime + inOffset);

        // this contains unique instancs, i.e. mulitple keyframe can map to the same instances
        if (theInstances.insert(theKeyIter->m_Instance).second)
            m_InstanceList.push_back(theKeyIter->m_Instance->GetInstance());
    }

    // UI update, explicitly because this doesn't generate any events till action is committed
    std::set<CUICDMTimelineItemBinding *>::iterator theInstanceIter = theInstances.begin();
    for (; theInstanceIter != theInstances.end(); ++theInstanceIter)
        (*theInstanceIter)->UIRefreshPropertyKeyframe(inOffset);

    if (m_InstanceList.size())
        m_TransMgr->GetDoc()->GetCore()->GetDispatch()->FireImmediateRefreshInstance(
            &m_InstanceList[0], (long)m_InstanceList.size());

    // by contract, this functions returns the "legal" offset, ie time cannot be offset to negative.
    return inOffset;
}

void CKeyframesManager::CommitChangedKeyframes()
{
    m_OffsetKeyframeCommandHelper.Finalize();
}

void CKeyframesManager::RollbackChangedKeyframes()
{
    m_OffsetKeyframeCommandHelper.Rollback();
}

bool CKeyframesManager::CanMakeSelectedKeyframesDynamic()
{
    using namespace UICDM;
    TKeyframeHandleList theKeyframes;
    TKeyframeHandleList allTheKeyframes;
    IAnimationCore &theAnimationCore(
        *g_StudioApp.GetCore()->GetDoc()->GetStudioSystem()->GetAnimationCore());
    // Ensure that all keyframes selected are the first keyframes from the animation track.
    for (size_t idx = 0, end = m_SelectedKeyframes.size(); idx < end; ++idx) {
        theKeyframes.clear();
        m_SelectedKeyframes.at(idx).m_Keyframe->GetKeyframeHandles(theKeyframes);
        for (size_t specificKeyframeIdx = 0, specificKeyframeEnd = theKeyframes.size();
             specificKeyframeIdx < specificKeyframeEnd; ++specificKeyframeIdx) {
            CUICDMKeyframeHandle theKeyframe = theKeyframes[specificKeyframeIdx];
            CUICDMAnimationHandle theAnimation =
                theAnimationCore.GetAnimationForKeyframe(theKeyframe);
            allTheKeyframes.clear();
            theAnimationCore.GetKeyframes(theAnimation, allTheKeyframes);
            if (allTheKeyframes[0] != theKeyframe)
                return false;
        }
    }
    return true;
}

// keeps track of selected keyframes so that we don't have to iterate through the entire hierarchy
// to find them
void CKeyframesManager::SetKeyframeSelected(CUICDMTimelineKeyframe *inKeyframe, bool inSelected,
                                            CUICDMTimelineItemBinding *inOwningInstance /*= nullptr */)
{
    TSelectedKeyframeList::iterator theKeyIter = m_SelectedKeyframes.begin();
    for (; theKeyIter != m_SelectedKeyframes.end(); ++theKeyIter) {
        if (theKeyIter->m_Keyframe == inKeyframe)
            break;
    }
    if (inSelected) {
        ASSERT(inOwningInstance);
        if (theKeyIter == m_SelectedKeyframes.end()) { // only this is not already selected
            m_SelectedKeyframes.push_back(SKeyframeInstancePair(inKeyframe, inOwningInstance));
            std::sort(m_SelectedKeyframes.begin(), m_SelectedKeyframes.end(),
                      SortKeyframeInstancePairByTime);
        }
    } else if (theKeyIter != m_SelectedKeyframes.end()) {
        m_SelectedKeyframes.erase(theKeyIter);
    }
}

UICDM::SGetOrSetKeyframeInfo SetupKeyframeInfo(UICDM::CUICDMKeyframeHandle inKeyframe,
                                               UICDM::IAnimationCore &inCore)
{
    TKeyframe theKeyframeData = inCore.GetKeyframeData(inKeyframe);
    SEaseInEaseOutKeyframe theKeyframe = UICDM::get<SEaseInEaseOutKeyframe>(theKeyframeData);
    // Is this the first keyframe?
    bool isDynamic = false;
    if (inCore.IsFirstKeyframe(inKeyframe))
        isDynamic = inCore.GetAnimationInfo(inCore.GetAnimationForKeyframe(inKeyframe))
                        .m_DynamicFirstKeyframe;

    return SGetOrSetKeyframeInfo(theKeyframe.m_KeyframeValue, theKeyframe.m_EaseIn,
                                 theKeyframe.m_EaseOut, isDynamic);
}

// only deal with this manager's selected keyframes
void CKeyframesManager::CopySelectedKeyframes()
{
    if (!m_SelectedKeyframes.empty()) {
        if (m_PasteKeyframeCommandHelper)
            m_PasteKeyframeCommandHelper->Clear(); // clear out previously copied data
        else
            m_PasteKeyframeCommandHelper = new CPasteKeyframeCommandHelper();

        // note: m_SelectedKeyframes is already sorted by time
        float theEarliestKeyframeTimeInSecs =
            CUICDMTimelineKeyframe::GetTimeInSecs(m_SelectedKeyframes[0].m_Keyframe->GetTime());

        IAnimationCore *theAnimationCore = m_TransMgr->GetStudioSystem()->GetAnimationCore();
        TSelectedKeyframeList::iterator theIter = m_SelectedKeyframes.begin();
        for (; theIter != m_SelectedKeyframes.end(); ++theIter) {
            CUICDMTimelineKeyframe *theKeyframe = (*theIter).m_Keyframe;
            CUICDMTimelineKeyframe::TKeyframeHandleList theKeyframeHandles;
            theKeyframe->GetKeyframeHandles(theKeyframeHandles);
            UICDM::SGetOrSetKeyframeInfo theInfos[3];
            size_t theValidInfos = 0;
            if (!theKeyframeHandles.empty()) {
                // TODO: need to figure out a good way to convert from individual keyframes back to
                // SValue
                SValue theValue;
                switch (theKeyframeHandles.size()) {
                case 1: {
                    theInfos[0] = SetupKeyframeInfo(theKeyframeHandles[0], *theAnimationCore);
                    theValidInfos = 1;

                } break;
                case 3: {
                    theInfos[0] = SetupKeyframeInfo(theKeyframeHandles[0], *theAnimationCore);
                    theInfos[1] = SetupKeyframeInfo(theKeyframeHandles[1], *theAnimationCore);
                    theInfos[2] = SetupKeyframeInfo(theKeyframeHandles[2], *theAnimationCore);
                    theValidInfos = 3;
                } break;
                default: // not handled
                    break;
                }
                // time is relative to the earliest keyframe time.
                float theRelativeTimeInSecs =
                    CUICDMTimelineKeyframe::GetTimeInSecs(theKeyframe->GetTime())
                    - theEarliestKeyframeTimeInSecs;

                CUICDMAnimationHandle theAnimation =
                    theAnimationCore->GetAnimationForKeyframe(theKeyframeHandles[0]);
                m_PasteKeyframeCommandHelper->AddKeyframeData(
                    theAnimationCore->GetAnimationInfo(theAnimation).m_Property,
                    theRelativeTimeInSecs, theInfos, theValidInfos);
            }
        }
    }
}