diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2015-08-25 14:42:09 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2015-08-25 14:42:09 +0300 |
commit | ba5807c2710939cf8171fb19830f82cece48759f (patch) | |
tree | 77c7c9eddca6c63ff84850cd0db9f6bf485e660a /source/gameengine/Ketsji/KX_KetsjiEngine.cpp | |
parent | 6f7eb623d3beaf7e49b5bb0d7686c2b2c714d867 (diff) |
BGE: added bge.logic.{get,set}AnimRecordFrame functions
By using getAnimRecordFrame(), game developers have access to the frame
number used by the "Record animation" feature. This enables them to
record additional information in Blender's F-Curves and ensuring perfect
synchronization with the information already recorded by Blender.
The setAnimRecordFrame() can be used to change the frame number at which
animations are recorded, for example to introduce delays the recording that
do not require delays in the actual game/simulation run.
The getter/setter functions in KX_KetsjiEngine are not directly named after
property they access (m_currentFrame). I found "current frame" to be too
vague for a public interface, hence chose a more descriptive name.
Reviewers: moguri, hg1, campbellbarton, panzergame, aligorith
Reviewed By: panzergame, aligorith
Differential Revision: https://developer.blender.org/D1449
Diffstat (limited to 'source/gameengine/Ketsji/KX_KetsjiEngine.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index c7cf556a2d3..72c512589a4 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -1750,6 +1750,16 @@ void KX_KetsjiEngine::SetAnimRecordMode(bool animation_record, int startFrame) m_currentFrame = startFrame; } +int KX_KetsjiEngine::getAnimRecordFrame() const +{ + return m_currentFrame; +} + +void KX_KetsjiEngine::setAnimRecordFrame(int framenr) +{ + m_currentFrame = framenr; +} + bool KX_KetsjiEngine::GetUseFixedTime(void) const { return m_bFixedTime; |