Skip to content

Commit

Permalink
OfxImageEffectInstance: fix when a paramEditBegin() has no matching p…
Browse files Browse the repository at this point in the history
…aramEditEnd()

fixes #708
This is really a bug in the Transform interact here: https://github.com/NatronGitHub/openfx-supportext/blob/50bfe420fa6debbc2b7520bb0c4d822fa203a5b7/ofxsTransformInteract.cpp#L1423
where it should be `if (setAll || editBlock) {`
  • Loading branch information
devernay committed Nov 26, 2021
1 parent 268d5e7 commit ebac69b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Engine/OfxImageEffectInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,19 @@ OfxImageEffectInstance::mainEntry(const char *action,
#endif
ThreadIsActionCaller_RAII t(this);

return OFX::Host::ImageEffect::Instance::mainEntry(action, handle, inArgs, outArgs);
OfxStatus retval = OFX::Host::ImageEffect::Instance::mainEntry(action, handle, inArgs, outArgs);

// Maybe paramEditBegin() was called by the effect without a matching paramEditEnd(). Let us fix that.
// See issue https://github.com/NatronGitHub/Natron/issues/708
// test for getMultipleParamsEditLevel() first, because it costs less.
OfxEffectInstancePtr effect = getOfxEffectInstance();

if ((effect->getMultipleParamsEditLevel() != KnobHolder::eMultipleParamsEditOff) && !effect->getApp()->isCreatingPythonGroup() ) {
while (effect->getMultipleParamsEditLevel() != KnobHolder::eMultipleParamsEditOff) {
effect->setMultipleParamsEditLevel(KnobHolder::eMultipleParamsEditOff);
}
}
return retval;
}

OfxStatus
Expand Down

0 comments on commit ebac69b

Please sign in to comment.