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

Method removeAnimationWithReason

Engine/Knob.cpp:1523–1581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1521} // KnobHelper::moveDerivativeAtTime
1522
1523void
1524KnobHelper::removeAnimationWithReason(ViewSpec view,
1525 int dimension,
1526 ValueChangedReasonEnum reason)
1527{
1528 assert(0 <= dimension);
1529 if ( (dimension < 0) || ( (int)_imp->curves.size() <= dimension ) ) {
1530 throw std::invalid_argument("KnobHelper::removeAnimationWithReason(): Dimension out of range");
1531 }
1532
1533
1534 if ( !canAnimate() || !isAnimated(dimension, view) ) {
1535 return;
1536 }
1537
1538 CurvePtr curve;
1539 KnobGuiIPtr hasGui = getKnobGuiPointer();
1540 bool useGuiCurve = _imp->shouldUseGuiCurve();
1541
1542 if (!useGuiCurve) {
1543 curve = _imp->curves[dimension];
1544 } else {
1545 assert(hasGui);
1546 curve = hasGui->getCurve(view, dimension);
1547 setGuiCurveHasChanged(view, dimension, true);
1548 }
1549
1550 if ( _signalSlotHandler && (reason != eValueChangedReasonUserEdited) ) {
1551 _signalSlotHandler->s_animationAboutToBeRemoved(view, dimension);
1552 }
1553
1554 copyValuesFromCurve(dimension);
1555
1556 assert(curve);
1557 if (curve) {
1558 curve->clearKeyFrames();
1559 }
1560
1561 if ( _signalSlotHandler && (reason != eValueChangedReasonUserEdited) ) {
1562 _signalSlotHandler->s_animationRemoved(view, dimension);
1563 }
1564
1565 animationRemoved_virtual(dimension);
1566
1567 if (_imp->holder) {
1568 _imp->holder->updateHasAnimation();
1569 }
1570
1571
1572 if (!useGuiCurve) {
1573 //virtual portion
1574 evaluateValueChange(dimension, getCurrentTime(), view, reason);
1575 guiCurveCloneInternalCurve(eCurveChangeReasonInternal, view, dimension, reason);
1576 } else {
1577 if (_signalSlotHandler) {
1578 _signalSlotHandler->s_redrawGuiCurve(eCurveChangeReasonInternal, view, dimension);
1579 }
1580 }

Callers

nothing calls this directly

Calls 6

getCurrentTimeFunction · 0.85
shouldUseGuiCurveMethod · 0.80
updateHasAnimationMethod · 0.80
sizeMethod · 0.45
getCurveMethod · 0.45
clearKeyFramesMethod · 0.45

Tested by

no test coverage detected