MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / insertKeyFrame

Method insertKeyFrame

Engine/StringAnimationManager.cpp:191–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189} // customInterpolation
190
191void
192StringAnimationManager::insertKeyFrame(double time,
193 const std::string & v,
194 double* index)
195{
196 StringKeyFrame k;
197
198 k.time = time;
199 k.value = v;
200 QMutexLocker l(&_imp->keyframesMutex);
201 std::pair<Keyframes::iterator, bool> ret = _imp->keyframes.insert(k);
202 if (!ret.second) {
203 _imp->keyframes.erase(ret.first);
204 ret = _imp->keyframes.insert(k);
205 assert(ret.second);
206 }
207 *index = std::distance(_imp->keyframes.begin(), ret.first);
208}
209
210void
211StringAnimationManager::removeKeyFrame(double time)

Callers 1

stringToKeyFrameValueMethod · 0.80

Calls 3

insertMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected