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

Method cloneExpressionsAndCheckIfChanged

Engine/Knob.cpp:4090–4117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4088}
4089
4090bool
4091KnobHelper::cloneExpressionsAndCheckIfChanged(KnobI* other,
4092 int dimension,
4093 int otherDimension)
4094{
4095 assert( (int)_imp->expressions.size() == getDimension() );
4096 assert( (dimension == otherDimension) || (dimension != -1) );
4097 assert(other);
4098 bool ret = false;
4099 try {
4100 int dims = std::min( getDimension(), other->getDimension() );
4101 for (int i = 0; i < dims; ++i) {
4102 if ( (i == dimension) || (dimension == -1) ) {
4103 std::string expr = other->getExpression(i);
4104 bool hasRet = other->isExpressionUsingRetVariable(i);
4105 if ( !expr.empty() && ( (expr != _imp->expressions[i].originalExpression) || (hasRet != _imp->expressions[i].hasRet) ) ) {
4106 setExpression(i, expr, hasRet, false);
4107 cloneExpressionsResults(other, i, otherDimension);
4108 ret = true;
4109 }
4110 }
4111 }
4112 } catch (...) {
4113 ///ignore errors
4114 }
4115
4116 return ret;
4117}
4118
4119void
4120KnobHelper::cloneOneCurve(KnobI* other,

Callers

nothing calls this directly

Calls 6

getDimensionFunction · 0.85
emptyMethod · 0.80
sizeMethod · 0.45
getDimensionMethod · 0.45
getExpressionMethod · 0.45

Tested by

no test coverage detected