Skip to content

Commit

Permalink
SeNoise: only set centerChanged if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
devernay committed Aug 13, 2024
1 parent f547e5f commit 5cb0a06
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions SeExpr/SeNoise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1212,17 +1212,23 @@ SeNoisePlugin::changedParam(const InstanceChangedArgs& args,
_rampInteractive->setIsSecretAndDisabled(noramp);
} else if (paramName == kParamTransformResetCenter) {
resetCenter(args.time);
_centerChanged->setValue(false);
// Only set if necessary
if (_centerChanged->getValue()) {
_centerChanged->setValue(false);
}
} else if ((paramName == kParamTransformCenter) && ((args.reason == eChangeUserEdit) || (args.reason == eChangePluginEdit))) {
_centerChanged->setValue(true);
// Only set if necessary
if (!_centerChanged->getValue()) {
_centerChanged->setValue(true);
}
}
}

void
SeNoisePlugin::changedClip(const InstanceChangedArgs& args,
const std::string& clipName)
{
if ((clipName == kOfxImageEffectSimpleSourceClipName) && _srcClip && _srcClip->isConnected() && !_centerChanged->getValueAtTime(args.time) && (args.reason == eChangeUserEdit)) {
if ((clipName == kOfxImageEffectSimpleSourceClipName) && _srcClip && _srcClip->isConnected() && !_centerChanged->getValue() && (args.reason == eChangeUserEdit)) {
resetCenter(args.time);
}
}
Expand Down

0 comments on commit 5cb0a06

Please sign in to comment.