From 7192a717472866578c13064875373b3083cdd361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Fri, 6 Nov 2015 08:30:16 +0100 Subject: [PATCH 1/5] travis: fix build --- tools/travis/install_dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/travis/install_dependencies.sh b/tools/travis/install_dependencies.sh index 7c96cdd521..69a6ae0b43 100755 --- a/tools/travis/install_dependencies.sh +++ b/tools/travis/install_dependencies.sh @@ -75,7 +75,7 @@ if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then # OpenFX if [ "$CC" = "$TEST_CC" ]; then make -C libs/OpenFX/Examples; fi - if [ "$CC" = "$TEST_CC" ]; then make -C libs/OpenFX/Support/Plugins1; fi + if [ "$CC" = "$TEST_CC" ]; then make -C libs/OpenFX/Support/Plugins; fi if [ "$CC" = "$TEST_CC" ]; then make -C libs/OpenFX/Support/PropTester; fi if [ "$CC" = "$TEST_CC" ]; then rm -rf Tests/Plugins; mkdir -p Tests/Plugins/Examples Tests/Plugins/Support Tests/Plugins/IO; fi if [ "$CC" = "$TEST_CC" ]; then mv libs/OpenFX/Examples/*/*-64-debug/*.ofx.bundle Tests/Plugins/Examples; fi From 87c707998e38f78e5b5a6cc5c7544fd160c5ebe9 Mon Sep 17 00:00:00 2001 From: Alexandre Gauthier Date: Fri, 6 Nov 2015 08:58:46 +0100 Subject: [PATCH 2/5] Fix null ptr dereference --- Engine/AppInstance.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Engine/AppInstance.cpp b/Engine/AppInstance.cpp index 2514b15e5a..1cff4354c1 100644 --- a/Engine/AppInstance.cpp +++ b/Engine/AppInstance.cpp @@ -890,13 +890,18 @@ AppInstance::createNodeInternal(const QString & pluginID, if (addToProject) { //Add the node to the project before loading it so it is present when the python script that registers a variable of the name //of the node works - group->addNode(node); + assert(group); + if (group) { + group->addNode(node); + } } assert(node); try { node->load(multiInstanceParentName, serialization,dontLoadName, userEdited, addToProject, fixedName,paramValues); } catch (const std::exception & e) { - group->removeNode(node); + if (group) { + group->removeNode(node); + } std::string title("Error while creating node"); std::string message = title + " " + foundPluginID + ": " + e.what(); qDebug() << message.c_str(); @@ -904,7 +909,9 @@ AppInstance::createNodeInternal(const QString & pluginID, return boost::shared_ptr(); } catch (...) { - group->removeNode(node); + if (group) { + group->removeNode(node); + } std::string title("Error while creating node"); std::string message = title + " " + foundPluginID; qDebug() << message.c_str(); From cc58817c77dc8ea29bbf7df273549c324d91160e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Fri, 6 Nov 2015 09:01:48 +0100 Subject: [PATCH 3/5] travis: use ffmpeg 2.5 --- .travis.yml | 2 +- tools/travis/install_dependencies.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 94639fc807..78bb45cb1a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,7 @@ addons: # ubuntu-toolchain-r/test contains recent versions of gcc - ppa:ubuntu-toolchain-r/test # get a recent ffmpeg (>=2.5) for precise from ppa:archivematica/externals(2.5.1) or ppa:pavlyshko/precise(2.6.1) - - ppa:pavlyshko/precise + - ppa:archivematica/externals packages: - gcc-4.9 - g++-4.9 diff --git a/tools/travis/install_dependencies.sh b/tools/travis/install_dependencies.sh index 69a6ae0b43..82447da5e8 100755 --- a/tools/travis/install_dependencies.sh +++ b/tools/travis/install_dependencies.sh @@ -55,8 +55,8 @@ if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then if [ "$CC" = "$TEST_CC" ]; then sudo add-apt-repository -y ppa:kubuntu-ppa/backports; fi # we also need a recent ffmpeg for the newest version of the plugin #if [ "$CC" = "$TEST_CC" ]; then sudo add-apt-repository -y ppa:jon-severinsson/ffmpeg; fi #not available - #if [ "$CC" = "$TEST_CC" ]; then sudo add-apt-repository -y ppa:archivematica/externals; fi #2.5.1 - if [ "$CC" = "$TEST_CC" ]; then sudo add-apt-repository -y ppa:pavlyshko/precise; fi #2.6.1 + if [ "$CC" = "$TEST_CC" ]; then sudo add-apt-repository -y ppa:archivematica/externals; fi #2.5.1 + #if [ "$CC" = "$TEST_CC" ]; then sudo add-apt-repository -y ppa:pavlyshko/precise; fi #2.6.1 sudo apt-get update sudo apt-get update -qq From c49491e5b9603fcf6099dc0fd3b00a7d452009b1 Mon Sep 17 00:00:00 2001 From: Alexandre Gauthier Date: Fri, 6 Nov 2015 10:16:12 +0100 Subject: [PATCH 4/5] Fix reset of transform center of strokes --- Engine/RotoDrawableItem.cpp | 6 ++--- Engine/RotoStrokeItem.cpp | 45 ++----------------------------------- Gui/RotoGui.cpp | 1 + 3 files changed, 5 insertions(+), 47 deletions(-) diff --git a/Engine/RotoDrawableItem.cpp b/Engine/RotoDrawableItem.cpp index f6e26970b3..4f8e7677bb 100644 --- a/Engine/RotoDrawableItem.cpp +++ b/Engine/RotoDrawableItem.cpp @@ -524,7 +524,7 @@ RotoDrawableItem::rotoKnobChanged(const boost::shared_ptr& knob, Natron:: type = eRotoStrokeTypeSolid; } - if (reason == Natron::eValueChangedReasonSlaveRefresh) { + if (reason == Natron::eValueChangedReasonSlaveRefresh && knob != _imp->center && knob != _imp->cloneCenter) { getContext()->s_breakMultiStroke(); } @@ -853,9 +853,7 @@ RotoDrawableItem::refreshNodesConnections() } } //if (_imp->effectNode && type != eRotoStrokeTypeEraser) - if (connectionChanged) { - getContext()->resetTransformsCenter(type == eRotoStrokeTypeClone || type == eRotoStrokeTypeReveal, true); - } + } void diff --git a/Engine/RotoStrokeItem.cpp b/Engine/RotoStrokeItem.cpp index 0c806b5bb1..37a55c8aa5 100644 --- a/Engine/RotoStrokeItem.cpp +++ b/Engine/RotoStrokeItem.cpp @@ -285,10 +285,6 @@ RotoStrokeItem::isEmpty() const void RotoStrokeItem::setStrokeFinished() { - double time = getContext()->getTimelineCurrentTime(); - bool autoKeying = getContext()->isAutoKeyingEnabled(); - Point center; - bool centerSet = false; { QMutexLocker k(&itemMutex); _imp->finished = true; @@ -300,47 +296,10 @@ RotoStrokeItem::setStrokeFinished() } } _imp->strokeDotPatterns.clear(); - - ///Compute the value of the center knob - center.x = center.y = 0; - - int nbPoints = 0; - for (std::list::const_iterator it = _imp->strokes.begin(); - it!=_imp->strokes.end(); ++it) { - KeyFrameSet xCurve = it->xCurve->getKeyFrames_mt_safe(); - KeyFrameSet yCurve = it->yCurve->getKeyFrames_mt_safe(); - assert(xCurve.size() == yCurve.size()); - - KeyFrameSet::iterator xIt = xCurve.begin(); - KeyFrameSet::iterator yIt = yCurve.begin(); - for (; xIt != xCurve.end(); ++xIt, ++yIt) { - center.x += xIt->getValue(); - center.y += yIt->getValue(); - } - nbPoints += xCurve.size(); - } - - centerSet = nbPoints > 0; - if (centerSet) { - center.x /= (double)nbPoints; - center.y /= (double)nbPoints; - } - } - if (centerSet) { - - - boost::shared_ptr centerKnob = getCenterKnob(); - if (autoKeying) { - centerKnob->setValueAtTime(time, center.x, 0); - centerKnob->setValueAtTime(time, center.y, 1); - setKeyframeOnAllTransformParameters(time); - } else { - centerKnob->setValue(center.x, 0); - centerKnob->setValue(center.y, 1); - } - } + getContext()->resetTransformCenter(); + boost::shared_ptr effectNode = getEffectNode(); boost::shared_ptr mergeNode = getMergeNode(); boost::shared_ptr timeOffsetNode = getTimeOffsetNode(); diff --git a/Gui/RotoGui.cpp b/Gui/RotoGui.cpp index f8dec92f2a..9d29971a63 100644 --- a/Gui/RotoGui.cpp +++ b/Gui/RotoGui.cpp @@ -3263,6 +3263,7 @@ RotoGui::penUp(double /*time*/, if (_imp->state == eEventStateBuildingStroke) { assert(_imp->rotoData->strokeBeingPaint); _imp->context->getNode()->getApp()->setUserIsPainting(boost::shared_ptr()); + assert(_imp->rotoData->strokeBeingPaint->getParentLayer()); _imp->rotoData->strokeBeingPaint->setStrokeFinished(); if (!_imp->multiStrokeEnabled->isChecked()) { pushUndoCommand(new AddStrokeUndoCommand(this,_imp->rotoData->strokeBeingPaint)); From 12a1a2973d77fff7274bbef46c75ff16f66661df Mon Sep 17 00:00:00 2001 From: Alexandre Gauthier Date: Fri, 6 Nov 2015 10:54:31 +0100 Subject: [PATCH 5/5] Bug fix: Set default coordinates system for kOfxParamDoubleTypeNormalisedXY and kOfxParamDoubleTypeNormalisedXYAbsolute to kOfxParamCoordinatesNormalised otherwise their default value will get normalised twice when reseting to default --- Engine/OfxParamInstance.cpp | 5 +++-- Gui/KnobGuiDouble.cpp | 22 ---------------------- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/Engine/OfxParamInstance.cpp b/Engine/OfxParamInstance.cpp index 00c88bd751..c911f76be9 100644 --- a/Engine/OfxParamInstance.cpp +++ b/Engine/OfxParamInstance.cpp @@ -1664,7 +1664,6 @@ OfxDouble2DInstance::OfxDouble2DInstance(OfxEffectInstance* node, // Only create native overlays if there is no interact or kOfxParamPropUseHostOverlayHandle is set // see https://github.com/MrKepzie/Natron/issues/932 // only create automatic overlay for kOfxParamDoubleTypeXYAbsolute and kOfxParamDoubleTypeNormalisedXYAbsolute -#pragma message WARN("TODO: check that kOfxParamDoubleTypeNormalisedXYAbsolute overlays are OK") if ((!_node->effectInstance()->getOverlayInteractMainEntry() && (getDoubleType() == kOfxParamDoubleTypeXYAbsolute || getDoubleType() == kOfxParamDoubleTypeNormalisedXYAbsolute)) || @@ -1681,7 +1680,9 @@ OfxDouble2DInstance::OfxDouble2DInstance(OfxEffectInstance* node, dblKnob->setValueIsNormalized(0, KnobDouble::eValueIsNormalizedX); dblKnob->setValueIsNormalized(1, KnobDouble::eValueIsNormalizedY); } - dblKnob->setDefaultValuesAreNormalized(coordSystem == kOfxParamCoordinatesNormalised); + dblKnob->setDefaultValuesAreNormalized(coordSystem == kOfxParamCoordinatesNormalised || + doubleType == kOfxParamDoubleTypeNormalisedXY || + doubleType == kOfxParamDoubleTypeNormalisedXYAbsolute); for (int i = 0; i < dims; ++i) { dblKnob->setDefaultValue(def[i], i); } diff --git a/Gui/KnobGuiDouble.cpp b/Gui/KnobGuiDouble.cpp index 5f5b32ab1a..f3e3ff99b3 100644 --- a/Gui/KnobGuiDouble.cpp +++ b/Gui/KnobGuiDouble.cpp @@ -109,8 +109,6 @@ KnobGuiDouble::valueAccordingToType(bool normalize, } KnobDouble::ValueIsNormalizedEnum state = _knob.lock()->getValueIsNormalized(dimension); -#if 1 -#pragma message WARN("Alex please check that the following is right") boost::shared_ptr knob = _knob.lock(); SequenceTime time = knob->getHolder()->getApp()->getTimeLine()->currentFrame(); if (state != KnobDouble::eValueIsNormalizedNone) { @@ -120,26 +118,6 @@ KnobGuiDouble::valueAccordingToType(bool normalize, knob->denormalize(dimension, time, value); } } -#else - // this code is duplicated from KnobDouble::normalize and KnobDouble::denormalize - if (state == KnobDouble::eValueIsNormalizedX) { - Format f; - getKnob()->getHolder()->getApp()->getProject()->getProjectDefaultFormat(&f); - if (normalize) { - *value /= f.width(); - } else { - *value *= f.width(); - } - } else if (state == KnobDouble::eValueIsNormalizedY) { - Format f; - getKnob()->getHolder()->getApp()->getProject()->getProjectDefaultFormat(&f); - if (normalize) { - *value /= f.height(); - } else { - *value *= f.height(); - } - } -#endif } bool