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

Method insertKeyFrame

Engine/StringAnimationManager.cpp:190–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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