diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 2a979933c0..ebe3ace77c 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -6,7 +6,7 @@ Version 2.0: Frédéric Devernay Alexandre Gauthier-Foichat Ole-André Rodlie (Openfx-Arena Plug-Ins) -Axel Airo-Farulla +Axel Airo-Farulla #Artists: diff --git a/Documentation/source/PythonReference/NatronEngine/App.rst b/Documentation/source/PythonReference/NatronEngine/App.rst index e4286b2245..9c46bcdf22 100644 --- a/Documentation/source/PythonReference/NatronEngine/App.rst +++ b/Documentation/source/PythonReference/NatronEngine/App.rst @@ -16,7 +16,7 @@ See :ref:`detailed` description... Functions ^^^^^^^^^ - +* def :meth:`addProjectLayer` (layer) * def :meth:`addFormat` (formatSpec) * def :meth:`createNode` (pluginID[, majorVersion=-1[, group=None]]) * def :meth:`createReader` (filename[, group=None]) @@ -132,6 +132,16 @@ You can get a specific :doc:`parameter` of the project settings with the Member functions description ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.. method:: NatronEngine.App.addProjectLayer(layer) + + :param layer: :class:`ImageLayer` + +Appends a new project-wide layer. It will be available to all layer menus of all nodes. +Each layer menu must be refreshed individually with either a right click on the menu or +by changing nodes connections to get access to the new layer. Layer names are unique: +even if you add duplicates to the layers list, only the first one in the list with that name +will be available in the menus. + .. method:: NatronEngine.App.addFormat(formatSpec) :param formatSpec: :class:`str` diff --git a/Engine/AppInstance.cpp b/Engine/AppInstance.cpp index 9fb45dd46c..64481edc4c 100644 --- a/Engine/AppInstance.cpp +++ b/Engine/AppInstance.cpp @@ -124,6 +124,9 @@ struct AppInstancePrivate mutable QMutex renderQueueMutex; std::list renderQueue, activeRenders; + mutable QMutex invalidExprKnobsMutex; + std::list invalidExprKnobs; + AppInstancePrivate(int appID, AppInstance* app) : _publicInterface(app) @@ -136,6 +139,9 @@ struct AppInstancePrivate , _creatingTree(0) , renderQueueMutex() , renderQueue() + , activeRenders() + , invalidExprKnobsMutex() + , invalidExprKnobs() { } @@ -739,7 +745,7 @@ AppInstance::loadPythonScript(const QFileInfo& file) if (errCatcher) { errorObj = PyObject_GetAttrString(errCatcher,"value"); //get the stderr from our catchErr object, new ref assert(errorObj); - error = NATRON_PYTHON_NAMESPACE::PY3String_asString(errorObj); + error = NATRON_PYTHON_NAMESPACE::PyString_asString(errorObj); PyObject* unicode = PyUnicode_FromString(""); PyObject_SetAttrString(errCatcher, "value", unicode); Py_DECREF(errorObj); @@ -842,7 +848,11 @@ AppInstance::createNodeFromPythonModule(Plugin* plugin, if (!moduleName.isEmpty()) { setGroupLabelIDAndVersion(node,modulePath, moduleName); } - + + // If there's a serialization, restore the serialization of the group node because the Python script probably overriden any state + if (serialization) { + containerNode->loadKnobs(*serialization); + } } //FlagSetter fs(true,&_imp->_creatingGroup,&_imp->creatingGroupMutex); @@ -890,7 +900,7 @@ AppInstance::createReader(const std::string& filename, CreateNodeReason reason, #else std::map readersForFormat; - appPTR->getCurrentSettings()->getFileFormatsForWritingAndWriter(&readersForFormat); + appPTR->getCurrentSettings()->getFileFormatsForReadingAndReader(&readersForFormat); QString fileCpy = QString::fromUtf8(filename.c_str()); std::string ext = QtCompat::removeFileExtension(fileCpy).toLower().toStdString(); std::map::iterator found = readersForFormat.find(ext); @@ -1905,6 +1915,55 @@ AppInstance::newProject() return app; } +void +AppInstance::addInvalidExpressionKnob(const KnobPtr& knob) +{ + QMutexLocker k(&_imp->invalidExprKnobsMutex); + for (std::list::iterator it = _imp->invalidExprKnobs.begin(); it!=_imp->invalidExprKnobs.end(); ++it) { + if (it->lock().get()) { + return; + } + } + _imp->invalidExprKnobs.push_back(knob); +} + +void +AppInstance::removeInvalidExpressionKnob(const KnobI* knob) +{ + QMutexLocker k(&_imp->invalidExprKnobsMutex); + for (std::list::iterator it = _imp->invalidExprKnobs.begin(); it!=_imp->invalidExprKnobs.end(); ++it) { + if (it->lock().get() == knob) { + _imp->invalidExprKnobs.erase(it); + break; + } + } +} + +void +AppInstance::recheckInvalidExpressions() +{ + std::list knobs; + { + QMutexLocker k(&_imp->invalidExprKnobsMutex); + for (std::list::iterator it = _imp->invalidExprKnobs.begin(); it!=_imp->invalidExprKnobs.end(); ++it) { + KnobPtr k = it->lock(); + if (k) { + knobs.push_back(k); + } + } + } + std::list newInvalidKnobs; + for (std::list::iterator it = knobs.begin(); it!=knobs.end(); ++it) { + if (!(*it)->checkInvalidExpressions()) { + newInvalidKnobs.push_back(*it); + } + } + { + QMutexLocker k(&_imp->invalidExprKnobsMutex); + _imp->invalidExprKnobs = newInvalidKnobs; + } +} + NATRON_NAMESPACE_EXIT; NATRON_NAMESPACE_USING; diff --git a/Engine/AppInstance.h b/Engine/AppInstance.h index b2bcb30e9d..7b5e58f493 100644 --- a/Engine/AppInstance.h +++ b/Engine/AppInstance.h @@ -336,6 +336,10 @@ class AppInstance public: + void addInvalidExpressionKnob(const KnobPtr& knob); + void removeInvalidExpressionKnob(const KnobI* knob); + void recheckInvalidExpressions(); + virtual void clearViewersLastRenderedTexture() {} virtual void toggleAutoHideGraphInputs() {} @@ -439,6 +443,8 @@ class AppInstance void removeRenderFromQueue(OutputEffectInstance* writer); + virtual void reloadScriptEditorFonts() {} + public Q_SLOTS: void quit(); diff --git a/Engine/AppManager.cpp b/Engine/AppManager.cpp index 7eb482fa06..6a69b5f51d 100644 --- a/Engine/AppManager.cpp +++ b/Engine/AppManager.cpp @@ -1170,7 +1170,7 @@ static bool findAndRunScriptFile(const QString& path,const QStringList& files,co if (errCatcher) { errorObj = PyObject_GetAttrString(errCatcher,"value"); //get the stderr from our catchErr object, new ref assert(errorObj); - error = NATRON_PYTHON_NAMESPACE::PY3String_asString(errorObj); + error = NATRON_PYTHON_NAMESPACE::PyString_asString(errorObj); PyObject* unicode = PyUnicode_FromString(""); PyObject_SetAttrString(errCatcher, "value", unicode); Py_DECREF(errorObj); @@ -2460,15 +2460,28 @@ char2wchar(char* arg) std::string -NATRON_PYTHON_NAMESPACE::PY3String_asString(PyObject* obj) +NATRON_PYTHON_NAMESPACE::PyString_asString(PyObject* obj) { + std::string ret; - if (PyUnicode_Check(obj)) { - PyObject * temp_bytes = PyUnicode_AsEncodedString(obj, "ASCII", "strict"); // Owned reference - if (temp_bytes != NULL) { - char* cstr = PyBytes_AS_STRING(temp_bytes); // Borrowed pointer + + if (PyString_Check(obj)) { + char* buf = PyString_AsString(obj); + if (buf) { + ret += std::string(buf); + } + } else if (PyUnicode_Check(obj)) { + /*PyObject * temp_bytes = PyUnicode_AsEncodedString(obj, "ASCII", "strict"); // Owned reference + if (temp_bytes != NULL) { + char* cstr = PyBytes_AS_STRING(temp_bytes); // Borrowed pointer + ret.append(cstr); + Py_DECREF(temp_bytes); + }*/ + PyObject* utf8pyobj = PyUnicode_AsUTF8String(obj); // newRef + if (utf8pyobj) { + char* cstr = PyBytes_AS_STRING(utf8pyobj); // Borrowed pointer ret.append(cstr); - Py_DECREF(temp_bytes); + Py_DECREF(utf8pyobj); } } else if (PyBytes_Check(obj)) { char* cstr = PyBytes_AS_STRING(obj); // Borrowed pointer @@ -3106,7 +3119,7 @@ NATRON_PYTHON_NAMESPACE::interpretPythonScript(const std::string& script,std::st if (errCatcher && error) { errorObj = PyObject_GetAttrString(errCatcher,"value"); //get the stderr from our catchErr object, new ref assert(errorObj); - *error = PY3String_asString(errorObj); + *error = PyString_asString(errorObj); PyObject* unicode = PyUnicode_FromString(""); PyObject_SetAttrString(errCatcher, "value", unicode); Py_DECREF(errorObj); @@ -3116,7 +3129,7 @@ NATRON_PYTHON_NAMESPACE::interpretPythonScript(const std::string& script,std::st if (outCatcher && output) { outObj = PyObject_GetAttrString(outCatcher,"value"); //get the stdout from our catchOut object, new ref assert(outObj); - *output = PY3String_asString(outObj); + *output = PyString_asString(outObj); PyObject* unicode = PyUnicode_FromString(""); PyObject_SetAttrString(outCatcher, "value", unicode); Py_DECREF(outObj); @@ -3156,9 +3169,7 @@ NATRON_PYTHON_NAMESPACE::compilePyScript(const std::string& script,PyObject** co } #endif - -std::string -NATRON_PYTHON_NAMESPACE::makeNameScriptFriendly(const std::string& str) +static std::string makeNameScriptFriendlyInternal(const std::string& str, bool allowDots) { if (str == "from") { return "pFrom"; @@ -3183,13 +3194,25 @@ NATRON_PYTHON_NAMESPACE::makeNameScriptFriendly(const std::string& str) } ///Non alpha-numeric characters are not allowed in python - else if (str[i] == '_' || std::isalnum(str[i], loc)) { + else if (str[i] == '_' || std::isalnum(str[i], loc) || (allowDots && str[i] == '.')) { cpy.push_back(str[i]); } } return cpy; } +std::string +NATRON_PYTHON_NAMESPACE::makeNameScriptFriendlyWithDots(const std::string& str) +{ + return makeNameScriptFriendlyInternal(str, true); +} + +std::string +NATRON_PYTHON_NAMESPACE::makeNameScriptFriendly(const std::string& str) +{ + return makeNameScriptFriendlyInternal(str, false); +} + PythonGILLocker::PythonGILLocker() // : state(PyGILState_UNLOCKED) { @@ -3317,17 +3340,17 @@ static bool getGroupInfosInternal(const std::string& modulePath, assert(labelObj); - *pluginLabel = NATRON_PYTHON_NAMESPACE::PY3String_asString(labelObj); + *pluginLabel = NATRON_PYTHON_NAMESPACE::PyString_asString(labelObj); Py_XDECREF(labelObj); if (idObj) { - *pluginID = NATRON_PYTHON_NAMESPACE::PY3String_asString(idObj); + *pluginID = NATRON_PYTHON_NAMESPACE::PyString_asString(idObj); deleteScript.append("del pluginID\n"); Py_XDECREF(idObj); } if (iconObj) { - *iconFilePath = NATRON_PYTHON_NAMESPACE::PY3String_asString(iconObj); + *iconFilePath = NATRON_PYTHON_NAMESPACE::PyString_asString(iconObj); QFileInfo iconInfo(QString::fromUtf8(modulePath.c_str()) + QString::fromUtf8(iconFilePath->c_str())); *iconFilePath = iconInfo.canonicalFilePath().toStdString(); @@ -3335,7 +3358,7 @@ static bool getGroupInfosInternal(const std::string& modulePath, Py_XDECREF(iconObj); } if (iconGrouping) { - *grouping = NATRON_PYTHON_NAMESPACE::PY3String_asString(iconGrouping); + *grouping = NATRON_PYTHON_NAMESPACE::PyString_asString(iconGrouping); deleteScript.append("del templateGrouping\n"); Py_XDECREF(iconGrouping); } @@ -3354,7 +3377,7 @@ static bool getGroupInfosInternal(const std::string& modulePath, if (pluginDescriptionObj) { - *description = NATRON_PYTHON_NAMESPACE::PY3String_asString(pluginDescriptionObj); + *description = NATRON_PYTHON_NAMESPACE::PyString_asString(pluginDescriptionObj); deleteScript.append("del description\n"); Py_XDECREF(pluginDescriptionObj); } @@ -3476,7 +3499,7 @@ NATRON_PYTHON_NAMESPACE::getFunctionArguments(const std::string& pyFunc,std::str PyObject* itemObj = PyList_GetItem(argListObj, i); assert(itemObj); if (itemObj) { - std::string itemName = PY3String_asString(itemObj); + std::string itemName = PyString_asString(itemObj); assert(!itemName.empty()); if (!itemName.empty()) { args->push_back(itemName); diff --git a/Engine/AppManager.h b/Engine/AppManager.h index 23a3f2a2ea..3c8d868841 100644 --- a/Engine/AppManager.h +++ b/Engine/AppManager.h @@ -520,6 +520,7 @@ class AppManager bool isSpawnedFromCrashReporter() const; + virtual void reloadScriptEditorFonts() {} public Q_SLOTS: @@ -686,7 +687,9 @@ bool interpretPythonScript(const std::string& script, std::string* error, std::s //void compilePyScript(const std::string& script,PyObject** code); -std::string PY3String_asString(PyObject* obj); +std::string PyString_asString(PyObject* obj); + +std::string makeNameScriptFriendlyWithDots(const std::string& str); std::string makeNameScriptFriendly(const std::string& str); diff --git a/Engine/Bezier.cpp b/Engine/Bezier.cpp index 21ac4262e8..ed667f76f3 100644 --- a/Engine/Bezier.cpp +++ b/Engine/Bezier.cpp @@ -2072,13 +2072,13 @@ Bezier::setKeyframe(double time) double x, y; double leftDerivX, rightDerivX, leftDerivY, rightDerivY; - (*it)->getPositionAtTime(true, time, ViewIdx(0), &x, &y, true); - (*it)->setPositionAtTime(true, time, x, y); + (*it)->getPositionAtTime(false, time, ViewIdx(0), &x, &y, true); + (*it)->setPositionAtTime(false, time, x, y); - (*it)->getLeftBezierPointAtTime(true, time, ViewIdx(0),&leftDerivX, &leftDerivY, true); - (*it)->getRightBezierPointAtTime(true, time, ViewIdx(0),&rightDerivX, &rightDerivY, true); - (*it)->setLeftBezierPointAtTime(true, time, leftDerivX, leftDerivY); - (*it)->setRightBezierPointAtTime(true, time, rightDerivX, rightDerivY); + (*it)->getLeftBezierPointAtTime(false, time, ViewIdx(0),&leftDerivX, &leftDerivY, true); + (*it)->getRightBezierPointAtTime(false, time, ViewIdx(0),&rightDerivX, &rightDerivY, true); + (*it)->setLeftBezierPointAtTime(false, time, leftDerivX, leftDerivY); + (*it)->setRightBezierPointAtTime(false, time, rightDerivX, rightDerivY); } if (useFeather) { @@ -2086,17 +2086,17 @@ Bezier::setKeyframe(double time) double x, y; double leftDerivX, rightDerivX, leftDerivY, rightDerivY; - (*it)->getPositionAtTime(true, time, ViewIdx(0),&x, &y, true); - (*it)->setPositionAtTime(true, time, x, y); + (*it)->getPositionAtTime(false, time, ViewIdx(0),&x, &y, true); + (*it)->setPositionAtTime(false, time, x, y); - (*it)->getLeftBezierPointAtTime(true, time, ViewIdx(0),&leftDerivX, &leftDerivY, true); - (*it)->getRightBezierPointAtTime(true, time, ViewIdx(0),&rightDerivX, &rightDerivY, true); - (*it)->setLeftBezierPointAtTime(true, time, leftDerivX, leftDerivY); - (*it)->setRightBezierPointAtTime(true, time, rightDerivX, rightDerivY); + (*it)->getLeftBezierPointAtTime(false, time, ViewIdx(0),&leftDerivX, &leftDerivY, true); + (*it)->getRightBezierPointAtTime(false, time, ViewIdx(0),&rightDerivX, &rightDerivY, true); + (*it)->setLeftBezierPointAtTime(false, time, leftDerivX, leftDerivY); + (*it)->setRightBezierPointAtTime(false, time, rightDerivX, rightDerivY); } } } - _imp->setMustCopyGuiBezier(true); + // _imp->setMustCopyGuiBezier(true); Q_EMIT keyframeSet(time); } diff --git a/Engine/BezierCP.cpp b/Engine/BezierCP.cpp index 57f24bb019..3607089a62 100644 --- a/Engine/BezierCP.cpp +++ b/Engine/BezierCP.cpp @@ -132,18 +132,18 @@ BezierCP::setPositionAtTime(bool useGuiCurves, k.setInterpolation(eKeyframeTypeLinear); if (!useGuiCurves) { _imp->curveX->addKeyFrame(k); - } else { - _imp->guiCurveX->addKeyFrame(k); } + _imp->guiCurveX->addKeyFrame(k); + } { KeyFrame k(time,y); k.setInterpolation(eKeyframeTypeLinear); if (!useGuiCurves) { _imp->curveY->addKeyFrame(k); - } else { - _imp->guiCurveY->addKeyFrame(k); } + _imp->guiCurveY->addKeyFrame(k); + } } @@ -156,10 +156,10 @@ BezierCP::setStaticPosition(bool useGuiCurves, if (!useGuiCurves) { _imp->x = x; _imp->y = y; - } else { - _imp->guiX = x; - _imp->guiY = y; } + _imp->guiX = x; + _imp->guiY = y; + } void @@ -171,10 +171,10 @@ BezierCP::setLeftBezierStaticPosition(bool useGuiCurves, if (!useGuiCurves) { _imp->leftX = x; _imp->leftY = y; - } else { - _imp->guiLeftX = x; - _imp->guiLeftY = y; } + _imp->guiLeftX = x; + _imp->guiLeftY = y; + } void @@ -186,10 +186,10 @@ BezierCP::setRightBezierStaticPosition(bool useGuiCurves, if (!useGuiCurves) { _imp->rightX = x; _imp->rightY = y; - } else { - _imp->guiRightX = x; - _imp->guiRightY = y; } + _imp->guiRightX = x; + _imp->guiRightY = y; + } bool @@ -351,18 +351,18 @@ BezierCP::setRightBezierPointAtTime(bool useGuiCurves, k.setInterpolation(eKeyframeTypeLinear); if (!useGuiCurves) { _imp->curveRightBezierX->addKeyFrame(k); - } else { - _imp->guiCurveRightBezierX->addKeyFrame(k); } + _imp->guiCurveRightBezierX->addKeyFrame(k); + } { KeyFrame k(time,y); k.setInterpolation(eKeyframeTypeLinear); if (!useGuiCurves) { _imp->curveRightBezierY->addKeyFrame(k); - } else { - _imp->guiCurveRightBezierY->addKeyFrame(k); } + _imp->guiCurveRightBezierY->addKeyFrame(k); + } } @@ -380,15 +380,15 @@ BezierCP::removeAnimation(bool useGuiCurves,double currentTime) _imp->leftY = _imp->curveLeftBezierY->getValueAt(currentTime); _imp->rightX = _imp->curveRightBezierX->getValueAt(currentTime); _imp->rightY = _imp->curveRightBezierY->getValueAt(currentTime); - } else { - _imp->guiX = _imp->guiCurveX->getValueAt(currentTime); - _imp->guiY = _imp->guiCurveY->getValueAt(currentTime); - _imp->guiLeftX = _imp->guiCurveLeftBezierX->getValueAt(currentTime); - _imp->guiLeftY = _imp->guiCurveLeftBezierY->getValueAt(currentTime); - _imp->guiRightX = _imp->guiCurveRightBezierX->getValueAt(currentTime); - _imp->guiRightY = _imp->guiCurveRightBezierY->getValueAt(currentTime); - } + _imp->guiX = _imp->guiCurveX->getValueAt(currentTime); + _imp->guiY = _imp->guiCurveY->getValueAt(currentTime); + _imp->guiLeftX = _imp->guiCurveLeftBezierX->getValueAt(currentTime); + _imp->guiLeftY = _imp->guiCurveLeftBezierY->getValueAt(currentTime); + _imp->guiRightX = _imp->guiCurveRightBezierX->getValueAt(currentTime); + _imp->guiRightY = _imp->guiCurveRightBezierY->getValueAt(currentTime); + + } catch (const std::exception & e) { // } @@ -426,14 +426,14 @@ BezierCP::removeKeyframe(bool useGuiCurves,double time) _imp->leftY = _imp->curveLeftBezierY->getValueAt(time); _imp->rightX = _imp->curveRightBezierX->getValueAt(time); _imp->rightY = _imp->curveRightBezierY->getValueAt(time); - } else { - _imp->guiX = _imp->guiCurveX->getValueAt(time); - _imp->guiY = _imp->guiCurveY->getValueAt(time); - _imp->guiLeftX = _imp->guiCurveLeftBezierX->getValueAt(time); - _imp->guiLeftY = _imp->guiCurveLeftBezierY->getValueAt(time); - _imp->guiRightX = _imp->guiCurveRightBezierX->getValueAt(time); - _imp->guiRightY = _imp->guiCurveRightBezierY->getValueAt(time); } + _imp->guiX = _imp->guiCurveX->getValueAt(time); + _imp->guiY = _imp->guiCurveY->getValueAt(time); + _imp->guiLeftX = _imp->guiCurveLeftBezierX->getValueAt(time); + _imp->guiLeftY = _imp->guiCurveLeftBezierY->getValueAt(time); + _imp->guiRightX = _imp->guiCurveRightBezierX->getValueAt(time); + _imp->guiRightY = _imp->guiCurveRightBezierY->getValueAt(time); + } try { @@ -444,14 +444,14 @@ BezierCP::removeKeyframe(bool useGuiCurves,double time) _imp->curveRightBezierX->removeKeyFrameWithTime(time); _imp->curveLeftBezierY->removeKeyFrameWithTime(time); _imp->curveRightBezierY->removeKeyFrameWithTime(time); - } else { - _imp->guiCurveX->removeKeyFrameWithTime(time); - _imp->guiCurveY->removeKeyFrameWithTime(time); - _imp->guiCurveLeftBezierX->removeKeyFrameWithTime(time); - _imp->guiCurveRightBezierX->removeKeyFrameWithTime(time); - _imp->guiCurveLeftBezierY->removeKeyFrameWithTime(time); - _imp->guiCurveRightBezierY->removeKeyFrameWithTime(time); } + _imp->guiCurveX->removeKeyFrameWithTime(time); + _imp->guiCurveY->removeKeyFrameWithTime(time); + _imp->guiCurveLeftBezierX->removeKeyFrameWithTime(time); + _imp->guiCurveRightBezierX->removeKeyFrameWithTime(time); + _imp->guiCurveLeftBezierY->removeKeyFrameWithTime(time); + _imp->guiCurveRightBezierY->removeKeyFrameWithTime(time); + } catch (...) { } } diff --git a/Engine/EffectInstance.cpp b/Engine/EffectInstance.cpp index 468514b273..f06579de52 100644 --- a/Engine/EffectInstance.cpp +++ b/Engine/EffectInstance.cpp @@ -102,7 +102,7 @@ EffectInstance::EffectInstance(NodePtr node) EffectInstance::~EffectInstance() { - clearPluginMemoryChunks(); + } @@ -411,7 +411,9 @@ EffectInstance::aborted() const const boost::shared_ptr & args = tls->frameArgs.back(); isRenderUserInteraction = args->isRenderResponseToUserInteraction; abortInfo = args->abortInfo; - treeRoot = args->treeRoot->getEffectInstance(); + if (args->treeRoot) { + treeRoot = args->treeRoot->getEffectInstance(); + } #ifdef QT_CUSTOM_THREADPOOL if (isAbortableThread) { @@ -981,21 +983,7 @@ EffectInstance::getImage(int inputNb, * instantaneous thanks to the image cache. */ -#ifdef DEBUG - ///Check that the rendered image contains what we requested. - if ((!isMask && inputImg->getComponents() != components) || (isMask && inputImg->getComponents() != maskComps)) { - ImageComponents cc; - if (isMask) { - cc = maskComps; - } else { - cc = components; - } - qDebug() << "WARNING:"<< getNode()->getScriptName_mt_safe().c_str() << "requested" << cc.getComponentsGlobalName().c_str() << "but" << inputEffect->getScriptName_mt_safe().c_str() << "returned an image with" - << inputImg->getComponents().getComponentsGlobalName().c_str(); - qDebug() << inputEffect->getScriptName_mt_safe().c_str() << "output clip preference is" << inputEffect->getComponents(-1).getComponentsGlobalName().c_str(); - } -#endif if (roiPixel) { *roiPixel = pixelRoI; @@ -1044,6 +1032,22 @@ EffectInstance::getImage(int inputNb, inputImg = convertPlanesFormatsIfNeeded(getApp(), inputImg, pixelRoI, clipPrefComps, depth, getNode()->usesAlpha0ToConvertFromRGBToRGBA(), outputPremult, channelForMask); } +#ifdef DEBUG + ///Check that the rendered image contains what we requested. + if (!mapToClipPrefs && ((!isMask && inputImg->getComponents() != components) || (isMask && inputImg->getComponents() != maskComps))) { + ImageComponents cc; + if (isMask) { + cc = maskComps; + } else { + cc = components; + } + qDebug() << "WARNING:"<< getNode()->getScriptName_mt_safe().c_str() << "requested" << cc.getComponentsGlobalName().c_str() << "but" << inputEffect->getScriptName_mt_safe().c_str() << "returned an image with" + << inputImg->getComponents().getComponentsGlobalName().c_str(); + qDebug() << inputEffect->getScriptName_mt_safe().c_str() << "output clip preference is" << inputEffect->getComponents(-1).getComponentsGlobalName().c_str(); + } + +#endif + if (inputImagesThreadLocal.empty()) { ///If the effect is analysis (e.g: Tracker) there's no input images in the tread local storage, hence add it tls->currentRenderArgs.inputImages[inputNb].push_back(inputImg); @@ -2489,7 +2493,7 @@ EffectInstance::Implementation::renderHandler(const EffectDataTLSPtr& tls, it->second.tmpImage->getPremultiplication(), it->second.tmpImage->getFieldingOrder(), false)); - it->second.tmpImage->upscaleMipMap(downscaledRectToRender, originalInputImage->getMipMapLevel(), 0, tmp.get()); + originalInputImage->upscaleMipMap(downscaledRectToRender, originalInputImage->getMipMapLevel(), 0, tmp.get()); mappedOriginalInputImage = tmp; } } @@ -2922,8 +2926,8 @@ EffectInstance::onAllKnobsSlaved(bool isSlave, } void -EffectInstance::onKnobSlaved(KnobI* slave, - KnobI* master, +EffectInstance::onKnobSlaved(const KnobPtr& slave, + const KnobPtr& master, int dimension, bool isSlave) { @@ -3707,6 +3711,11 @@ EffectInstance::getComponentsAvailableRecursive(bool useLayerChoice, if (!processAll) { std::list userComps; node->getUserCreatedComponents(&userComps); + + ///Add to the user comps the project components + std::vector projectLayers = getApp()->getProject()->getProjectDefaultLayers(); + userComps.insert(userComps.end(), projectLayers.begin(), projectLayers.end()); + ///Foreach user component, add it as an available component, but use this node only if it is also ///in the "needed components" list for (std::list::iterator it = userComps.begin(); it != userComps.end(); ++it) { @@ -3875,7 +3884,7 @@ EffectInstance::getComponentsNeededAndProduced_public(bool useLayerChoice, *passThroughView = view; int idx = getNode()->getPreferredInput(); *passThroughInput = getNode()->getInput(idx); - + *processAllRequested = false; if (!useThisNodeComponentsNeeded) { return; } @@ -3889,18 +3898,29 @@ EffectInstance::getComponentsNeededAndProduced_public(bool useLayerChoice, ok = getNode()->getSelectedLayer(-1, processChannels, processAllRequested, &layer); } + std::vector clipPrefsAllComps; ImageComponents clipPrefsComps = getComponents(-1); + { + if (clipPrefsComps.isPairedComponents()) { + ImageComponents first,second; + clipPrefsComps.getPlanesPair(&first,&second); + clipPrefsAllComps.push_back(first); + clipPrefsAllComps.push_back(second); + } else { + clipPrefsAllComps.push_back(clipPrefsComps); + } + } if (ok && layer.getNumComponents() != 0 && !layer.isColorPlane()) { compVec.push_back(layer); if (!clipPrefsComps.isColorPlane()) { - compVec.push_back(clipPrefsComps); + compVec.insert(compVec.end() ,clipPrefsAllComps.begin(), clipPrefsAllComps.end()); } } else { - compVec.push_back(clipPrefsComps); + compVec.insert(compVec.end() ,clipPrefsAllComps.begin(), clipPrefsAllComps.end()); } comps->insert( std::make_pair(-1, compVec) ); @@ -3925,12 +3945,25 @@ EffectInstance::getComponentsNeededAndProduced_public(bool useLayerChoice, NodePtr maskInput; int channelMask = getNode()->getMaskChannel(i, &maskComp, &maskInput); + std::vector clipPrefsAllComps; + { + ImageComponents clipPrefsComps = getComponents(i); + if (clipPrefsComps.isPairedComponents()) { + ImageComponents first,second; + clipPrefsComps.getPlanesPair(&first,&second); + clipPrefsAllComps.push_back(first); + clipPrefsAllComps.push_back(second); + } else { + clipPrefsAllComps.push_back(clipPrefsComps); + } + } + if (ok && !isAll) { if ( !layer.isColorPlane() ) { compVec.push_back(layer); } else { //Use regular clip preferences - compVec.push_back(getComponents(i)); + compVec.insert(compVec.end() ,clipPrefsAllComps.begin(), clipPrefsAllComps.end()); } } else if ( (channelMask != -1) && (maskComp.getNumComponents() > 0) ) { std::vector compVec; @@ -3938,7 +3971,7 @@ EffectInstance::getComponentsNeededAndProduced_public(bool useLayerChoice, comps->insert( std::make_pair(i, compVec) ); } else { //Use regular clip preferences - compVec.push_back(getComponents(i)); + compVec.insert(compVec.end() ,clipPrefsAllComps.begin(), clipPrefsAllComps.end()); } comps->insert( std::make_pair(i, compVec) ); } @@ -3949,7 +3982,7 @@ EffectInstance::getComponentsNeededAndProduced_public(bool useLayerChoice, bool EffectInstance::getCreateChannelSelectorKnob() const { - return !isMultiPlanar() && !isReader() && !isWriter() && !isTrackerNodePlugin(); + return !isMultiPlanar() && !isReader() && !isWriter() && !isTrackerNodePlugin() && getPluginID().find("uk.co.thefoundry.furnace") == std::string::npos; } int @@ -4595,8 +4628,8 @@ static ImageComponents getUnmappedComponentsForInput(EffectInstance* self, rawComps = firstNonOptionalConnectedInputComps; } if (rawComps) { - if (!rawComps.isColorPlane()) { - //this is not the color plane, don't remap + if (!rawComps) { + //None comps return rawComps; } else { rawComps = self->findClosestSupportedComponents(inputNb, rawComps); //turn that into a comp the plugin expects on that clip diff --git a/Engine/EffectInstance.h b/Engine/EffectInstance.h index b4f8fc2d89..e71ec90320 100644 --- a/Engine/EffectInstance.h +++ b/Engine/EffectInstance.h @@ -1551,10 +1551,10 @@ friend class ClipPreferencesRunning_RAII; **/ virtual void onEffectCreated(bool /*mayCreateFileDialog*/, const std::list >& /*defaultParamValues*/) {} - - virtual void onKnobSlaved(KnobI* slave, KnobI* master, + virtual void onKnobSlaved(const KnobPtr& slave, const KnobPtr& master, int dimension, bool isSlave) OVERRIDE FINAL; + private: diff --git a/Engine/EffectInstanceRenderRoI.cpp b/Engine/EffectInstanceRenderRoI.cpp index 9c0d1cab1e..52f374058e 100644 --- a/Engine/EffectInstanceRenderRoI.cpp +++ b/Engine/EffectInstanceRenderRoI.cpp @@ -393,30 +393,43 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, * we try to render with those instead. */ for (std::list::const_iterator it = args.components.begin(); it != args.components.end(); ++it) { + + // We may not request paired layers + assert(*it && !it->isPairedComponents()); assert(it->getNumComponents() > 0); bool isColorComponents = it->isColorPlane(); - ComponentsAvailableMap::iterator found = componentsAvailables.end(); + + bool found = false; + ImageComponents foundComponent; + NodePtr foundNode; + for (ComponentsAvailableMap::iterator it2 = componentsAvailables.begin(); it2 != componentsAvailables.end(); ++it2) { + if (it2->first == *it) { - found = it2; + found = true; + foundComponent = *it; + foundNode = it2->second.lock(); break; } else { if ( isColorComponents && it2->first.isColorPlane() && isSupportedComponent(-1, it2->first) ) { //We found another set of components in the color plane, take it - found = it2; + found = true; + foundComponent = it2->first; + foundNode = it2->second.lock(); break; } + } } // If the requested component is not present, then it will just return black and transparant to the plug-in. - if ( found != componentsAvailables.end() ) { - if ( found->second.lock() == getNode() ) { - requestedComponents.push_back(*it); + if (found) { + if (foundNode == getNode()) { + requestedComponents.push_back(foundComponent); } else { //The component is not available directly from this node, fetch it upstream - componentsToFetchUpstream.push_back( std::make_pair( *it, found->second.lock() ) ); + componentsToFetchUpstream.push_back(std::make_pair(foundComponent, foundNode)); } } } @@ -574,28 +587,33 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, RenderRoIRetCode ret = inputEffectIdentity->renderRoI(*inputArgs, &identityPlanes); if (ret == eRenderRoIRetCodeOk) { outputPlanes->insert(identityPlanes.begin(),identityPlanes.end()); - std::map convertedPlanes; - AppInstance* app = getApp(); - assert(args.components.size() == outputPlanes->size() || outputPlanes->empty()); - bool useAlpha0ForRGBToRGBAConversion = args.caller ? args.caller->getNode()->usesAlpha0ToConvertFromRGBToRGBA() : false; - std::list::const_iterator compIt = args.components.begin(); - - for (std::map::iterator it = outputPlanes->begin(); it!=outputPlanes->end(); ++it,++compIt) { + if (fetchUserSelectedComponentsUpstream) { + // We fetched potentially different components, so convert them to the format requested + std::map convertedPlanes; + AppInstance* app = getApp(); - ImagePremultiplicationEnum premult; - const ImageComponents & outComp = outputComponents.front(); - if ( outComp.isColorPlane() ) { - premult = thisEffectOutputPremult; - } else { - premult = eImagePremultiplicationOpaque; - } + bool useAlpha0ForRGBToRGBAConversion = args.caller ? args.caller->getNode()->usesAlpha0ToConvertFromRGBToRGBA() : false; + + std::list::const_iterator compIt = args.components.begin(); - ImagePtr tmp = convertPlanesFormatsIfNeeded(app, it->second, args.roi, *compIt, inputArgs->bitdepth, useAlpha0ForRGBToRGBAConversion, premult, -1); - assert(tmp); - convertedPlanes[it->first] = tmp; + for (std::map::iterator it = outputPlanes->begin(); it!=outputPlanes->end(); ++it,++compIt) { + + ImagePremultiplicationEnum premult; + const ImageComponents & outComp = outputComponents.front(); + if ( outComp.isColorPlane() ) { + premult = thisEffectOutputPremult; + } else { + premult = eImagePremultiplicationOpaque; + } + + ImagePtr tmp = convertPlanesFormatsIfNeeded(app, it->second, args.roi, *compIt, inputArgs->bitdepth, useAlpha0ForRGBToRGBAConversion, premult, -1); + assert(tmp); + convertedPlanes[it->first] = tmp; + } + *outputPlanes = convertedPlanes; } - *outputPlanes = convertedPlanes; + } else { return ret; } diff --git a/Engine/EngineFwd.h b/Engine/EngineFwd.h index 4859574c54..aefb9ccfdc 100644 --- a/Engine/EngineFwd.h +++ b/Engine/EngineFwd.h @@ -137,6 +137,7 @@ class KnobHelper; class KnobHolder; class KnobI; class KnobInt; +class KnobLayers; class KnobOutputFile; class KnobPage; class KnobParametric; @@ -144,6 +145,7 @@ class KnobPath; class KnobSeparator; class KnobSerialization; class KnobString; +class KnobTable; class LibraryBinary; class Node; class NodeCollection; diff --git a/Engine/FileSystemModel.cpp b/Engine/FileSystemModel.cpp index cb473e39e5..896498584f 100644 --- a/Engine/FileSystemModel.cpp +++ b/Engine/FileSystemModel.cpp @@ -438,7 +438,7 @@ FileSystemItem::matchPath(const QStringList& path, int startIndex) const const boost::shared_ptr& child = _imp->children[i]; - if ( child->fileName() == pathBit ) { + if ( child && child->fileName() == pathBit ) { if ( startIndex == path.size() -1 ) { return child; diff --git a/Engine/ImageComponents.cpp b/Engine/ImageComponents.cpp index 1bdd1805d2..ebb85a1cab 100644 --- a/Engine/ImageComponents.cpp +++ b/Engine/ImageComponents.cpp @@ -166,6 +166,44 @@ ImageComponents::isColorPlane() const return _layerName == kNatronColorPlaneName; } + +bool +ImageComponents::isEqualToPairedPlane(const ImageComponents& other, ImageComponents* pairedLayer) const +{ + assert(!other.isPairedComponents()); + if (!isPairedComponents()) { + return false; + } + if (_componentNames.size() != other._componentNames.size()) { + return false; + } + + for (std::size_t i = 0; i < _componentNames.size(); ++i) { + if (_componentNames[i] != other._componentNames[i]) { + return false; + } + } + if (_layerName == other._layerName) { + *pairedLayer = ImageComponents(_layerName, _globalComponentsName, _componentNames); + return true; + } else if (_pairedLayer == other._layerName) { + *pairedLayer = ImageComponents(_pairedLayer, _globalComponentsName, _componentNames); + return true; + } + return false; +} + +bool +ImageComponents::getPlanesPair(ImageComponents* first, ImageComponents* second) const +{ + if (!isPairedComponents()) { + return false; + } + *first = ImageComponents(_layerName, _globalComponentsName, _componentNames); + *second = ImageComponents(_pairedLayer, _globalComponentsName, _componentNames); + return true; +} + bool ImageComponents::isConvertibleTo(const ImageComponents& other) const { @@ -193,7 +231,7 @@ ImageComponents::operator==(const ImageComponents& other) const return false; } } - return _layerName == other._layerName; + return _layerName == other._layerName && _pairedLayer == other._pairedLayer; } bool @@ -318,14 +356,16 @@ const ImageComponents& ImageComponents::getPairedMotionVectors() { - static const ImageComponents comp(kFnOfxImagePlaneForwardMotionVector,kFnOfxImagePlaneBackwardMotionVector,kFnOfxImageComponentMotionVectors,motionComps,2); + //static const ImageComponents comp(kFnOfxImagePlaneForwardMotionVector,kFnOfxImagePlaneBackwardMotionVector,kFnOfxImageComponentMotionVectors,motionComps,2); + static const ImageComponents comp(kNatronForwardMotionVectorsPlaneUserName,kNatronBackwardMotionVectorsPlaneUserName,kNatronMotionComponentsName,motionComps,2); return comp; } const ImageComponents& ImageComponents::getPairedStereoDisparity() { - static const ImageComponents comp(kFnOfxImagePlaneStereoDisparityLeft,kFnOfxImagePlaneStereoDisparityRight,kFnOfxImageComponentStereoDisparity,xyComps,2); + //static const ImageComponents comp(kFnOfxImagePlaneStereoDisparityLeft,kFnOfxImagePlaneStereoDisparityRight,kFnOfxImageComponentStereoDisparity,xyComps,2); + static const ImageComponents comp(kNatronDisparityLeftPlaneUserName,kNatronDisparityRightPlaneUserName,kNatronDisparityComponentsName,xyComps,2); return comp; } diff --git a/Engine/ImageComponents.h b/Engine/ImageComponents.h index 78189edc57..5620bba95d 100644 --- a/Engine/ImageComponents.h +++ b/Engine/ImageComponents.h @@ -113,6 +113,14 @@ class ImageComponents ///E.g "rgba" const std::string& getComponentsGlobalName() const; + /** + * @brief If this layer is paired (i.e: isPairedComponents()) then returns true + * and set the pairedLayer + **/ + bool isEqualToPairedPlane(const ImageComponents& other, ImageComponents* pairedLayer) const; + + bool getPlanesPair(ImageComponents* first, ImageComponents* second) const; + bool operator==(const ImageComponents& other) const; bool operator!=(const ImageComponents& other) const { diff --git a/Engine/Knob.cpp b/Engine/Knob.cpp index 9c35a97a32..34c35d68fd 100644 --- a/Engine/Knob.cpp +++ b/Engine/Knob.cpp @@ -206,7 +206,7 @@ KnobI::getTopLevelPage() /***********************************KNOB HELPER******************************************/ ///for each dimension, the dimension of the master this dimension is linked to, and a pointer to the master -typedef std::vector< std::pair< int,KnobPtr > > MastersMap; +typedef std::vector< std::pair< int,KnobWPtr > > MastersMap; ///a curve for each dimension typedef std::vector< boost::shared_ptr > CurvesMap; @@ -215,15 +215,15 @@ struct Expr { std::string expression; //< the one modified by Natron std::string originalExpression; //< the one input by the user - + std::string exprInvalid; bool hasRet; ///The list of pair dpendencies for an expression - std::list< std::pair > dependencies; + std::list< std::pair > dependencies; //PyObject* code; - Expr() : expression(), originalExpression(), hasRet(false) /*, code(0)*/{} + Expr() : expression(), originalExpression(), exprInvalid(), hasRet(false) /*, code(0)*/{} }; @@ -470,12 +470,16 @@ KnobHelper::deleteKnob() knob->setKnobAsAliasOfThis(aliasKnob, false); } for (int i = 0; i < knob->getDimension(); ++i) { - knob->clearExpression(i,true); + knob->setExpressionInvalid(i, false, getName() + QObject::tr(": parameter does not exist").toStdString()); knob->unSlave(i, false); } } + if (getHolder() && getHolder()->getApp()) { + getHolder()->getApp()->recheckInvalidExpressions(); + } + for (int i = 0; i < getDimension(); ++i) { clearExpression(i, true); } @@ -1524,17 +1528,16 @@ KnobHelper::evaluateValueChangeInternal(int dimension, /// For eValueChangedReasonTimeChanged we never call the instanceChangedAction and evaluate otherwise it would just throttle /// the application responsiveness + onInternalValueChanged(dimension, time, view); + if ((originalReason != eValueChangedReasonTimeChanged || evaluateValueChangeOnTimeChange()) && _imp->holder) { - if (!app || !app->getProject()->isLoadingProject()) { _imp->holder->beginChanges(); _imp->holder->appendValueChange(shared_from_this(), dimension, refreshWidget, time, view, originalReason, reason); _imp->holder->endChanges(); - - } + } - onInternalValueChanged(dimension, time, view); if (!_imp->holder && _signalSlotHandler) { computeHasModifications(); @@ -2070,7 +2073,13 @@ KnobHelperPrivate::parseListenersFromExpression(int dimension) } std::string declarations = declarePythonVariables(false, dimension); - script = declarations + "\n" + expressionCopy + "\n" + script; + std::stringstream ss; + ss << "frame=0\n"; + ss << "view=0\n"; + ss << declarations << '\n'; + ss << expressionCopy << '\n'; + ss << script; + script = ss.str(); ///This will register the listeners std::string error; bool ok = NATRON_PYTHON_NAMESPACE::interpretPythonScript(script, &error,NULL); @@ -2206,8 +2215,107 @@ KnobHelper::validateExpression(const std::string& expression,int dimension,bool return funcExecScript; } +bool +KnobHelper::checkInvalidExpressions() +{ + int ndims = getDimension(); + std::vector > exprToReapply(ndims); + { + QMutexLocker k(&_imp->expressionMutex); + for (int i = 0; i < ndims; ++i) { + if (!_imp->expressions[i].exprInvalid.empty()) { + exprToReapply[i] = std::make_pair(_imp->expressions[i].originalExpression, _imp->expressions[i].hasRet); + } + } + } + bool isInvalid = false; + for (int i = 0; i < ndims; ++i) { + if (!exprToReapply[i].first.empty()) { + setExpressionInternal(i, exprToReapply[i].first, exprToReapply[i].second, true, false); + } + std::string err; + if (!isExpressionValid(i, &err)) { + isInvalid = true; + } + } + return !isInvalid; +} + +bool +KnobHelper::isExpressionValid(int dimension, std::string* error) const +{ + int ndims = getDimension(); + if (dimension < 0 || dimension >= ndims) { + return false; + } + { + QMutexLocker k(&_imp->expressionMutex); + if (error) { + *error = _imp->expressions[dimension].exprInvalid; + } + return _imp->expressions[dimension].exprInvalid.empty(); + } +} + +void +KnobHelper::setExpressionInvalid(int dimension, bool valid, const std::string& error) +{ + int ndims = getDimension(); + if (dimension < 0 || dimension >= ndims) { + return; + } + bool wasValid; + { + QMutexLocker k(&_imp->expressionMutex); + wasValid = _imp->expressions[dimension].exprInvalid.empty(); + _imp->expressions[dimension].exprInvalid = error; + } + if (getHolder() && getHolder()->getApp()) { + if (wasValid && !valid) { + bool haveOtherExprInvalid = false; + { + QMutexLocker k(&_imp->expressionMutex); + for (int i = 0; i < ndims; ++i) { + if (i != dimension) { + if (!_imp->expressions[dimension].exprInvalid.empty()) { + haveOtherExprInvalid = true; + break; + } + } + } + } + if (!haveOtherExprInvalid) { + getHolder()->getApp()->addInvalidExpressionKnob(boost::const_pointer_cast(shared_from_this())); + } + if (_signalSlotHandler) { + _signalSlotHandler->s_expressionChanged(dimension); + } + } else if (!wasValid && valid) { + bool haveOtherExprInvalid = false; + { + QMutexLocker k(&_imp->expressionMutex); + for (int i = 0; i < ndims; ++i) { + if (i != dimension) { + if (!_imp->expressions[dimension].exprInvalid.empty()) { + haveOtherExprInvalid = true; + break; + } + } + } + } + if (!haveOtherExprInvalid) { + getHolder()->getApp()->removeInvalidExpressionKnob(this); + } + if (_signalSlotHandler) { + _signalSlotHandler->s_expressionChanged(dimension); + } + } + } + +} + void -KnobHelper::setExpressionInternal(int dimension,const std::string& expression,bool hasRetVariable,bool clearResults) +KnobHelper::setExpressionInternal(int dimension,const std::string& expression,bool hasRetVariable,bool clearResults, bool failIfInvalid) { #ifdef NATRON_RUN_WITHOUT_PYTHON return; @@ -2224,7 +2332,18 @@ KnobHelper::setExpressionInternal(int dimension,const std::string& expression,bo } std::string exprResult; - std::string exprCpy = validateExpression(expression, dimension, hasRetVariable,&exprResult); + std::string exprCpy; + + std::string exprInvalid; + try { + exprCpy = validateExpression(expression, dimension, hasRetVariable,&exprResult); + } catch (const std::exception &e) { + exprInvalid = e.what(); + exprCpy = expression; + if (failIfInvalid) { + throw e; + } + } //Set internal fields @@ -2233,19 +2352,31 @@ KnobHelper::setExpressionInternal(int dimension,const std::string& expression,bo _imp->expressions[dimension].hasRet = hasRetVariable; _imp->expressions[dimension].expression = exprCpy; _imp->expressions[dimension].originalExpression = expression; + _imp->expressions[dimension].exprInvalid = exprInvalid; ///This may throw an exception upon failure //NATRON_PYTHON_NAMESPACE::compilePyScript(exprCpy, &_imp->expressions[dimension].code); } - - //Parse listeners of the expression, to keep track of dependencies to indicate them to the user. if (getHolder()) { - { + + + + //Parse listeners of the expression, to keep track of dependencies to indicate them to the user. + + if (exprInvalid.empty()) { + EXPR_RECURSION_LEVEL(); _imp->parseListenersFromExpression(dimension); + + } else { + AppInstance* app = getHolder()->getApp(); + if (app) { + app->addInvalidExpressionKnob(shared_from_this()); + } } } + //Notify the expr. has changed expressionChanged(dimension); @@ -2279,7 +2410,7 @@ KnobHelper::replaceNodeNameInExpression(int dimension, QString estr = QString::fromUtf8(hasExpr.c_str()); estr.replace(QString::fromUtf8(oldName.c_str()), QString::fromUtf8(newName.c_str())); hasExpr = estr.toStdString(); - setExpression(dimension, hasExpr, hasRetVar); + setExpression(dimension, hasExpr, hasRetVar, false); } catch (...) { } @@ -2296,7 +2427,7 @@ KnobHelper::isExpressionUsingRetVariable(int dimension) const } bool -KnobHelper::getExpressionDependencies(int dimension, std::list >& dependencies) const +KnobHelper::getExpressionDependencies(int dimension, std::list >& dependencies) const { QMutexLocker k(&_imp->expressionMutex); if (!_imp->expressions[dimension].expression.empty()) { @@ -2316,20 +2447,23 @@ KnobHelper::clearExpression(int dimension,bool clearResults) hadExpression = !_imp->expressions[dimension].originalExpression.empty(); _imp->expressions[dimension].expression.clear(); _imp->expressions[dimension].originalExpression.clear(); + _imp->expressions[dimension].exprInvalid.clear(); //Py_XDECREF(_imp->expressions[dimension].code); //< new ref //_imp->expressions[dimension].code = 0; } + KnobPtr thisShared = shared_from_this(); { - std::list > dependencies; + std::list > dependencies; { QWriteLocker kk(&_imp->mastersMutex); dependencies = _imp->expressions[dimension].dependencies; _imp->expressions[dimension].dependencies.clear(); } - for (std::list >::iterator it = dependencies.begin(); + for (std::list >::iterator it = dependencies.begin(); it != dependencies.end(); ++it) { - KnobHelper* other = dynamic_cast(it->first); + KnobPtr otherKnob = it->first.lock(); + KnobHelper* other = dynamic_cast(otherKnob.get()); assert(other); if (!other) { continue; @@ -2365,7 +2499,7 @@ KnobHelper::clearExpression(int dimension,bool clearResults) } if (getHolder()) { - getHolder()->onKnobSlaved(this, other,dimension,false ); + getHolder()->onKnobSlaved(thisShared, otherKnob,dimension,false ); } @@ -2398,10 +2532,35 @@ KnobHelper::expressionChanged(int dimension) computeHasModifications(); } -PyObject* +static bool catchErrors(PyObject* mainModule, std::string* error) { + if (PyErr_Occurred()) { + + PyErr_Print(); + ///Gui session, do stdout, stderr redirection + if (PyObject_HasAttrString(mainModule, "catchErr")) { + PyObject* errCatcher = PyObject_GetAttrString(mainModule,"catchErr"); //get our catchOutErr created above, new ref + PyObject *errorObj = 0; + if (errCatcher) { + errorObj = PyObject_GetAttrString(errCatcher,"value"); //get the stderr from our catchErr object, new ref + assert(errorObj); + *error = NATRON_PYTHON_NAMESPACE::PyString_asString(errorObj); + PyObject* unicode = PyUnicode_FromString(""); + PyObject_SetAttrString(errCatcher, "value", unicode); + Py_DECREF(errorObj); + Py_DECREF(errCatcher); + } + + } + return false; + } + return true; +} + +bool KnobHelper::executeExpression(double time, ViewIdx view, - int dimension) const + int dimension, + PyObject** ret, std::string* error) const { std::string expr; @@ -2421,43 +2580,20 @@ KnobHelper::executeExpression(double time, PyObject* v = PyRun_String(script.c_str(), Py_file_input, globalDict, 0); Py_XDECREF(v); - - - if (PyErr_Occurred()) { -#ifdef DEBUG - PyErr_Print(); - ///Gui session, do stdout, stderr redirection - if (PyObject_HasAttrString(mainModule, "catchErr")) { - std::string error; - PyObject* errCatcher = PyObject_GetAttrString(mainModule,"catchErr"); //get our catchOutErr created above, new ref - PyObject *errorObj = 0; - if (errCatcher) { - errorObj = PyObject_GetAttrString(errCatcher,"value"); //get the stderr from our catchErr object, new ref - assert(errorObj); - error = NATRON_PYTHON_NAMESPACE::PY3String_asString(errorObj); - PyObject* unicode = PyUnicode_FromString(""); - PyObject_SetAttrString(errCatcher, "value", unicode); - Py_DECREF(errorObj); - Py_DECREF(errCatcher); - qDebug() << "Expression dump:\n========================================================="; - qDebug() << expr.c_str(); - qDebug() << error.c_str(); - } - - } + *ret = 0; -#endif - throw std::runtime_error("Failed to execute expression"); + if (!catchErrors(mainModule, error)) { + return false; } - PyObject *ret = PyObject_GetAttrString(mainModule,"ret"); //get our ret variable created above - - if (!ret || PyErr_Occurred()) { -#ifdef DEBUG - PyErr_Print(); -#endif - throw std::runtime_error("return value must be assigned to the \"ret\" variable"); + *ret = PyObject_GetAttrString(mainModule,"ret"); //get our ret variable created above + if (!*ret) { + *error = "Missing ret variable"; + return false; } - return ret; + if (!catchErrors(mainModule, error)) { + return false; + } + return true; } @@ -2864,7 +3000,7 @@ KnobHelper::slaveTo(int dimension, } { QWriteLocker l(&_imp->mastersMutex); - if (_imp->masters[dimension].second) { + if (_imp->masters[dimension].second.lock()) { return false; } _imp->ignoreMasterPersistence = ignoreMasterPersistence; @@ -2929,8 +3065,8 @@ std::pair KnobHelper::getMaster(int dimension) const { assert(dimension >= 0 && dimension < (int)_imp->masters.size()); QReadLocker l(&_imp->mastersMutex); - - return _imp->masters[dimension]; + std::pair ret = std::make_pair(_imp->masters[dimension].first, _imp->masters[dimension].second.lock()); + return ret; } void @@ -2948,15 +3084,9 @@ KnobHelper::isSlave(int dimension) const assert(dimension >= 0); QReadLocker l(&_imp->mastersMutex); - return bool(_imp->masters[dimension].second); + return bool(_imp->masters[dimension].second.lock()); } -std::vector< std::pair > KnobHelper::getMasters_mt_safe() const -{ - QReadLocker l(&_imp->mastersMutex); - - return _imp->masters; -} void KnobHelper::checkAnimationLevel(ViewSpec view, @@ -3260,7 +3390,7 @@ KnobHelper::cloneExpressions(KnobI* other,int dimension) std::string expr = other->getExpression(i); bool hasRet = other->isExpressionUsingRetVariable(i); if (!expr.empty()) { - setExpression(i, expr,hasRet); + setExpression(i, expr,hasRet, false); cloneExpressionsResults(other,i); } } @@ -3282,7 +3412,7 @@ KnobHelper::cloneExpressionsAndCheckIfChanged(KnobI* other,int dimension) std::string expr = other->getExpression(i); bool hasRet = other->isExpressionUsingRetVariable(i); if (!expr.empty() && (expr != _imp->expressions[i].originalExpression || hasRet != _imp->expressions[i].hasRet)) { - setExpression(i, expr,hasRet); + setExpression(i, expr,hasRet, false); cloneExpressionsResults(other,i); ret = true; } @@ -3307,13 +3437,13 @@ KnobHelper::addListener(const bool isExpression, if (!listenerIsHelper) { return; } - + KnobPtr thisShared = shared_from_this(); if (listenerIsHelper->_signalSlotHandler && _signalSlotHandler) { //Notify the holder one of its knob is now slaved if (listenerIsHelper->getHolder()) { - listenerIsHelper->getHolder()->onKnobSlaved(listenerIsHelper, this,listenerDimension,true ); + listenerIsHelper->getHolder()->onKnobSlaved(listener, thisShared,listenerDimension,true ); } } @@ -3338,7 +3468,7 @@ KnobHelper::addListener(const bool isExpression, if (isExpression) { QMutexLocker k(&listenerIsHelper->_imp->expressionMutex); assert(listenerDimension >= 0 && listenerDimension < listenerIsHelper->_imp->dimension); - listenerIsHelper->_imp->expressions[listenerDimension].dependencies.push_back(std::make_pair(this,listenedToDimension)); + listenerIsHelper->_imp->expressions[listenerDimension].dependencies.push_back(std::make_pair(thisShared,listenedToDimension)); } @@ -3689,7 +3819,7 @@ KnobHelper::createDuplicateOnNode(EffectInstance* effect, std::string script = ss.str(); for (int i = 0; i < getDimension(); ++i) { clearExpression(i, true); - setExpression(i, script, false); + setExpression(i, script, false, false); } } catch (...) { @@ -3751,7 +3881,7 @@ KnobHelper::setKnobAsAliasOfThis(const KnobPtr& master, bool doAlias) assert(thisChoice); if (thisChoice) { isChoice->populateChoices(thisChoice->getEntries_mt_safe(), - thisChoice->getEntriesHelp_mt_safe()); + thisChoice->getEntriesHelp_mt_safe(), 0, 0, false); } } } @@ -3762,12 +3892,14 @@ KnobHelper::setKnobAsAliasOfThis(const KnobPtr& master, bool doAlias) unSlave(i, false); } if (doAlias) { + master->clone(this, i); bool ok = slaveTo(i, master, i, eValueChangedReasonNatronInternalEdited, false); assert(ok); Q_UNUSED(ok); } - handleSignalSlotsForAliasLink(master,doAlias); } + handleSignalSlotsForAliasLink(master,doAlias); + endChanges(); QWriteLocker k(&_imp->mastersMutex); @@ -3789,14 +3921,17 @@ KnobHelper::getAliasMaster() const void KnobHelper::getAllExpressionDependenciesRecursive(std::set& nodes) const { - std::set deps; + std::set deps; { QMutexLocker k(&_imp->expressionMutex); for (int i = 0; i < _imp->dimension; ++i) { - for (std::list< std::pair >::const_iterator it = _imp->expressions[i].dependencies.begin(); + for (std::list< std::pair >::const_iterator it = _imp->expressions[i].dependencies.begin(); it != _imp->expressions[i].dependencies.end(); ++it) { + KnobPtr knob = it->first.lock(); + if (knob) { + deps.insert(knob); + } - deps.insert(it->first); } } @@ -3804,16 +3939,17 @@ KnobHelper::getAllExpressionDependenciesRecursive(std::set& nodes) con { QReadLocker k(&_imp->mastersMutex); for (int i = 0; i < _imp->dimension; ++i) { - if (_imp->masters[i].second) { - if (std::find(deps.begin(), deps.end(), _imp->masters[i].second.get()) == deps.end()) { - deps.insert(_imp->masters[i].second.get()); + KnobPtr master = _imp->masters[i].second.lock(); + if (master) { + if (std::find(deps.begin(), deps.end(), master) == deps.end()) { + deps.insert(master); } } } } - std::list knobsToInspectRecursive; - for (std::set::iterator it = deps.begin(); it!=deps.end(); ++it) { + std::list knobsToInspectRecursive; + for (std::set::iterator it = deps.begin(); it!=deps.end(); ++it) { EffectInstance* effect = dynamic_cast((*it)->getHolder()); if (effect) { NodePtr node = effect->getNode(); @@ -3826,7 +3962,7 @@ KnobHelper::getAllExpressionDependenciesRecursive(std::set& nodes) con } - for (std::list::iterator it = knobsToInspectRecursive.begin(); it!=knobsToInspectRecursive.end(); ++it) { + for (std::list::iterator it = knobsToInspectRecursive.begin(); it!=knobsToInspectRecursive.end(); ++it) { (*it)->getAllExpressionDependenciesRecursive(nodes); } } @@ -4629,7 +4765,7 @@ KnobHolder::endChanges(bool discardRendering) // Call instanceChanged on each knob for (KnobChanges::iterator it = knobChanged.begin(); it!=knobChanged.end(); ++it) { - if (it->knob && !it->valueChangeBlocked) { + if (it->knob && !it->valueChangeBlocked && !isLoadingProject) { if (!it->originatedFromMainThread && !canHandleEvaluateOnChangeInOtherThread()) { Q_EMIT doValueChangeOnMainThread(it->knob.get(), it->originalReason, it->time, it->view, it->originatedFromMainThread); } else { @@ -5272,7 +5408,6 @@ AnimatingKnobStringHelper::stringFromInterpolatedValue(double interpolated, std::string* returnValue) const { assert(!view.isAll()); - assert(!view.isCurrent()); // not yet implemented Q_UNUSED(view); _animation->stringFromInterpolatedIndex(interpolated, returnValue); } @@ -5293,7 +5428,7 @@ AnimatingKnobStringHelper::keyframeRemoved_virtual(int /*dimension*/, std::string AnimatingKnobStringHelper::getStringAtTime(double time, ViewSpec view, - int dimension) const + int dimension) { std::string ret; // assert(!view.isAll()); diff --git a/Engine/Knob.h b/Engine/Knob.h index 260473b3b1..c9e67d2625 100644 --- a/Engine/Knob.h +++ b/Engine/Knob.h @@ -491,12 +491,12 @@ class KnobI * @brief Evaluates the curve at the given dimension and at the given time. This returns the value of the curve directly. * If the knob is holding a string, it will return the index. **/ - virtual double getRawCurveValueAt(double time, ViewSpec view, int dimension) const = 0; + virtual double getRawCurveValueAt(double time, ViewSpec view, int dimension) = 0; /** * @brief Same as getRawCurveValueAt, but first check if an expression is present. The expression should return a PoD. **/ - virtual double getValueAtWithExpression(double time, ViewSpec view, int dimension) const = 0; + virtual double getValueAtWithExpression(double time, ViewSpec view, int dimension) = 0; protected: @@ -579,16 +579,24 @@ class KnobI * just store it. This flag is used for serialisation, you should always pass false **/ protected: - virtual void setExpressionInternal(int dimension,const std::string& expression,bool hasRetVariable,bool clearResults) = 0; + virtual void setExpressionInternal(int dimension,const std::string& expression,bool hasRetVariable,bool clearResults, bool failIfInvalid) = 0; public: void restoreExpression(int dimension,const std::string& expression,bool hasRetVariable) { - setExpressionInternal(dimension, expression, hasRetVariable, false); + setExpressionInternal(dimension, expression, hasRetVariable, false, false); } - void setExpression(int dimension,const std::string& expression,bool hasRetVariable) { - setExpressionInternal(dimension, expression, hasRetVariable, true); + void setExpression(int dimension,const std::string& expression,bool hasRetVariable, bool failIfInvalid) { + setExpressionInternal(dimension, expression, hasRetVariable, true, failIfInvalid); } + /** + * @brief Tries to re-apply invalid expressions, returns true if they are all valid + **/ + virtual bool checkInvalidExpressions() = 0; + virtual bool isExpressionValid(int dimension, std::string* error) const = 0; + virtual void setExpressionInvalid(int dimension, bool valid, const std::string& error) = 0; + + /** * @brief For each dimension, try to find in the expression, if set, the node name "oldName" and replace * it by "newName" @@ -630,7 +638,7 @@ class KnobI * @brief Returns in dependencies a list of all the knobs used in the expression at the given dimension * @returns True on sucess, false if no expression is set. **/ - virtual bool getExpressionDependencies(int dimension, std::list >& dependencies) const = 0; + virtual bool getExpressionDependencies(int dimension, std::list >& dependencies) const = 0; /** @@ -650,12 +658,12 @@ class KnobI /** * @brief Compute the derivative at time as a double **/ - virtual double getDerivativeAtTime(double time, ViewSpec view, int dimension = 0) const = 0; + virtual double getDerivativeAtTime(double time, ViewSpec view, int dimension = 0) = 0; /** * @brief Compute the integral of dimension from time1 to time2 as a double **/ - virtual double getIntegrateFromTimeToTime(double time1, double time2, ViewSpec view, int dimension = 0) const = 0; + virtual double getIntegrateFromTimeToTime(double time1, double time2, ViewSpec view, int dimension = 0) = 0; /** * @brief Places in time the keyframe time at the given index. @@ -1072,12 +1080,6 @@ class KnobI **/ virtual bool isSlave(int dimension) const = 0; - /** - * @brief Same as getMaster but for all dimensions. - **/ - virtual std::vector > getMasters_mt_safe() const = 0; - - /** * @brief Get the current animation level. **/ @@ -1267,7 +1269,16 @@ class KnobHelper virtual boost::shared_ptr getCurve(ViewSpec view, int dimension,bool byPassMaster = false) const OVERRIDE FINAL WARN_UNUSED_RETURN; virtual bool isAnimated(int dimension, ViewSpec view = ViewSpec::current()) const OVERRIDE FINAL WARN_UNUSED_RETURN; virtual bool hasAnimation() const OVERRIDE FINAL WARN_UNUSED_RETURN; - virtual void setExpressionInternal(int dimension,const std::string& expression,bool hasRetVariable,bool clearResults) OVERRIDE FINAL; + virtual bool checkInvalidExpressions() OVERRIDE FINAL; + virtual bool isExpressionValid(int dimension, std::string* error) const OVERRIDE FINAL WARN_UNUSED_RETURN; + virtual void setExpressionInvalid(int dimension, bool valid, const std::string& error) OVERRIDE FINAL; + +protected: + + +public: + + virtual void setExpressionInternal(int dimension,const std::string& expression,bool hasRetVariable,bool clearResults, bool failIfInvalid) OVERRIDE FINAL; virtual void replaceNodeNameInExpression(int dimension, const std::string& oldName, const std::string& newName) OVERRIDE FINAL; @@ -1285,7 +1296,7 @@ class KnobHelper public: virtual bool isExpressionUsingRetVariable(int dimension = 0) const OVERRIDE FINAL WARN_UNUSED_RETURN; - virtual bool getExpressionDependencies(int dimension, std::list >& dependencies) const OVERRIDE FINAL; + virtual bool getExpressionDependencies(int dimension, std::list >& dependencies) const OVERRIDE FINAL; virtual std::string getExpression(int dimension) const OVERRIDE FINAL WARN_UNUSED_RETURN; virtual const std::vector< boost::shared_ptr > & getCurves() const OVERRIDE FINAL WARN_UNUSED_RETURN; virtual void setAnimationEnabled(bool val) OVERRIDE FINAL; @@ -1388,13 +1399,12 @@ class KnobHelper void resetMaster(int dimension); ///The return value must be Py_DECRREF - PyObject* executeExpression(double time, ViewIdx view, int dimension) const; + bool executeExpression(double time, ViewIdx view, int dimension, PyObject** ret, std::string* error) const; public: virtual std::pair getMaster(int dimension) const OVERRIDE FINAL WARN_UNUSED_RETURN; virtual bool isSlave(int dimension) const OVERRIDE FINAL WARN_UNUSED_RETURN; - virtual std::vector > getMasters_mt_safe() const OVERRIDE FINAL WARN_UNUSED_RETURN; virtual AnimationLevelEnum getAnimationLevel(int dimension) const OVERRIDE FINAL WARN_UNUSED_RETURN; virtual bool isTypeCompatible(const KnobPtr & other) const OVERRIDE WARN_UNUSED_RETURN = 0; @@ -1555,6 +1565,10 @@ class Knob protected: + virtual bool computeValuesHaveModifications(int dimension, + const T& value, + const T& defaultValue) const; + virtual bool hasModificationsVirtual(int /*dimension*/) const { return false; } public: @@ -1563,7 +1577,7 @@ class Knob * @brief Get the current value of the knob for the given dimension. * If it is animated, it will return the value at the current time. **/ - T getValue(int dimension = 0, ViewSpec view = ViewSpec::current(), bool clampToMinMax = true) const WARN_UNUSED_RETURN; + T getValue(int dimension = 0, ViewSpec view = ViewSpec::current(), bool clampToMinMax = true) WARN_UNUSED_RETURN; /** @@ -1573,10 +1587,10 @@ class Knob * This function is overloaded by the KnobString which can have its custom interpolation * but this should be the only knob which should ever need to overload it. **/ - T getValueAtTime(double time, int dimension = 0, ViewSpec view = ViewSpec::current(), bool clampToMinMax = true,bool byPassMaster = false) const WARN_UNUSED_RETURN; + T getValueAtTime(double time, int dimension = 0, ViewSpec view = ViewSpec::current(), bool clampToMinMax = true,bool byPassMaster = false) WARN_UNUSED_RETURN; - virtual double getRawCurveValueAt(double time, ViewSpec view, int dimension) const OVERRIDE FINAL WARN_UNUSED_RETURN; - virtual double getValueAtWithExpression(double time, ViewSpec view, int dimension) const OVERRIDE FINAL WARN_UNUSED_RETURN; + virtual double getRawCurveValueAt(double time, ViewSpec view, int dimension) OVERRIDE FINAL WARN_UNUSED_RETURN; + virtual double getValueAtWithExpression(double time, ViewSpec view, int dimension) OVERRIDE FINAL WARN_UNUSED_RETURN; private: @@ -1766,9 +1780,9 @@ class Knob virtual void onTimeChanged(bool isPlayback, double time) OVERRIDE FINAL; ///Cannot be overloaded by KnobHelper as it requires the value member - virtual double getDerivativeAtTime(double time, ViewSpec view, int dimension = 0) const OVERRIDE FINAL WARN_UNUSED_RETURN; - virtual double getIntegrateFromTimeToTime(double time1, double time2, ViewSpec view, int dimension = 0) const OVERRIDE FINAL WARN_UNUSED_RETURN; - double getIntegrateFromTimeToTimeSimpson(double time1, double time2, ViewSpec view, int dimension = 0) const; + virtual double getDerivativeAtTime(double time, ViewSpec view, int dimension = 0) OVERRIDE FINAL WARN_UNUSED_RETURN; + virtual double getIntegrateFromTimeToTime(double time1, double time2, ViewSpec view, int dimension = 0) OVERRIDE FINAL WARN_UNUSED_RETURN; + double getIntegrateFromTimeToTimeSimpson(double time1, double time2, ViewSpec view, int dimension = 0) ; ///Cannot be overloaded by KnobHelper as it requires setValue virtual void resetToDefaultValue(int dimension) OVERRIDE FINAL; @@ -1807,10 +1821,10 @@ class Knob map = _exprRes[dim]; } - T getValueFromMasterAt(double time, ViewSpec view, int dimension, KnobI* master) const; - T getValueFromMaster(ViewSpec view, int dimension, KnobI* master, bool clamp) const; + T getValueFromMasterAt(double time, ViewSpec view, int dimension, KnobI* master) ; + T getValueFromMaster(ViewSpec view, int dimension, KnobI* master, bool clamp) ; - bool getValueFromCurve(double time, ViewSpec view, int dimension, bool useGuiCurve, bool byPassMaster, bool clamp, T* ret) const; + bool getValueFromCurve(double time, ViewSpec view, int dimension, bool useGuiCurve, bool byPassMaster, bool clamp, T* ret) ; protected: @@ -1851,17 +1865,17 @@ class Knob private: - T evaluateExpression(double time, ViewIdx view, int dimension) const; + bool evaluateExpression(double time, ViewIdx view, int dimension, T* ret, std::string* error); /* * @brief Same as evaluateExpression but expects it to return a PoD */ - double evaluateExpression_pod(double time, ViewIdx view, int dimension) const; + bool evaluateExpression_pod(double time, ViewIdx view, int dimension, double* value, std::string* error); - bool getValueFromExpression(double time, ViewIdx view, int dimension,bool clamp,T* ret) const; + bool getValueFromExpression(double time, ViewIdx view, int dimension,bool clamp,T* ret); - bool getValueFromExpression_pod(double time, ViewIdx view, int dimension,bool clamp,double* ret) const; + bool getValueFromExpression_pod(double time, ViewIdx view, int dimension,bool clamp,double* ret); ////////////////////////////////////////////////////////////////////// /////////////////////////////////// End implementation of KnobI @@ -1952,7 +1966,7 @@ class AnimatingKnobStringHelper void stringFromInterpolatedValue(double interpolated, ViewSpec view, std::string* returnValue) const; - std::string getStringAtTime(double time, ViewSpec view, int dimension) const; + std::string getStringAtTime(double time, ViewSpec view, int dimension) ; protected: @@ -2390,7 +2404,7 @@ class KnobHolder : public QObject /** * @brief Same as onAllKnobsSlaved but called when only 1 knob is slaved **/ - virtual void onKnobSlaved(KnobI* /*slave*/,KnobI* /*master*/, + virtual void onKnobSlaved(const KnobPtr& /*slave*/,const KnobPtr& /*master*/, int /*dimension*/, bool /*isSlave*/) { diff --git a/Engine/KnobFactory.cpp b/Engine/KnobFactory.cpp index 9c3b5814ec..ca73229236 100644 --- a/Engine/KnobFactory.cpp +++ b/Engine/KnobFactory.cpp @@ -93,6 +93,7 @@ KnobFactory::loadBultinKnobs() _loadedKnobs.insert( knobFactoryEntry() ); _loadedKnobs.insert( knobFactoryEntry() ); _loadedKnobs.insert( knobFactoryEntry() ); + _loadedKnobs.insert( knobFactoryEntry() ); } boost::shared_ptr KnobFactory::createKnob(const std::string &id, diff --git a/Engine/KnobFile.cpp b/Engine/KnobFile.cpp index 13faaa92ca..ad45342a9a 100644 --- a/Engine/KnobFile.cpp +++ b/Engine/KnobFile.cpp @@ -84,7 +84,7 @@ KnobFile::typeName() const std::string -KnobFile::getFileName(int time, ViewSpec view) const +KnobFile::getFileName(int time, ViewSpec view) { if (!_isInputImage) { return getValue(0, view); @@ -133,7 +133,7 @@ KnobOutputFile::typeName() const } QString -KnobOutputFile::generateFileNameAtTime(SequenceTime time, ViewSpec view) const +KnobOutputFile::generateFileNameAtTime(SequenceTime time, ViewSpec view) { std::vector views; if (getHolder() && getHolder()->getApp()) { @@ -151,7 +151,7 @@ KnobPath::KnobPath(KnobHolder* holder, const std::string &description, int dimension, bool declaredByPlugin) -: Knob(holder,description,dimension,declaredByPlugin) +: KnobTable(holder,description,dimension,declaredByPlugin) , _isMultiPath(false) , _isStringList(false) { @@ -164,12 +164,6 @@ KnobPath::typeNameStatic() return _typeNameStr; } -bool -KnobPath::canAnimate() const -{ - return false; -} - const std::string & KnobPath::typeName() const { @@ -201,100 +195,9 @@ KnobPath::getIsStringList() const return _isStringList; } -void -KnobPath::getVariables(std::list >* paths) const -{ - if (!_isMultiPath) { - return; - } - - std::string startNameTag(NATRON_ENV_VAR_NAME_START_TAG); - std::string endNameTag(NATRON_ENV_VAR_NAME_END_TAG); - std::string startValueTag(NATRON_ENV_VAR_VALUE_START_TAG); - std::string endValueTag(NATRON_ENV_VAR_VALUE_END_TAG); - - std::string raw = getValue().c_str(); - size_t i = raw.find(startNameTag); - while (i != std::string::npos) { - i += startNameTag.size(); - assert(i < raw.size()); - size_t endNamePos = raw.find(endNameTag,i); - assert(endNamePos != std::string::npos && endNamePos < raw.size()); - if (endNamePos == std::string::npos || endNamePos >= raw.size()) { - throw std::logic_error("KnobPath::getVariables()"); - } - std::string name,value; - while (i < endNamePos) { - name.push_back(raw[i]); - ++i; - } - - i = raw.find(startValueTag,i); - i += startValueTag.size(); - assert(i != std::string::npos && i < raw.size()); - - size_t endValuePos = raw.find(endValueTag,i); - assert(endValuePos != std::string::npos && endValuePos < raw.size()); - - while (endValuePos != std::string::npos && endValuePos < raw.size() && i < endValuePos) { - value.push_back(raw.at(i)); - ++i; - } - - // In order to use XML tags, the text inside the tags has to be unescaped. - paths->push_back(std::make_pair(name,Project::unescapeXML(value).c_str())); - - i = raw.find(startNameTag,i); - } -} - - -void -KnobPath::getPaths(std::list *paths) const -{ - std::string raw = getValue().c_str(); - - if (_isMultiPath) { - std::list > ret; - getVariables(&ret); - for (std::list >::iterator it = ret.begin(); it != ret.end(); ++it) { - paths->push_back(it->second); - } - } else { - paths->push_back(raw); - } - -} std::string -KnobPath::encodeToMultiPathFormat(const std::list >& paths) -{ - std::string path; - - - for (std::list >::const_iterator it = paths.begin(); it != paths.end(); ++it) { - // In order to use XML tags, the text inside the tags has to be escaped. - path += NATRON_ENV_VAR_NAME_START_TAG; - path += Project::escapeXML(it->first); - path += NATRON_ENV_VAR_NAME_END_TAG; - path += NATRON_ENV_VAR_VALUE_START_TAG; - path += Project::escapeXML(it->second); - path += NATRON_ENV_VAR_VALUE_END_TAG; - } - return path; -} - -void -KnobPath::setPaths(const std::list >& paths) -{ - if (!_isMultiPath) { - return; - } - setValue(encodeToMultiPathFormat(paths)); -} - -std::string -KnobPath::generateUniquePathID(const std::list >& paths) +KnobPath::generateUniquePathID(const std::list >& paths) { std::string baseName("Path"); int idx = 0; @@ -308,8 +211,8 @@ KnobPath::generateUniquePathID(const std::list >::const_iterator it = paths.begin(); it != paths.end(); ++it) { - if (it->first == name) { + for (std::list >::const_iterator it = paths.begin(); it != paths.end(); ++it) { + if ((*it)[0] == name) { found = true; break; } @@ -319,17 +222,52 @@ KnobPath::generateUniquePathID(const std::list* paths) +{ + std::list > table; + getTable(&table); + for (std::list >::iterator it = table.begin(); it!=table.end(); ++it) { + assert(it->size() == 2); + paths->push_back((*it)[1]); + } +} + void KnobPath::prependPath(const std::string& path) { if (!_isMultiPath) { setValue(path); } else { - std::list > paths; - getVariables(&paths); + std::list > paths; + getTable(&paths); std::string name = generateUniquePathID(paths); - paths.push_front(std::make_pair(name, path)); - setPaths(paths); + std::vector row(2); + row[0] = name; + row[1] = path; + paths.push_front(row); + setTable(paths); } } @@ -339,16 +277,19 @@ KnobPath::appendPath(const std::string& path) if (!_isMultiPath) { setValue(path); } else { - std::list > paths; - getVariables(&paths); - for (std::list >::iterator it = paths.begin(); it!=paths.end(); ++it) { - if (it->second == path) { + std::list > paths; + getTable(&paths); + for (std::list >::iterator it = paths.begin(); it!=paths.end(); ++it) { + if ((*it)[1] == path) { return; } } std::string name = generateUniquePathID(paths); - paths.push_back(std::make_pair(name, path)); - setPaths(paths); + std::vector row(2); + row[0] = name; + row[1] = path; + paths.push_back(row); + setTable(paths); } } diff --git a/Engine/KnobFile.h b/Engine/KnobFile.h index 330ed457c8..470d556140 100644 --- a/Engine/KnobFile.h +++ b/Engine/KnobFile.h @@ -91,7 +91,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON * @brief getRandomFrameName * @param f The index of the frame. */ - std::string getFileName(int time, ViewSpec view) const; + std::string getFileName(int time, ViewSpec view) ; Q_SIGNALS: @@ -161,7 +161,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON return _sequenceDialog; } - QString generateFileNameAtTime(SequenceTime time, ViewSpec view) const; + QString generateFileNameAtTime(SequenceTime time, ViewSpec view) ; Q_SIGNALS: @@ -185,14 +185,11 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON /** - * @brief A Path knob could also be called Environment_variable_Knob. - * The string is encoded the following way: + * @brief The string value is encoded the following way: * LalaMyValue - * Split all the ';' characters to get all different variables - * then for each variable split the ':' to get the name and the value of the variable. **/ class KnobPath - : public Knob + : public KnobTable { public: @@ -215,29 +212,46 @@ class KnobPath bool isMultiPath() const; - void getPaths(std::list* paths) const; - - ///Doesn't work if isMultiPath() == false - void getVariables(std::list >* paths) const; - - static std::string encodeToMultiPathFormat(const std::list >& paths); - - void setPaths(const std::list >& paths); - - void prependPath(const std::string& path) ; - void appendPath(const std::string& path) ; - /* @brief same as setMultiPath except that there will be only variable names, no values */ void setAsStringList(bool b); bool getIsStringList() const; -private: + void getPaths(std::list* paths) ; + void prependPath(const std::string& path) ; + void appendPath(const std::string& path) ; + + + virtual int getColumnsCount() const OVERRIDE FINAL WARN_UNUSED_RETURN + { + return _isStringList ? 1 : 2; + } + + virtual std::string getColumnLabel(int col) const OVERRIDE FINAL WARN_UNUSED_RETURN + { + switch (col) { + case 0: + return "Name"; + case 1: + return "Value"; + default: + return ""; + } + } + + virtual bool isCellEnabled(int row, int col, const QStringList& values) const OVERRIDE FINAL WARN_UNUSED_RETURN; - static std::string generateUniquePathID(const std::list >& paths); + virtual bool isCellBracketDecorated(int row, int col) const OVERRIDE FINAL WARN_UNUSED_RETURN; + + virtual bool useEditButton() const OVERRIDE FINAL WARN_UNUSED_RETURN + { + return _isMultiPath && !_isStringList; + } - virtual bool canAnimate() const OVERRIDE FINAL; +private: + + static std::string generateUniquePathID(const std::list >& paths); virtual const std::string & typeName() const OVERRIDE FINAL; private: diff --git a/Engine/KnobImpl.h b/Engine/KnobImpl.h index 9e40628498..d98e3ef94c 100644 --- a/Engine/KnobImpl.h +++ b/Engine/KnobImpl.h @@ -388,55 +388,57 @@ inline unsigned int hashFunction(unsigned int a) } template -T +bool Knob::evaluateExpression(double time, ViewIdx view, - int dimension) const + int dimension, + T* value, + std::string* error) { + PythonGILLocker pgl; PyObject *ret; ///Reset the random state to reproduce the sequence randomSeed(time, hashFunction(dimension)); - try { - ret = executeExpression(time, view, dimension); - } catch (...) { - return T(); + bool exprOk = executeExpression(time, view, dimension, &ret, error); + if (!exprOk) { + return false; } - - T val = pyObjectToType(ret); + *value = pyObjectToType(ret); Py_DECREF(ret); //< new ref - return val; + return true; } template -double +bool Knob::evaluateExpression_pod(double time, ViewIdx view, - int dimension) const + int dimension, + double* value, + std::string* error) { PythonGILLocker pgl; PyObject *ret; ///Reset the random state to reproduce the sequence randomSeed(time, hashFunction(dimension)); - try { - ret = executeExpression(time, view, dimension); - } catch (...) { - return 0.; + bool exprOk = executeExpression(time, view, dimension, &ret, error); + if (!exprOk) { + return false; } if (PyFloat_Check(ret)) { - return (double)PyFloat_AsDouble(ret); + *value = (double)PyFloat_AsDouble(ret); } else if (PyLong_Check(ret)) { - return (int)PyInt_AsLong(ret); + *value = (int)PyInt_AsLong(ret); } else if (PyObject_IsTrue(ret) == 1) { - return 1; + *value = 1; } else { //Strings should always fall here - return 0.; + *value = 0.; } - + return true; } template @@ -445,17 +447,16 @@ Knob::getValueFromExpression(double time, ViewIdx view, int dimension, bool clamp, - T* ret) const + T* ret) { ///Prevent recursive call of the expression - - if (getExpressionRecursionLevel() > 0) { return false; } + ///Check first if a value was already computed: { @@ -467,10 +468,19 @@ Knob::getValueFromExpression(double time, } } - + bool exprWasValid = isExpressionValid(dimension, 0); { EXPR_RECURSION_LEVEL(); - *ret = evaluateExpression(time, view, dimension); + std::string error; + bool exprOk = evaluateExpression(time, view, dimension, ret, &error); + if (!exprOk) { + setExpressionInvalid(dimension, false, error); + return false; + } else { + if (!exprWasValid) { + setExpressionInvalid(dimension, true, error); + } + } } if (clamp) { @@ -489,7 +499,7 @@ Knob::getValueFromExpression_pod(double time, ViewIdx view, int dimension, bool /*clamp*/, - double* ret) const + double* ret) { ///Prevent recursive call of the expression @@ -498,9 +508,19 @@ Knob::getValueFromExpression_pod(double time, return false; } + bool exprWasValid = isExpressionValid(dimension, 0); { EXPR_RECURSION_LEVEL(); - *ret = evaluateExpression_pod(time, view, dimension); + std::string error; + bool exprOk = evaluateExpression_pod(time, view, dimension, ret, &error); + if (!exprOk) { + setExpressionInvalid(dimension, false, error); + return false; + } else { + if (!exprWasValid) { + setExpressionInvalid(dimension, true, error); + } + } } return true; @@ -513,7 +533,7 @@ Knob::getValueFromExpression_pod(double time, ViewIdx view, int dimension, bool clamp, - double* ret) const + double* ret) { ///Prevent recursive call of the expression @@ -534,9 +554,19 @@ Knob::getValueFromExpression_pod(double time, } + bool exprWasValid = isExpressionValid(dimension, 0); { EXPR_RECURSION_LEVEL(); - *ret = evaluateExpression_pod(time, view, dimension); + std::string error; + bool exprOk = evaluateExpression_pod(time, view, dimension, ret, &error); + if (!exprOk) { + setExpressionInvalid(dimension, false, error); + return false; + } else { + if (!exprWasValid) { + setExpressionInvalid(dimension, true, error); + } + } } if (clamp) { @@ -554,7 +584,7 @@ std::string Knob::getValueFromMasterAt(double time, ViewSpec view, int dimension, - KnobI* master) const + KnobI* master) { Knob* isString = dynamic_cast* >(master); assert(isString); //< other data types aren't supported @@ -570,7 +600,7 @@ std::string Knob::getValueFromMaster(ViewSpec view, int dimension, KnobI* master, - bool /*clamp*/) const + bool /*clamp*/) { Knob* isString = dynamic_cast* >(master); assert(isString); //< other data types aren't supported @@ -586,7 +616,7 @@ T Knob::getValueFromMasterAt(double time, ViewSpec view, int dimension, - KnobI* master) const + KnobI* master) { Knob* isInt = dynamic_cast* >(master); Knob* isBool = dynamic_cast* >(master); @@ -607,7 +637,7 @@ T Knob::getValueFromMaster(ViewSpec view, int dimension, KnobI* master, - bool clamp) const + bool clamp) { Knob* isInt = dynamic_cast* >(master); Knob* isBool = dynamic_cast* >(master); @@ -630,7 +660,7 @@ template T Knob::getValue(int dimension, ViewSpec view, - bool clamp) const + bool clamp) { assert(!view.isAll()); bool useGuiValues = QThread::currentThread() == qApp->thread(); @@ -683,7 +713,7 @@ Knob::getValueFromCurve(double time, bool useGuiCurve, bool byPassMaster, bool clamp, - T* ret) const + T* ret) { boost::shared_ptr curve; @@ -709,10 +739,10 @@ Knob::getValueFromCurve(double time, bool useGuiCurve, bool byPassMaster, bool /*clamp*/, - std::string* ret) const + std::string* ret) { - const AnimatingKnobStringHelper* isStringAnimated = dynamic_cast(this); + AnimatingKnobStringHelper* isStringAnimated = dynamic_cast(this); if (isStringAnimated) { *ret = isStringAnimated->getStringAtTime(time,view, dimension); ///ret is not empty if the animated string knob has a custom interpolation @@ -745,7 +775,7 @@ Knob::getValueAtTime(double time, int dimension, ViewSpec view, bool clamp, - bool byPassMaster) const + bool byPassMaster) { assert(!view.isAll()); if (dimension >= (int)_values.size() || dimension < 0) { @@ -792,7 +822,7 @@ template <> double Knob::getRawCurveValueAt(double time, ViewSpec view, - int dimension) const + int dimension) { boost::shared_ptr curve = getCurve(view, dimension,true); if (curve && curve->getKeyFramesCount() > 0) { @@ -806,7 +836,7 @@ template double Knob::getRawCurveValueAt(double time, ViewSpec view, - int dimension) const + int dimension) { boost::shared_ptr curve = getCurve(view, dimension,true); if (curve && curve->getKeyFramesCount() > 0) { @@ -822,10 +852,12 @@ template double Knob::getValueAtWithExpression(double time, ViewSpec view, - int dimension) const + int dimension) { + bool exprValid = isExpressionValid(dimension, 0); + std::string expr = getExpression(dimension); - if (!expr.empty()) { + if (!expr.empty() && exprValid) { double ret; if (getValueFromExpression_pod(time, /*view*/ ViewIdx(0), dimension,false, &ret)) { return ret; @@ -1599,7 +1631,7 @@ Knob::unSlave(int dimension, } } if (getHolder() && _signalSlotHandler) { - getHolder()->onKnobSlaved( this, master.second.get(),dimension,false ); + getHolder()->onKnobSlaved( shared_from_this(), master.second,dimension,false ); } if (masterHelper) { masterHelper->removeListener(this, dimension); @@ -1971,7 +2003,7 @@ template double Knob::getDerivativeAtTime(double time, ViewSpec view, - int dimension) const + int dimension) { if ( ( dimension > getDimension() ) || (dimension < 0) ) { throw std::invalid_argument("Knob::getDerivativeAtTime(): Dimension out of range"); @@ -2003,7 +2035,7 @@ template<> double Knob::getDerivativeAtTime(double /*time*/, ViewSpec /*view*/, - int /*dimension*/) const + int /*dimension*/) { throw std::invalid_argument("Knob::getDerivativeAtTime() not available"); } @@ -2015,7 +2047,7 @@ double Knob::getIntegrateFromTimeToTimeSimpson(double time1, double time2, ViewSpec view, - int dimension) const + int dimension) { double fa = getValueAtTime(time1, dimension, view); double fm = getValueAtTime((time1+time2)/2, dimension, view); @@ -2028,7 +2060,7 @@ double Knob::getIntegrateFromTimeToTime(double time1, double time2, ViewSpec view, - int dimension) const + int dimension) { if ( ( dimension > getDimension() ) || (dimension < 0) ) { throw std::invalid_argument("Knob::getIntegrateFromTimeToTime(): Dimension out of range"); @@ -2088,7 +2120,7 @@ double Knob::getIntegrateFromTimeToTimeSimpson(double /*time1*/, double /*time2*/, ViewSpec /*view*/, - int /*dimension*/) const + int /*dimension*/) { return 0; // dummy value } @@ -2098,7 +2130,7 @@ double Knob::getIntegrateFromTimeToTime(double /*time1*/, double /*time2*/, ViewSpec /*view*/, - int /*dimension*/) const + int /*dimension*/) { throw std::invalid_argument("Knob::getIntegrateFromTimeToTime() not available"); } @@ -2771,6 +2803,14 @@ Knob::dequeueValuesSet(bool disableEvaluation) return ret; } +template +bool Knob::computeValuesHaveModifications(int /*dimension*/, + const T& value, + const T& defaultValue) const +{ + return value != defaultValue; +} + template void Knob::computeHasModifications() { @@ -2800,7 +2840,7 @@ void Knob::computeHasModifications() ///Check expressions too in the future if (!hasModif) { QMutexLocker k(&_valueMutex); - if (_values[i] != _defaultValues[i]) { + if (computeValuesHaveModifications(i, _values[i], _defaultValues[i])) { hasModif = true; } } diff --git a/Engine/KnobSerialization.cpp b/Engine/KnobSerialization.cpp index 88f0c09051..c434724447 100644 --- a/Engine/KnobSerialization.cpp +++ b/Engine/KnobSerialization.cpp @@ -114,6 +114,8 @@ KnobPtr KnobSerialization::createKnob(const std::string & typeName, ret.reset( new KnobColor(NULL,"",dimension,false) ); } else if ( typeName == KnobPath::typeNameStatic() ) { ret.reset( new KnobPath(NULL,"",dimension,false) ); + } else if ( typeName == KnobLayers::typeNameStatic() ) { + ret.reset( new KnobLayers(NULL,"",dimension,false) ); } else if ( typeName == KnobFile::typeNameStatic() ) { ret.reset( new KnobFile(NULL,"",dimension,false) ); } else if ( typeName == KnobOutputFile::typeNameStatic() ) { diff --git a/Engine/KnobTypes.cpp b/Engine/KnobTypes.cpp index 5f0cf1032a..ec6dece222 100644 --- a/Engine/KnobTypes.cpp +++ b/Engine/KnobTypes.cpp @@ -49,6 +49,7 @@ GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_ON #include "Engine/KnobFile.h" #include "Engine/KnobSerialization.h" #include "Engine/Node.h" +#include "Engine/Project.h" #include "Engine/RotoContext.h" #include "Engine/TimeLine.h" #include "Engine/Transform.h" @@ -506,6 +507,20 @@ KnobDouble::normalize(int dimension, } } +bool +KnobDouble::computeValuesHaveModifications(int dimension, + const double& value, + const double& defaultValue) const +{ + if (_defaultValuesAreNormalized) { + double tmp = defaultValue; + denormalize(dimension, 0, &tmp); + return value != tmp; + } else { + return value != defaultValue; + } +} + /******************************KnobButton**************************************/ KnobButton::KnobButton(KnobHolder* holder, @@ -553,6 +568,7 @@ KnobChoice::KnobChoice(KnobHolder* holder, bool declaredByPlugin) : Knob(holder, label, dimension, declaredByPlugin) , _entriesMutex() +, _currentEntryLabel() , _addNewChoice(false) , _isCascading(false) { @@ -593,6 +609,49 @@ KnobChoice::typeName() const return typeNameStatic(); } +void +KnobChoice::cloneExtraData(KnobI* other,int /*dimension*/) +{ + KnobChoice* isChoice = dynamic_cast(other); + if (!isChoice) { + return; + } + + QMutexLocker k(&_entriesMutex); + _currentEntryLabel = isChoice->getActiveEntryText_mt_safe(); +} + +bool +KnobChoice::cloneExtraDataAndCheckIfChanged(KnobI* other,int /*dimension*/) +{ + KnobChoice* isChoice = dynamic_cast(other); + if (!isChoice) { + return false; + } + + QMutexLocker k(&_entriesMutex); + std::string otherEntry = isChoice->getActiveEntryText_mt_safe(); + if (_currentEntryLabel != otherEntry) { + _currentEntryLabel = otherEntry; + return true; + } + return false; +} + +void +KnobChoice::cloneExtraData(KnobI* other, double /*offset*/, const RangeD* /*range*/,int /*dimension*/) +{ + KnobChoice* isChoice = dynamic_cast(other); + if (!isChoice) { + return; + } + + QMutexLocker k(&_entriesMutex); + _currentEntryLabel = isChoice->getActiveEntryText_mt_safe(); + +} + + #ifdef DEBUG #pragma message WARN("When enabling multi-view knobs, make this multi-view too") #endif @@ -602,52 +661,165 @@ KnobChoice::onInternalValueChanged(int /*dimension*/, double time, ViewSpec /*vi int index = getValueAtTime(time, 0); QMutexLocker k(&_entriesMutex); - if (index >= 0 && index < (int)_entries.size()) { - _lastValidEntry = _entries[index]; + if (index >= 0 && index < (int)_mergedEntries.size()) { + _currentEntryLabel = _mergedEntries[index]; + } +} + +static bool caseInsensitiveCompare(const std::string& a, const std::string& b) +{ + if (a.size() != b.size()) { + return false; + } + std::locale loc; + for (std::size_t i = 0; i < a.size(); ++i) { + char aLow = std::tolower(a[i],loc); + char bLow = std::tolower(b[i],loc); + if (aLow != bLow) { + return false; + } } + return true; +} + +static bool stringEqualFunctor(const std::string& a, const std::string& b, KnobChoiceMergeEntriesData* /*data*/) +{ + return a == b; } void -KnobChoice::findAndSetOldChoice(const std::vector& newEntries) +KnobChoice::findAndSetOldChoice(MergeMenuEqualityFunctor mergingFunctor, + KnobChoiceMergeEntriesData* mergingData) { std::string curEntry; { QMutexLocker k(&_entriesMutex); - curEntry = _lastValidEntry; + curEntry = _currentEntryLabel; } if (!curEntry.empty()) { - for (std::size_t i = 0; i < newEntries.size(); ++i) { - if (newEntries[i] == curEntry) { - blockValueChanges(); - setValue((int)i); - unblockValueChanges(); - break; + + if (mergingFunctor) { + assert(mergingData); + mergingData->clear(); + } else { + mergingFunctor = stringEqualFunctor; + } + int found = -1; + { + QMutexLocker k(&_entriesMutex); + for (std::size_t i = 0; i < _mergedEntries.size(); ++i) { + if (mergingFunctor(_mergedEntries[i],curEntry, mergingData)) { + found = i; + + // Update the label if different + _currentEntryLabel = _mergedEntries[i]; + break; + } } } + if (found != -1) { + blockValueChanges(); + setValue(found); + unblockValueChanges(); + } else { + /*// We are in invalid state + blockValueChanges(); + setValue(-1); + unblockValueChanges();*/ + } } } -/*Must be called right away after the constructor.*/ -void + + +bool KnobChoice::populateChoices(const std::vector &entries, - const std::vector &entriesHelp) + const std::vector &entriesHelp, + MergeMenuEqualityFunctor mergingFunctor, + KnobChoiceMergeEntriesData* mergingData, + bool restoreOldChoice) { assert( entriesHelp.empty() || entriesHelp.size() == entries.size() ); + bool hasChanged; { QMutexLocker l(&_entriesMutex); - _entriesHelp = entriesHelp; - _entries = entries; + + _newEntries = entries; + if (!entriesHelp.empty()) { + _newEntriesHelp = entriesHelp; + } else { + _newEntriesHelp.resize(entries.size()); + } + if (mergingFunctor) { + assert(mergingData); + for (std::size_t i = 0; i < entries.size(); ++i) { + + mergingData->clear(); + bool found = false; + for (std::size_t j = 0; j < _mergedEntries.size(); ++j) { + if (mergingFunctor(_mergedEntries[j],entries[i], mergingData)) { + if (_mergedEntries[j] != entries[i]) { + hasChanged = true; + _mergedEntries[j] = entries[i]; + } + found = true; + break; + } + } + if (!found) { + hasChanged = true; + if (i < (int)_newEntriesHelp.size()) { + _mergedEntriesHelp.push_back(_newEntriesHelp[i]); + } + _mergedEntries.push_back(entries[i]); + } + } + + } else { + _mergedEntries = _newEntries; + _mergedEntriesHelp = _newEntriesHelp; + hasChanged = true; + } } /* - Try to restore the last choice. - This has been commented-out because it will loose the user choice in case of alias knobs + Try to restore the last choice. */ - //findAndSetOldChoice(entries); - - if (_signalSlotHandler) { - _signalSlotHandler->s_helpChanged(); + if (hasChanged) { + if (restoreOldChoice) { + findAndSetOldChoice(mergingFunctor, mergingData); + } + + if (_signalSlotHandler) { + _signalSlotHandler->s_helpChanged(); + } + Q_EMIT populated(); + } + return hasChanged; +} + + +void +KnobChoice::refreshMenu() +{ + KnobHolder* holder = getHolder(); + if (holder) { + // In OpenFX we reset the menu with a button + KnobPtr hasRefreshButton = holder->getKnobByName(getName() + "RefreshButton"); + if (hasRefreshButton) { + KnobButton* button = dynamic_cast(hasRefreshButton.get()); + button->trigger(); + return; + } + } + std::vector entries; + { + QMutexLocker l(&_entriesMutex); + + _mergedEntries = _newEntries; + _mergedEntriesHelp = _newEntriesHelp; } + findAndSetOldChoice(); Q_EMIT populated(); } @@ -656,9 +828,13 @@ KnobChoice::resetChoices() { { QMutexLocker l(&_entriesMutex); - _entries.clear(); - _entriesHelp.clear(); + _newEntries.clear(); + _newEntriesHelp.clear(); + _mergedEntries.clear(); + _mergedEntriesHelp.clear(); + } + findAndSetOldChoice(); if (_signalSlotHandler) { _signalSlotHandler->s_helpChanged(); } @@ -668,60 +844,83 @@ KnobChoice::resetChoices() void KnobChoice::appendChoice(const std::string& entry, const std::string& help) { - std::vector curEntries,newEntries; { QMutexLocker l(&_entriesMutex); - _entriesHelp.push_back(help); - _entries.push_back(entry); - newEntries = _entries; + + _mergedEntriesHelp.push_back(help); + _mergedEntries.push_back(entry); + _newEntries.push_back(entry); + _newEntriesHelp.push_back(help); + } - //findAndSetOldChoice(newEntries); - + findAndSetOldChoice(); if (_signalSlotHandler) { _signalSlotHandler->s_helpChanged(); } Q_EMIT entryAppended(QString::fromUtf8(entry.c_str()), QString::fromUtf8(help.c_str())); + } std::vector KnobChoice::getEntries_mt_safe() const { QMutexLocker l(&_entriesMutex); - return _entries; + return _mergedEntries; +} + +bool +KnobChoice::isActiveEntryPresentInEntries() const +{ + + QMutexLocker k(&_entriesMutex); + if (_currentEntryLabel.empty()) { + return true; + } + for (std::size_t i = 0; i < _newEntries.size(); ++i) { + if (_newEntries[i] == _currentEntryLabel) { + return true; + } + } + return false; } const std::string& KnobChoice::getEntry(int v) const { - if (v < 0 || (int)_entries.size() <= v) { + assert(v != -1); // use getActiveEntryText_mt_safe() otherwise + if ((int)_mergedEntries.size() <= v) { throw std::runtime_error(std::string("KnobChoice::getEntry: index out of range")); } - return _entries[v]; + return _mergedEntries[v]; } int KnobChoice::getNumEntries() const { QMutexLocker l(&_entriesMutex); - return (int)_entries.size(); + return (int)_mergedEntries.size(); } std::vector KnobChoice::getEntriesHelp_mt_safe() const { QMutexLocker l(&_entriesMutex); - return _entriesHelp; + return _mergedEntriesHelp; } std::string -KnobChoice::getActiveEntryText_mt_safe() const +KnobChoice::getActiveEntryText_mt_safe() { - int activeIndex = getValue(); + QMutexLocker l(&_entriesMutex); - if ( activeIndex < (int)_entries.size()) { - return _entries[activeIndex]; + if (!_currentEntryLabel.empty()) { + return _currentEntryLabel; + } + int activeIndex = getValue(); + if ( activeIndex < (int)_mergedEntries.size()) { + return _mergedEntries[activeIndex]; } return std::string(); @@ -764,10 +963,10 @@ KnobChoice::getHintToolTipFull() const int gothelp = 0; - if ( !_entriesHelp.empty() ) { - assert( _entriesHelp.size() == _entries.size() ); - for (U32 i = 0; i < _entries.size(); ++i) { - if ( !_entriesHelp.empty() && !_entriesHelp[i].empty() ) { + if ( !_mergedEntriesHelp.empty() ) { + assert( _mergedEntriesHelp.size() == _mergedEntries.size() ); + for (U32 i = 0; i < _mergedEntries.size(); ++i) { + if ( !_mergedEntriesHelp.empty() && !_mergedEntriesHelp[i].empty() ) { ++gothelp; } } @@ -787,16 +986,16 @@ KnobChoice::getHintToolTipFull() const } // param may have no hint but still have per-option help if (gothelp) { - for (U32 i = 0; i < _entriesHelp.size(); ++i) { - if ( !_entriesHelp[i].empty() ) { // no help line is needed if help is unavailable for this option - std::string entry = trim(_entries[i]); + for (U32 i = 0; i < _mergedEntriesHelp.size(); ++i) { + if ( !_mergedEntriesHelp[i].empty() ) { // no help line is needed if help is unavailable for this option + std::string entry = trim(_mergedEntries[i]); whitespacify(entry); - std::string help = trim(_entriesHelp[i]); + std::string help = trim(_mergedEntriesHelp[i]); whitespacify(help); ss << entry; ss << ": "; ss << help; - if (i < _entriesHelp.size() - 1) { + if (i < _mergedEntriesHelp.size() - 1) { ss << '\n'; } } @@ -806,46 +1005,35 @@ KnobChoice::getHintToolTipFull() const return ss.str(); } -static bool caseInsensitiveCompare(const std::string& a,const std::string& b) -{ - if (a.size() != b.size()) { - return false; - } - std::locale loc; - for (std::size_t i = 0; i < a.size(); ++i) { - char aLow = std::tolower(a[i],loc); - char bLow = std::tolower(b[i],loc); - if (aLow != bLow) { - return false; - } - } - return true; -} KnobHelper::ValueChangedReturnCodeEnum KnobChoice::setValueFromLabel(const std::string & value, int dimension, bool turnOffAutoKeying) { - for (std::size_t i = 0; i < _entries.size(); ++i) { - if (caseInsensitiveCompare(_entries[i], value)) { + for (std::size_t i = 0; i < _mergedEntries.size(); ++i) { + if (caseInsensitiveCompare(_mergedEntries[i], value)) { return setValue(i, ViewIdx(0), dimension, turnOffAutoKeying); } } - return KnobHelper::eValueChangedReturnCodeNothingChanged; - //throw std::runtime_error(std::string("KnobChoice::setValueFromLabel: unknown label ") + value); + /*{ + QMutexLocker k(&_entriesMutex); + _currentEntryLabel = value; + } + return setValue(-1, ViewIdx(0), dimension, turnOffAutoKeying);*/ + throw std::runtime_error(std::string("KnobChoice::setValueFromLabel: unknown label ") + value); } void KnobChoice::setDefaultValueFromLabel(const std::string & value, int dimension) { - for (std::size_t i = 0; i < _entries.size(); ++i) { - if (caseInsensitiveCompare(_entries[i], value)) { + for (std::size_t i = 0; i < _mergedEntries.size(); ++i) { + if (caseInsensitiveCompare(_mergedEntries[i], value)) { return setDefaultValue(i, dimension); } } - //throw std::runtime_error(std::string("KnobChoice::setDefaultValueFromLabel: unknown label ") + value); + throw std::runtime_error(std::string("KnobChoice::setDefaultValueFromLabel: unknown label ") + value); } void @@ -853,7 +1041,7 @@ KnobChoice::choiceRestoration(KnobChoice* knob,const ChoiceExtraData* data) { assert(knob && data); - + ///Clone first and then handle restoration of the static value clone(knob); setSecret( knob->getIsSecret() ); @@ -862,19 +1050,28 @@ KnobChoice::choiceRestoration(KnobChoice* knob,const ChoiceExtraData* data) setEnabled( i, knob->isEnabled(i) ); } } + + { + QMutexLocker k(&_entriesMutex); + _currentEntryLabel = data->_choiceString; + } int serializedIndex = knob->getValue(); - if ( ( serializedIndex < (int)_entries.size() ) && (_entries[serializedIndex] == data->_choiceString) ) { + if ((serializedIndex < (int)_mergedEntries.size()) && (_mergedEntries[serializedIndex] == data->_choiceString)) { // we're lucky, entry hasn't changed setValue(serializedIndex); } else { // try to find the same label at some other index - for (std::size_t i = 0; i < _entries.size(); ++i) { - if (caseInsensitiveCompare(_entries[i], data->_choiceString)) { + for (std::size_t i = 0; i < _mergedEntries.size(); ++i) { + if (caseInsensitiveCompare(_mergedEntries[i], data->_choiceString)) { setValue(i); return; } } + + + // setValue(-1); + } } @@ -887,7 +1084,7 @@ KnobChoice::onOriginalKnobPopulated() if (!isChoice) { return; } - populateChoices(isChoice->_entries,isChoice->_entriesHelp); + populateChoices(isChoice->_mergedEntries,isChoice->_mergedEntriesHelp, 0, 0, true); } void @@ -1060,7 +1257,7 @@ KnobString::typeName() const } bool -KnobString::hasContentWithoutHtmlTags() const +KnobString::hasContentWithoutHtmlTags() { std::string str = getValue(); if (str.empty()) { @@ -1781,6 +1978,227 @@ KnobParametric::hasModificationsVirtual(int dimension) const return false; } + + +KnobTable::KnobTable(KnobHolder* holder, + const std::string &description, + int dimension, + bool declaredByPlugin) +: Knob(holder,description,dimension,declaredByPlugin) +{ + +} + +KnobTable::~KnobTable() +{ + +} + +void +KnobTable::getTableSingleCol(std::list* table) +{ + std::list > tmp; + getTable(&tmp); + for (std::list >::iterator it = tmp.begin(); it!=tmp.end(); ++it) { + table->push_back((*it)[0]); + } +} + +void +KnobTable::getTable(std::list >* table) +{ + + decodeFromKnobTableFormat(getValue(), table); +} + +void +KnobTable::decodeFromKnobTableFormat(const std::string& value, std::list >* table) +{ + QString raw = QString::fromUtf8(value.c_str()); + if (raw.isEmpty()) { + return; + } + const int colsCount = getColumnsCount(); + assert(colsCount > 0); + + + + QString startTag = QString::fromUtf8("<%1>"); + QString endTag = QString::fromUtf8(""); + + int lastFoundIndex = 0; + + for (;;) { + + int colIndex = 0; + std::vector row; + bool mustStop = false; + while (colIndex < colsCount) { + + QString colLabel = QString::fromUtf8(getColumnLabel(colIndex).c_str()); + const QString startToFind = startTag.arg(colLabel); + const QString endToFind = endTag.arg(colLabel); + + lastFoundIndex = raw.indexOf(startToFind, lastFoundIndex); + if (lastFoundIndex == -1) { + mustStop = true; + break; + } + + lastFoundIndex += startToFind.size(); + assert(lastFoundIndex < raw.size()); + + int endNamePos = raw.indexOf(endToFind,lastFoundIndex); + assert(endNamePos != -1 && endNamePos < raw.size()); + + if (endNamePos == -1 || endNamePos >= raw.size()) { + throw std::logic_error("KnobTable: mal-formed table"); + } + + std::string value; + while (lastFoundIndex < endNamePos) { + value.push_back(raw[lastFoundIndex].toAscii()); + ++lastFoundIndex; + } + + // In order to use XML tags, the text inside the tags has to be unescaped. + value = Project::unescapeXML(value); + + row.push_back(value); + + ++colIndex; + } + + if (mustStop) { + break; + } + + if ((int)row.size() == colsCount) { + table->push_back(row); + } else { + throw std::logic_error("KnobTable: mal-formed table"); + } + + + } +} + +std::string +KnobTable::encodeToKnobTableFormatSingleCol(const std::list& table) +{ + std::list > tmp; + for (std::list::const_iterator it = table.begin(); it!=table.end(); ++it) { + std::vector vec; + vec.push_back(*it); + tmp.push_back(vec); + } + return encodeToKnobTableFormat(tmp); +} + + + +std::string +KnobTable::encodeToKnobTableFormat(const std::list >& table) +{ + std::stringstream ss; + + + for (std::list >::const_iterator it = table.begin(); it != table.end(); ++it) { + // In order to use XML tags, the text inside the tags has to be escaped. + for (std::size_t c = 0; c < it->size(); ++c) { + + std::string label = getColumnLabel(c); + ss << "<" << label << ">"; + ss << Project::escapeXML((*it)[c]); + ss << ""; + } + } + return ss.str(); + +} + +void +KnobTable::setTableSingleCol(const std::list& table) +{ + std::list > tmp; + for (std::list::const_iterator it = table.begin(); it!=table.end(); ++it) { + std::vector vec; + vec.push_back(*it); + tmp.push_back(vec); + } + setTable(tmp); +} + +void +KnobTable::setTable(const std::list >& table) +{ + setValue(encodeToKnobTableFormat(table)); +} + +void +KnobTable::appendRowSingleCol(const std::string& row) +{ + std::vector tmp; + tmp.push_back(row); + appendRow(tmp); +} + +void +KnobTable::appendRow(const std::vector& row) +{ + std::list > table; + getTable(&table); + table.push_back(row); + setTable(table); +} + +void +KnobTable::insertRowSingleCol(int index, const std::string& row) +{ + std::vector tmp; + tmp.push_back(row); + insertRow(index, tmp); +} + +void +KnobTable::insertRow(int index, const std::vector& row) +{ + std::list > table; + getTable(&table); + if (index < 0 || index >= (int)table.size()) { + table.push_back(row); + } else { + std::list >::iterator pos = table.begin(); + std::advance(pos, index); + table.insert(pos, row); + } + + setTable(table); +} + +void +KnobTable::removeRow(int index) +{ + std::list > table; + getTable(&table); + if (index < 0 || index >= (int)table.size()) { + return; + } + std::list >::iterator pos = table.begin(); + std::advance(pos, index); + table.erase(pos); + setTable(table); +} + + +const std::string KnobLayers::_typeNameStr("Layers"); + +const std::string& +KnobLayers::typeNameStatic() +{ + return _typeNameStr; +} + NATRON_NAMESPACE_EXIT; NATRON_NAMESPACE_USING; diff --git a/Engine/KnobTypes.h b/Engine/KnobTypes.h index 8c5198c360..f528336f65 100644 --- a/Engine/KnobTypes.h +++ b/Engine/KnobTypes.h @@ -309,6 +309,10 @@ public Q_SLOTS: private: + virtual bool computeValuesHaveModifications(int dimension, + const double& value, + const double& defaultValue) const OVERRIDE FINAL; + virtual bool canAnimate() const OVERRIDE FINAL; virtual const std::string & typeName() const OVERRIDE FINAL; @@ -387,6 +391,21 @@ class KnobButton }; /******************************KnobChoice**************************************/ +class KnobChoiceMergeEntriesData +{ +public: + + KnobChoiceMergeEntriesData() + { + + } + + virtual void clear() = 0; + + virtual ~KnobChoiceMergeEntriesData() { + + } +}; class KnobChoice : public QObject,public Knob @@ -396,6 +415,13 @@ GCC_DIAG_SUGGEST_OVERRIDE_OFF GCC_DIAG_SUGGEST_OVERRIDE_ON public: + + // Used in populateChoices() to add new entries in the menu. If not passed the entries will be completly replaced. + // It should return wether a equals b. The userData are the one passed to populateChoice and can be used to store temporary + // potentially costly operations. + // The clear() function will be called right before attempting to compare the first member of the entries to merge to b. + // Then throughout the cycling of the internal entries, b will remain at the same value and temporary data can be used. + typedef bool (*MergeMenuEqualityFunctor)(const std::string& a, const std::string& b, KnobChoiceMergeEntriesData* userData); static KnobHelper * BuildKnob(KnobHolder* holder, const std::string &label, @@ -412,17 +438,33 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON virtual ~KnobChoice(); - /*Must be called right away after the constructor.*/ - void populateChoices( const std::vector &entries, const std::vector &entriesHelp = std::vector() ); + /** + * @brief Fills-up the menu with the given entries and optionnally their tooltip. + * @param entriesHelp Can either be empty, meaning no-tooltip or must be of the size of the entries. + * @param mergingFunctor If not set, the internal menu will be completely reset and replaced with the given entries. + * Otherwise the internal menu entries will be merged with the given entries according to this equality functor. + * @param mergingData Can be passed when mergingFunctor is not null to speed up the comparisons. + * + * @returns true if something changed, false otherwise. + **/ + bool populateChoices(const std::vector &entries, + const std::vector &entriesHelp = std::vector(), + MergeMenuEqualityFunctor mergingFunctor = 0, + KnobChoiceMergeEntriesData* mergingData = 0, + bool restoreOldChoice = true); void resetChoices(); void appendChoice(const std::string& entry, const std::string& help = std::string()); + void refreshMenu(); + + bool isActiveEntryPresentInEntries() const; + std::vector getEntries_mt_safe() const; const std::string& getEntry(int v) const; std::vector getEntriesHelp_mt_safe() const; - std::string getActiveEntryText_mt_safe() const; + std::string getActiveEntryText_mt_safe() ; int getNumEntries() const; @@ -478,21 +520,26 @@ public Q_SLOTS: private: - - void findAndSetOldChoice(const std::vector& newEntries); + void findAndSetOldChoice(MergeMenuEqualityFunctor mergingFunctor = 0, + KnobChoiceMergeEntriesData* mergingData = 0); virtual bool canAnimate() const OVERRIDE FINAL; virtual const std::string & typeName() const OVERRIDE FINAL; virtual void handleSignalSlotsForAliasLink(const KnobPtr& alias,bool connect) OVERRIDE FINAL; virtual void onInternalValueChanged(int dimension, double time, ViewSpec view) OVERRIDE FINAL; + virtual void cloneExtraData(KnobI* other,int dimension = -1) OVERRIDE FINAL; + virtual bool cloneExtraDataAndCheckIfChanged(KnobI* other,int dimension = -1) OVERRIDE FINAL; + virtual void cloneExtraData(KnobI* other, double offset, const RangeD* range,int dimension = -1) OVERRIDE FINAL; private: mutable QMutex _entriesMutex; - std::vector _entries; - std::vector _entriesHelp; + std::vector _newEntries,_mergedEntries; + - std::string _lastValidEntry; // protected by _entriesMutex + std::vector _newEntriesHelp,_mergedEntriesHelp; + + std::string _currentEntryLabel; // protected by _entriesMutex bool _addNewChoice; static const std::string _typeNameStr; bool _isCascading; @@ -692,7 +739,7 @@ class KnobString * @brief Relevant for multi-lines with rich text enables. It tells if * the string has content without the html tags **/ - bool hasContentWithoutHtmlTags() const; + bool hasContentWithoutHtmlTags() ; private: @@ -919,6 +966,132 @@ public Q_SLOTS: static const std::string _typeNameStr; }; +/** + * @brief A Table containing strings. The number of columns is static. + **/ +class KnobTable +: public Knob +{ + +public: + + + KnobTable(KnobHolder* holder, + const std::string &description, + int dimension, + bool declaredByPlugin); + + virtual ~KnobTable(); + + void getTable(std::list >* table); + void getTableSingleCol(std::list* table); + + void decodeFromKnobTableFormat(const std::string& value, std::list >* table); + std::string encodeToKnobTableFormat(const std::list >& table); + std::string encodeToKnobTableFormatSingleCol(const std::list& table); + + void setTable(const std::list >& table); + void setTableSingleCol(const std::list& table); + void appendRow(const std::vector& row); + void appendRowSingleCol(const std::string& row); + void insertRow(int index, const std::vector& row); + void insertRowSingleCol(int index, const std::string& row); + void removeRow(int index); + + virtual int getColumnsCount() const = 0; + + virtual std::string getColumnLabel(int col) const = 0; + + virtual bool isCellEnabled(int row, int col, const QStringList& values) const = 0; + + virtual bool isCellBracketDecorated(int /*row*/, int /*col*/) const { + return false; + } + + virtual bool isColumnEditable(int /*col*/) { + return true; + } + + virtual bool useEditButton() const + { + return true; + } + +private: + + + virtual bool canAnimate() const OVERRIDE FINAL { + return false; + } + +}; + +class KnobLayers +: public KnobTable +{ + +public: + + static KnobHelper * BuildKnob(KnobHolder* holder, + const std::string &label, + int dimension, + bool declaredByPlugin = true) + { + return new KnobLayers(holder, label, dimension, declaredByPlugin); + } + + KnobLayers(KnobHolder* holder, + const std::string &description, + int dimension, + bool declaredByPlugin) + : KnobTable(holder, description, dimension, declaredByPlugin) + { + + } + + virtual ~KnobLayers() + { + + } + + virtual int getColumnsCount() const OVERRIDE FINAL + { + return 2; + } + + virtual std::string getColumnLabel(int col) const OVERRIDE FINAL + { + if (col == 0) { + return "Name"; + } else if (col == 1) { + return "Channels"; + } else { + return ""; + } + } + + virtual bool isCellEnabled(int /*row*/, int /*col*/, const QStringList& /*values*/) const OVERRIDE FINAL WARN_UNUSED_RETURN { + return true; + } + + virtual bool isColumnEditable(int col) OVERRIDE FINAL WARN_UNUSED_RETURN { + if (col == 1) { + return false; + } + return true; + } + + static const std::string & typeNameStatic() WARN_UNUSED_RETURN; + +private: + + virtual const std::string & typeName() const OVERRIDE FINAL + { + return typeNameStatic(); + } + static const std::string _typeNameStr; +}; + NATRON_NAMESPACE_EXIT; #endif // NATRON_ENGINE_KNOBTYPES_H diff --git a/Engine/NatronEngine/animatedparam_wrapper.cpp b/Engine/NatronEngine/animatedparam_wrapper.cpp index 576659aff1..8b708b3632 100644 --- a/Engine/NatronEngine/animatedparam_wrapper.cpp +++ b/Engine/NatronEngine/animatedparam_wrapper.cpp @@ -247,9 +247,9 @@ static PyObject* Sbk_AnimatedParamFunc_getExpression(PyObject* self, PyObject* p // Begin code injection bool hasRetVar; - std::string cppResult = cppSelf->getExpression(cppArg0,&hasRetVar); + QString cppResult = cppSelf->getExpression(cppArg0,&hasRetVar); pyResult = PyTuple_New(2); - PyTuple_SET_ITEM(pyResult, 0, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult)); + PyTuple_SET_ITEM(pyResult, 0, Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult)); PyTuple_SET_ITEM(pyResult, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &hasRetVar)); return pyResult; @@ -738,14 +738,14 @@ static PyObject* Sbk_AnimatedParamFunc_setExpression(PyObject* self, PyObject* a // Overloaded function decisor - // 0: setExpression(std::string,bool,int) + // 0: setExpression(QString,bool,int) if (numArgs >= 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { if (numArgs == 2) { - overloadId = 0; // setExpression(std::string,bool,int) + overloadId = 0; // setExpression(QString,bool,int) } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // setExpression(std::string,bool,int) + overloadId = 0; // setExpression(QString,bool,int) } } @@ -765,7 +765,7 @@ static PyObject* Sbk_AnimatedParamFunc_setExpression(PyObject* self, PyObject* a goto Sbk_AnimatedParamFunc_setExpression_TypeError; } } - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); bool cppArg1; pythonToCpp[1](pyArgs[1], &cppArg1); @@ -773,7 +773,7 @@ static PyObject* Sbk_AnimatedParamFunc_setExpression(PyObject* self, PyObject* a if (pythonToCpp[2]) pythonToCpp[2](pyArgs[2], &cppArg2); if (!PyErr_Occurred()) { - // setExpression(std::string,bool,int) + // setExpression(QString,bool,int) // Begin code injection bool cppResult = cppSelf->setExpression(cppArg0,cppArg1,cppArg2); @@ -792,7 +792,7 @@ static PyObject* Sbk_AnimatedParamFunc_setExpression(PyObject* self, PyObject* a return pyResult; Sbk_AnimatedParamFunc_setExpression_TypeError: - const char* overloads[] = {"std::string, bool, int = 0", 0}; + const char* overloads[] = {"unicode, bool, int = 0", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.AnimatedParam.setExpression", overloads); return 0; } diff --git a/Engine/NatronEngine/app_wrapper.cpp b/Engine/NatronEngine/app_wrapper.cpp index a440ac11b2..05f6be7f08 100644 --- a/Engine/NatronEngine/app_wrapper.cpp +++ b/Engine/NatronEngine/app_wrapper.cpp @@ -53,9 +53,9 @@ static PyObject* Sbk_AppFunc_addFormat(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: addFormat(std::string) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // addFormat(std::string) + // 0: addFormat(QString) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // addFormat(QString) } // Function signature not found. @@ -63,11 +63,11 @@ static PyObject* Sbk_AppFunc_addFormat(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // addFormat(std::string) + // addFormat(QString) cppSelf->addFormat(cppArg0); } } @@ -78,11 +78,60 @@ static PyObject* Sbk_AppFunc_addFormat(PyObject* self, PyObject* pyArg) Py_RETURN_NONE; Sbk_AppFunc_addFormat_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.App.addFormat", overloads); return 0; } +static PyObject* Sbk_AppFunc_addProjectLayer(PyObject* self, PyObject* pyArg) +{ + AppWrapper* cppSelf = 0; + SBK_UNUSED(cppSelf) + if (!Shiboken::Object::isValid(self)) + return 0; + cppSelf = (AppWrapper*)((::App*)Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APP_IDX], (SbkObject*)self)); + int overloadId = -1; + PythonToCppFunc pythonToCpp; + SBK_UNUSED(pythonToCpp) + + // Overloaded function decisor + // 0: addProjectLayer(ImageLayer) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppReferenceConvertible((SbkObjectType*)SbkNatronEngineTypes[SBK_IMAGELAYER_IDX], (pyArg)))) { + overloadId = 0; // addProjectLayer(ImageLayer) + } + + // Function signature not found. + if (overloadId == -1) goto Sbk_AppFunc_addProjectLayer_TypeError; + + // Call function/method + { + if (!Shiboken::Object::isValid(pyArg)) + return 0; + ::ImageLayer cppArg0_local = ::ImageLayer(::QString(), ::QString(), ::QStringList()); + ::ImageLayer* cppArg0 = &cppArg0_local; + if (Shiboken::Conversions::isImplicitConversion((SbkObjectType*)SbkNatronEngineTypes[SBK_IMAGELAYER_IDX], pythonToCpp)) + pythonToCpp(pyArg, &cppArg0_local); + else + pythonToCpp(pyArg, &cppArg0); + + + if (!PyErr_Occurred()) { + // addProjectLayer(ImageLayer) + cppSelf->addProjectLayer(*cppArg0); + } + } + + if (PyErr_Occurred()) { + return 0; + } + Py_RETURN_NONE; + + Sbk_AppFunc_addProjectLayer_TypeError: + const char* overloads[] = {"NatronEngine.ImageLayer", 0}; + Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.App.addProjectLayer", overloads); + return 0; +} + static PyObject* Sbk_AppFunc_closeProject(PyObject* self) { AppWrapper* cppSelf = 0; @@ -138,15 +187,15 @@ static PyObject* Sbk_AppFunc_createNode(PyObject* self, PyObject* args, PyObject // Overloaded function decisor - // 0: createNode(std::string,int,Group*)const - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { + // 0: createNode(QString,int,Group*)const + if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0])))) { if (numArgs == 1) { - overloadId = 0; // createNode(std::string,int,Group*)const + overloadId = 0; // createNode(QString,int,Group*)const } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { if (numArgs == 2) { - overloadId = 0; // createNode(std::string,int,Group*)const + overloadId = 0; // createNode(QString,int,Group*)const } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppPointerConvertible((SbkObjectType*)SbkNatronEngineTypes[SBK_GROUP_IDX], (pyArgs[2])))) { - overloadId = 0; // createNode(std::string,int,Group*)const + overloadId = 0; // createNode(QString,int,Group*)const } } } @@ -176,7 +225,7 @@ static PyObject* Sbk_AppFunc_createNode(PyObject* self, PyObject* args, PyObject goto Sbk_AppFunc_createNode_TypeError; } } - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); int cppArg1 = -1; if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); @@ -186,7 +235,7 @@ static PyObject* Sbk_AppFunc_createNode(PyObject* self, PyObject* args, PyObject if (pythonToCpp[2]) pythonToCpp[2](pyArgs[2], &cppArg2); if (!PyErr_Occurred()) { - // createNode(std::string,int,Group*)const + // createNode(QString,int,Group*)const // Begin code injection Effect * cppResult = cppSelf->createNode(cppArg0,cppArg1,cppArg2); @@ -208,7 +257,7 @@ static PyObject* Sbk_AppFunc_createNode(PyObject* self, PyObject* args, PyObject return pyResult; Sbk_AppFunc_createNode_TypeError: - const char* overloads[] = {"std::string, int = -1, NatronEngine.Group = None", 0}; + const char* overloads[] = {"unicode, int = -1, NatronEngine.Group = None", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.App.createNode", overloads); return 0; } @@ -242,12 +291,12 @@ static PyObject* Sbk_AppFunc_createReader(PyObject* self, PyObject* args, PyObje // Overloaded function decisor - // 0: createReader(std::string,Group*)const - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { + // 0: createReader(QString,Group*)const + if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0])))) { if (numArgs == 1) { - overloadId = 0; // createReader(std::string,Group*)const + overloadId = 0; // createReader(QString,Group*)const } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppPointerConvertible((SbkObjectType*)SbkNatronEngineTypes[SBK_GROUP_IDX], (pyArgs[1])))) { - overloadId = 0; // createReader(std::string,Group*)const + overloadId = 0; // createReader(QString,Group*)const } } @@ -267,7 +316,7 @@ static PyObject* Sbk_AppFunc_createReader(PyObject* self, PyObject* args, PyObje goto Sbk_AppFunc_createReader_TypeError; } } - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); if (!Shiboken::Object::isValid(pyArgs[1])) return 0; @@ -275,7 +324,7 @@ static PyObject* Sbk_AppFunc_createReader(PyObject* self, PyObject* args, PyObje if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // createReader(std::string,Group*)const + // createReader(QString,Group*)const // Begin code injection Effect * cppResult = cppSelf->createReader(cppArg0,cppArg1); @@ -297,7 +346,7 @@ static PyObject* Sbk_AppFunc_createReader(PyObject* self, PyObject* args, PyObje return pyResult; Sbk_AppFunc_createReader_TypeError: - const char* overloads[] = {"std::string, NatronEngine.Group = None", 0}; + const char* overloads[] = {"unicode, NatronEngine.Group = None", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.App.createReader", overloads); return 0; } @@ -331,12 +380,12 @@ static PyObject* Sbk_AppFunc_createWriter(PyObject* self, PyObject* args, PyObje // Overloaded function decisor - // 0: createWriter(std::string,Group*)const - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { + // 0: createWriter(QString,Group*)const + if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0])))) { if (numArgs == 1) { - overloadId = 0; // createWriter(std::string,Group*)const + overloadId = 0; // createWriter(QString,Group*)const } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppPointerConvertible((SbkObjectType*)SbkNatronEngineTypes[SBK_GROUP_IDX], (pyArgs[1])))) { - overloadId = 0; // createWriter(std::string,Group*)const + overloadId = 0; // createWriter(QString,Group*)const } } @@ -356,7 +405,7 @@ static PyObject* Sbk_AppFunc_createWriter(PyObject* self, PyObject* args, PyObje goto Sbk_AppFunc_createWriter_TypeError; } } - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); if (!Shiboken::Object::isValid(pyArgs[1])) return 0; @@ -364,7 +413,7 @@ static PyObject* Sbk_AppFunc_createWriter(PyObject* self, PyObject* args, PyObje if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // createWriter(std::string,Group*)const + // createWriter(QString,Group*)const // Begin code injection Effect * cppResult = cppSelf->createWriter(cppArg0,cppArg1); @@ -386,7 +435,7 @@ static PyObject* Sbk_AppFunc_createWriter(PyObject* self, PyObject* args, PyObje return pyResult; Sbk_AppFunc_createWriter_TypeError: - const char* overloads[] = {"std::string, NatronEngine.Group = None", 0}; + const char* overloads[] = {"unicode, NatronEngine.Group = None", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.App.createWriter", overloads); return 0; } @@ -430,9 +479,9 @@ static PyObject* Sbk_AppFunc_getProjectParam(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: getProjectParam(std::string)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getProjectParam(std::string)const + // 0: getProjectParam(QString)const + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // getProjectParam(QString)const } // Function signature not found. @@ -440,11 +489,11 @@ static PyObject* Sbk_AppFunc_getProjectParam(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // getProjectParam(std::string)const + // getProjectParam(QString)const Param * cppResult = const_cast(cppSelf)->getProjectParam(cppArg0); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_PARAM_IDX], cppResult); @@ -460,7 +509,7 @@ static PyObject* Sbk_AppFunc_getProjectParam(PyObject* self, PyObject* pyArg) return pyResult; Sbk_AppFunc_getProjectParam_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.App.getProjectParam", overloads); return 0; } @@ -479,8 +528,8 @@ static PyObject* Sbk_AppFunc_getViewNames(PyObject* self) if (!PyErr_Occurred()) { // getViewNames()const - std::list cppResult = const_cast(cppSelf)->getViewNames(); - pyResult = Shiboken::Conversions::copyToPython(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_STRING_IDX], &cppResult); + std::list cppResult = const_cast(cppSelf)->getViewNames(); + pyResult = Shiboken::Conversions::copyToPython(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_QSTRING_IDX], &cppResult); } } @@ -504,9 +553,9 @@ static PyObject* Sbk_AppFunc_loadProject(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: loadProject(std::string) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // loadProject(std::string) + // 0: loadProject(QString) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // loadProject(QString) } // Function signature not found. @@ -514,11 +563,11 @@ static PyObject* Sbk_AppFunc_loadProject(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // loadProject(std::string) + // loadProject(QString) // Begin code injection App * cppResult = cppSelf->loadProject(cppArg0); @@ -540,7 +589,7 @@ static PyObject* Sbk_AppFunc_loadProject(PyObject* self, PyObject* pyArg) return pyResult; Sbk_AppFunc_loadProject_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.App.loadProject", overloads); return 0; } @@ -770,9 +819,9 @@ static PyObject* Sbk_AppFunc_saveProject(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: saveProject(std::string) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // saveProject(std::string) + // 0: saveProject(QString) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // saveProject(QString) } // Function signature not found. @@ -780,11 +829,11 @@ static PyObject* Sbk_AppFunc_saveProject(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // saveProject(std::string) + // saveProject(QString) bool cppResult = cppSelf->saveProject(cppArg0); pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); } @@ -797,7 +846,7 @@ static PyObject* Sbk_AppFunc_saveProject(PyObject* self, PyObject* pyArg) return pyResult; Sbk_AppFunc_saveProject_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.App.saveProject", overloads); return 0; } @@ -815,9 +864,9 @@ static PyObject* Sbk_AppFunc_saveProjectAs(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: saveProjectAs(std::string) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // saveProjectAs(std::string) + // 0: saveProjectAs(QString) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // saveProjectAs(QString) } // Function signature not found. @@ -825,11 +874,11 @@ static PyObject* Sbk_AppFunc_saveProjectAs(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // saveProjectAs(std::string) + // saveProjectAs(QString) bool cppResult = cppSelf->saveProjectAs(cppArg0); pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); } @@ -842,7 +891,7 @@ static PyObject* Sbk_AppFunc_saveProjectAs(PyObject* self, PyObject* pyArg) return pyResult; Sbk_AppFunc_saveProjectAs_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.App.saveProjectAs", overloads); return 0; } @@ -860,9 +909,9 @@ static PyObject* Sbk_AppFunc_saveTempProject(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: saveTempProject(std::string) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // saveTempProject(std::string) + // 0: saveTempProject(QString) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // saveTempProject(QString) } // Function signature not found. @@ -870,11 +919,11 @@ static PyObject* Sbk_AppFunc_saveTempProject(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // saveTempProject(std::string) + // saveTempProject(QString) bool cppResult = cppSelf->saveTempProject(cppArg0); pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); } @@ -887,7 +936,7 @@ static PyObject* Sbk_AppFunc_saveTempProject(PyObject* self, PyObject* pyArg) return pyResult; Sbk_AppFunc_saveTempProject_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.App.saveTempProject", overloads); return 0; } @@ -982,9 +1031,9 @@ static PyObject* Sbk_AppFunc_writeToScriptEditor(PyObject* self, PyObject* pyArg SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: writeToScriptEditor(std::string) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // writeToScriptEditor(std::string) + // 0: writeToScriptEditor(QString) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // writeToScriptEditor(QString) } // Function signature not found. @@ -992,11 +1041,11 @@ static PyObject* Sbk_AppFunc_writeToScriptEditor(PyObject* self, PyObject* pyArg // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // writeToScriptEditor(std::string) + // writeToScriptEditor(QString) cppSelf->writeToScriptEditor(cppArg0); } } @@ -1007,13 +1056,14 @@ static PyObject* Sbk_AppFunc_writeToScriptEditor(PyObject* self, PyObject* pyArg Py_RETURN_NONE; Sbk_AppFunc_writeToScriptEditor_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.App.writeToScriptEditor", overloads); return 0; } static PyMethodDef Sbk_App_methods[] = { {"addFormat", (PyCFunction)Sbk_AppFunc_addFormat, METH_O}, + {"addProjectLayer", (PyCFunction)Sbk_AppFunc_addProjectLayer, METH_O}, {"closeProject", (PyCFunction)Sbk_AppFunc_closeProject, METH_NOARGS}, {"createNode", (PyCFunction)Sbk_AppFunc_createNode, METH_VARARGS|METH_KEYWORDS}, {"createReader", (PyCFunction)Sbk_AppFunc_createReader, METH_VARARGS|METH_KEYWORDS}, diff --git a/Engine/NatronEngine/appsettings_wrapper.cpp b/Engine/NatronEngine/appsettings_wrapper.cpp index d06b4af625..8a1df46418 100644 --- a/Engine/NatronEngine/appsettings_wrapper.cpp +++ b/Engine/NatronEngine/appsettings_wrapper.cpp @@ -40,9 +40,9 @@ static PyObject* Sbk_AppSettingsFunc_getParam(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: getParam(std::string)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getParam(std::string)const + // 0: getParam(QString)const + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // getParam(QString)const } // Function signature not found. @@ -50,11 +50,11 @@ static PyObject* Sbk_AppSettingsFunc_getParam(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // getParam(std::string)const + // getParam(QString)const Param * cppResult = const_cast(cppSelf)->getParam(cppArg0); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_PARAM_IDX], cppResult); @@ -70,7 +70,7 @@ static PyObject* Sbk_AppSettingsFunc_getParam(PyObject* self, PyObject* pyArg) return pyResult; Sbk_AppSettingsFunc_getParam_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.AppSettings.getParam", overloads); return 0; } diff --git a/Engine/NatronEngine/buttonparam_wrapper.cpp b/Engine/NatronEngine/buttonparam_wrapper.cpp index ef979e0f02..feab6cf815 100644 --- a/Engine/NatronEngine/buttonparam_wrapper.cpp +++ b/Engine/NatronEngine/buttonparam_wrapper.cpp @@ -49,9 +49,9 @@ static PyObject* Sbk_ButtonParamFunc_setIconFilePath(PyObject* self, PyObject* p SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: setIconFilePath(std::string) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setIconFilePath(std::string) + // 0: setIconFilePath(QString) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // setIconFilePath(QString) } // Function signature not found. @@ -59,11 +59,11 @@ static PyObject* Sbk_ButtonParamFunc_setIconFilePath(PyObject* self, PyObject* p // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // setIconFilePath(std::string) + // setIconFilePath(QString) cppSelf->setIconFilePath(cppArg0); } } @@ -74,7 +74,7 @@ static PyObject* Sbk_ButtonParamFunc_setIconFilePath(PyObject* self, PyObject* p Py_RETURN_NONE; Sbk_ButtonParamFunc_setIconFilePath_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ButtonParam.setIconFilePath", overloads); return 0; } diff --git a/Engine/NatronEngine/choiceparam_wrapper.cpp b/Engine/NatronEngine/choiceparam_wrapper.cpp index 0921b8d3a4..94324f586f 100644 --- a/Engine/NatronEngine/choiceparam_wrapper.cpp +++ b/Engine/NatronEngine/choiceparam_wrapper.cpp @@ -22,7 +22,6 @@ NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING #include #include #include -#include // Native --------------------------------------------------------- @@ -124,11 +123,11 @@ static PyObject* Sbk_ChoiceParamFunc_addOption(PyObject* self, PyObject* args) // Overloaded function decisor - // 0: addOption(std::string,std::string) + // 0: addOption(QString,QString) if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // addOption(std::string,std::string) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // addOption(QString,QString) } // Function signature not found. @@ -136,13 +135,13 @@ static PyObject* Sbk_ChoiceParamFunc_addOption(PyObject* self, PyObject* args) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // addOption(std::string,std::string) + // addOption(QString,QString) cppSelf->addOption(cppArg0, cppArg1); } } @@ -153,7 +152,7 @@ static PyObject* Sbk_ChoiceParamFunc_addOption(PyObject* self, PyObject* args) Py_RETURN_NONE; Sbk_ChoiceParamFunc_addOption_TypeError: - const char* overloads[] = {"std::string, std::string", 0}; + const char* overloads[] = {"unicode, unicode", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ChoiceParam.addOption", overloads); return 0; } @@ -310,8 +309,8 @@ static PyObject* Sbk_ChoiceParamFunc_getOption(PyObject* self, PyObject* pyArg) if (!PyErr_Occurred()) { // getOption(int)const - std::string cppResult = const_cast(cppSelf)->getOption(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = const_cast(cppSelf)->getOption(cppArg0); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -341,8 +340,8 @@ static PyObject* Sbk_ChoiceParamFunc_getOptions(PyObject* self) if (!PyErr_Occurred()) { // getOptions()const - std::vector cppResult = const_cast(cppSelf)->getOptions(); - pyResult = Shiboken::Conversions::copyToPython(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_STD_STRING_IDX], &cppResult); + QStringList cppResult = const_cast(cppSelf)->getOptions(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], &cppResult); } } @@ -468,7 +467,7 @@ static PyObject* Sbk_ChoiceParamFunc_set(PyObject* self, PyObject* args) // Overloaded function decisor - // 0: set(std::string) + // 0: set(QString) // 1: set(int) // 2: set(int,double) if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { @@ -479,8 +478,8 @@ static PyObject* Sbk_ChoiceParamFunc_set(PyObject* self, PyObject* args) overloadId = 2; // set(int,double) } } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // set(std::string) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0])))) { + overloadId = 0; // set(QString) } // Function signature not found. @@ -488,13 +487,13 @@ static PyObject* Sbk_ChoiceParamFunc_set(PyObject* self, PyObject* args) // Call function/method switch (overloadId) { - case 0: // set(const std::string & label) + case 0: // set(const QString & label) { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); if (!PyErr_Occurred()) { - // set(std::string) + // set(QString) cppSelf->set(cppArg0); } break; @@ -531,7 +530,7 @@ static PyObject* Sbk_ChoiceParamFunc_set(PyObject* self, PyObject* args) Py_RETURN_NONE; Sbk_ChoiceParamFunc_set_TypeError: - const char* overloads[] = {"std::string", "int", "int, float", 0}; + const char* overloads[] = {"unicode", "int", "int, float", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ChoiceParam.set", overloads); return 0; } @@ -548,12 +547,12 @@ static PyObject* Sbk_ChoiceParamFunc_setDefaultValue(PyObject* self, PyObject* p SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: setDefaultValue(std::string) + // 0: setDefaultValue(QString) // 1: setDefaultValue(int) if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { overloadId = 1; // setDefaultValue(int) - } else if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setDefaultValue(std::string) + } else if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // setDefaultValue(QString) } // Function signature not found. @@ -561,13 +560,13 @@ static PyObject* Sbk_ChoiceParamFunc_setDefaultValue(PyObject* self, PyObject* p // Call function/method switch (overloadId) { - case 0: // setDefaultValue(const std::string & value) + case 0: // setDefaultValue(const QString & value) { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // setDefaultValue(std::string) + // setDefaultValue(QString) cppSelf->setDefaultValue(cppArg0); } break; @@ -591,7 +590,7 @@ static PyObject* Sbk_ChoiceParamFunc_setDefaultValue(PyObject* self, PyObject* p Py_RETURN_NONE; Sbk_ChoiceParamFunc_setDefaultValue_TypeError: - const char* overloads[] = {"std::string", "int", 0}; + const char* overloads[] = {"unicode", "int", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ChoiceParam.setDefaultValue", overloads); return 0; } @@ -608,9 +607,9 @@ static PyObject* Sbk_ChoiceParamFunc_setOptions(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: setOptions(std::list >) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_PAIR_STD_STRING_STD_STRING_IDX], (pyArg)))) { - overloadId = 0; // setOptions(std::list >) + // 0: setOptions(std::list >) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_PAIR_QSTRING_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // setOptions(std::list >) } // Function signature not found. @@ -618,11 +617,11 @@ static PyObject* Sbk_ChoiceParamFunc_setOptions(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::list > cppArg0; + ::std::list > cppArg0; pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // setOptions(std::list >) + // setOptions(std::list >) cppSelf->setOptions(cppArg0); } } diff --git a/Engine/NatronEngine/effect_wrapper.cpp b/Engine/NatronEngine/effect_wrapper.cpp index 4145405330..6668195d1b 100644 --- a/Engine/NatronEngine/effect_wrapper.cpp +++ b/Engine/NatronEngine/effect_wrapper.cpp @@ -27,7 +27,6 @@ NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING #include #include #include -#include // Native --------------------------------------------------------- @@ -67,11 +66,11 @@ static PyObject* Sbk_EffectFunc_addUserPlane(PyObject* self, PyObject* args) // Overloaded function decisor - // 0: addUserPlane(std::string,std::vector) + // 0: addUserPlane(QString,QStringList) if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_STD_STRING_IDX], (pyArgs[1])))) { - overloadId = 0; // addUserPlane(std::string,std::vector) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], (pyArgs[1])))) { + overloadId = 0; // addUserPlane(QString,QStringList) } // Function signature not found. @@ -79,13 +78,13 @@ static PyObject* Sbk_EffectFunc_addUserPlane(PyObject* self, PyObject* args) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::vector cppArg1; + ::QStringList cppArg1 = ::QStringList(); pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // addUserPlane(std::string,std::vector) + // addUserPlane(QString,QStringList) bool cppResult = cppSelf->addUserPlane(cppArg0, cppArg1); pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); } @@ -98,7 +97,7 @@ static PyObject* Sbk_EffectFunc_addUserPlane(PyObject* self, PyObject* args) return pyResult; Sbk_EffectFunc_addUserPlane_TypeError: - const char* overloads[] = {"std::string, list", 0}; + const char* overloads[] = {"unicode, QStringList", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Effect.addUserPlane", overloads); return 0; } @@ -669,8 +668,8 @@ static PyObject* Sbk_EffectFunc_getInputLabel(PyObject* self, PyObject* pyArg) if (!PyErr_Occurred()) { // getInputLabel(int) - std::string cppResult = cppSelf->getInputLabel(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = cppSelf->getInputLabel(cppArg0); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -700,8 +699,8 @@ static PyObject* Sbk_EffectFunc_getLabel(PyObject* self) if (!PyErr_Occurred()) { // getLabel()const - std::string cppResult = const_cast(cppSelf)->getLabel(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = const_cast(cppSelf)->getLabel(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -751,9 +750,9 @@ static PyObject* Sbk_EffectFunc_getParam(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: getParam(std::string)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getParam(std::string)const + // 0: getParam(QString)const + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // getParam(QString)const } // Function signature not found. @@ -761,11 +760,11 @@ static PyObject* Sbk_EffectFunc_getParam(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // getParam(std::string)const + // getParam(QString)const Param * cppResult = const_cast(cppSelf)->getParam(cppArg0); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_PARAM_IDX], cppResult); @@ -781,7 +780,7 @@ static PyObject* Sbk_EffectFunc_getParam(PyObject* self, PyObject* pyArg) return pyResult; Sbk_EffectFunc_getParam_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Effect.getParam", overloads); return 0; } @@ -866,8 +865,8 @@ static PyObject* Sbk_EffectFunc_getPluginID(PyObject* self) if (!PyErr_Occurred()) { // getPluginID()const - std::string cppResult = const_cast(cppSelf)->getPluginID(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = const_cast(cppSelf)->getPluginID(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -1041,8 +1040,8 @@ static PyObject* Sbk_EffectFunc_getScriptName(PyObject* self) if (!PyErr_Occurred()) { // getScriptName()const - std::string cppResult = const_cast(cppSelf)->getScriptName(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = const_cast(cppSelf)->getScriptName(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -1243,9 +1242,9 @@ static PyObject* Sbk_EffectFunc_setLabel(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: setLabel(std::string) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setLabel(std::string) + // 0: setLabel(QString) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // setLabel(QString) } // Function signature not found. @@ -1253,11 +1252,11 @@ static PyObject* Sbk_EffectFunc_setLabel(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // setLabel(std::string) + // setLabel(QString) // Begin code injection cppSelf->setLabel(cppArg0); @@ -1274,7 +1273,7 @@ static PyObject* Sbk_EffectFunc_setLabel(PyObject* self, PyObject* pyArg) Py_RETURN_NONE; Sbk_EffectFunc_setLabel_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Effect.setLabel", overloads); return 0; } @@ -1291,9 +1290,9 @@ static PyObject* Sbk_EffectFunc_setPagesOrder(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: setPagesOrder(std::list) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_STRING_IDX], (pyArg)))) { - overloadId = 0; // setPagesOrder(std::list) + // 0: setPagesOrder(QStringList) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], (pyArg)))) { + overloadId = 0; // setPagesOrder(QStringList) } // Function signature not found. @@ -1301,11 +1300,11 @@ static PyObject* Sbk_EffectFunc_setPagesOrder(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::list cppArg0; + ::QStringList cppArg0 = ::QStringList(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // setPagesOrder(std::list) + // setPagesOrder(QStringList) cppSelf->setPagesOrder(cppArg0); } } @@ -1316,7 +1315,7 @@ static PyObject* Sbk_EffectFunc_setPagesOrder(PyObject* self, PyObject* pyArg) Py_RETURN_NONE; Sbk_EffectFunc_setPagesOrder_TypeError: - const char* overloads[] = {"list", 0}; + const char* overloads[] = {"QStringList", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Effect.setPagesOrder", overloads); return 0; } @@ -1389,9 +1388,9 @@ static PyObject* Sbk_EffectFunc_setScriptName(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: setScriptName(std::string) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setScriptName(std::string) + // 0: setScriptName(QString) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // setScriptName(QString) } // Function signature not found. @@ -1399,11 +1398,11 @@ static PyObject* Sbk_EffectFunc_setScriptName(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // setScriptName(std::string) + // setScriptName(QString) // Begin code injection bool cppResult = cppSelf->setScriptName(cppArg0); @@ -1422,7 +1421,7 @@ static PyObject* Sbk_EffectFunc_setScriptName(PyObject* self, PyObject* pyArg) return pyResult; Sbk_EffectFunc_setScriptName_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Effect.setScriptName", overloads); return 0; } diff --git a/Engine/NatronEngine/group_wrapper.cpp b/Engine/NatronEngine/group_wrapper.cpp index 838135099d..1d5e7d692b 100644 --- a/Engine/NatronEngine/group_wrapper.cpp +++ b/Engine/NatronEngine/group_wrapper.cpp @@ -125,9 +125,9 @@ static PyObject* Sbk_GroupFunc_getNode(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: getNode(std::string)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getNode(std::string)const + // 0: getNode(QString)const + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // getNode(QString)const } // Function signature not found. @@ -135,11 +135,11 @@ static PyObject* Sbk_GroupFunc_getNode(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // getNode(std::string)const + // getNode(QString)const Effect * cppResult = const_cast(cppSelf)->getNode(cppArg0); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_EFFECT_IDX], cppResult); @@ -155,7 +155,7 @@ static PyObject* Sbk_GroupFunc_getNode(PyObject* self, PyObject* pyArg) return pyResult; Sbk_GroupFunc_getNode_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Group.getNode", overloads); return 0; } diff --git a/Engine/NatronEngine/imagelayer_wrapper.cpp b/Engine/NatronEngine/imagelayer_wrapper.cpp index 9f0a13f476..100566e1f8 100644 --- a/Engine/NatronEngine/imagelayer_wrapper.cpp +++ b/Engine/NatronEngine/imagelayer_wrapper.cpp @@ -20,7 +20,6 @@ GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF // Extra includes NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING #include -#include @@ -51,12 +50,12 @@ Sbk_ImageLayer_Init(PyObject* self, PyObject* args, PyObject* kwds) // Overloaded function decisor // 0: ImageLayer(ImageLayer) - // 1: ImageLayer(std::string,std::string,std::vector) + // 1: ImageLayer(QString,QString,QStringList) if (numArgs == 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_STD_STRING_IDX], (pyArgs[2])))) { - overloadId = 1; // ImageLayer(std::string,std::string,std::vector) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1]))) + && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], (pyArgs[2])))) { + overloadId = 1; // ImageLayer(QString,QString,QStringList) } else if (numArgs == 1 && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppReferenceConvertible((SbkObjectType*)SbkNatronEngineTypes[SBK_IMAGELAYER_IDX], (pyArgs[0])))) { overloadId = 0; // ImageLayer(ImageLayer) @@ -71,7 +70,7 @@ Sbk_ImageLayer_Init(PyObject* self, PyObject* args, PyObject* kwds) { if (!Shiboken::Object::isValid(pyArgs[0])) return -1; - ::ImageLayer cppArg0_local = ::ImageLayer(::std::string(), ::std::string(), ::std::vector()); + ::ImageLayer cppArg0_local = ::ImageLayer(::QString(), ::QString(), ::QStringList()); ::ImageLayer* cppArg0 = &cppArg0_local; if (Shiboken::Conversions::isImplicitConversion((SbkObjectType*)SbkNatronEngineTypes[SBK_IMAGELAYER_IDX], pythonToCpp[0])) pythonToCpp[0](pyArgs[0], &cppArg0_local); @@ -85,17 +84,17 @@ Sbk_ImageLayer_Init(PyObject* self, PyObject* args, PyObject* kwds) } break; } - case 1: // ImageLayer(const std::string & layerName, const std::string & componentsPrettyName, const std::vector & componentsName) + case 1: // ImageLayer(const QString & layerName, const QString & componentsPrettyName, const QStringList & componentsName) { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); - ::std::vector cppArg2; + ::QStringList cppArg2 = ::QStringList(); pythonToCpp[2](pyArgs[2], &cppArg2); if (!PyErr_Occurred()) { - // ImageLayer(std::string,std::string,std::vector) + // ImageLayer(QString,QString,QStringList) cptr = new ::ImageLayer(cppArg0, cppArg1, cppArg2); } break; @@ -115,7 +114,7 @@ Sbk_ImageLayer_Init(PyObject* self, PyObject* args, PyObject* kwds) return 1; Sbk_ImageLayer_Init_TypeError: - const char* overloads[] = {"NatronEngine.ImageLayer", "std::string, std::string, list", 0}; + const char* overloads[] = {"NatronEngine.ImageLayer", "unicode, unicode, QStringList", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ImageLayer", overloads); return -1; } @@ -176,8 +175,8 @@ static PyObject* Sbk_ImageLayerFunc_getComponentsNames(PyObject* self) if (!PyErr_Occurred()) { // getComponentsNames()const - const std::vector & cppResult = const_cast(cppSelf)->getComponentsNames(); - pyResult = Shiboken::Conversions::copyToPython(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_STD_STRING_IDX], &cppResult); + const QStringList & cppResult = const_cast(cppSelf)->getComponentsNames(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], &cppResult); } } @@ -202,8 +201,8 @@ static PyObject* Sbk_ImageLayerFunc_getComponentsPrettyName(PyObject* self) if (!PyErr_Occurred()) { // getComponentsPrettyName()const - const std::string & cppResult = const_cast(cppSelf)->getComponentsPrettyName(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + const QString & cppResult = const_cast(cppSelf)->getComponentsPrettyName(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -297,7 +296,7 @@ static PyObject* Sbk_ImageLayerFunc_getHash(PyObject* self, PyObject* pyArg) { if (!Shiboken::Object::isValid(pyArg)) return 0; - ::ImageLayer cppArg0_local = ::ImageLayer(::std::string(), ::std::string(), ::std::vector()); + ::ImageLayer cppArg0_local = ::ImageLayer(::QString(), ::QString(), ::QStringList()); ::ImageLayer* cppArg0 = &cppArg0_local; if (Shiboken::Conversions::isImplicitConversion((SbkObjectType*)SbkNatronEngineTypes[SBK_IMAGELAYER_IDX], pythonToCpp)) pythonToCpp(pyArg, &cppArg0_local); @@ -338,8 +337,8 @@ static PyObject* Sbk_ImageLayerFunc_getLayerName(PyObject* self) if (!PyErr_Occurred()) { // getLayerName()const - const std::string & cppResult = const_cast(cppSelf)->getLayerName(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + const QString & cppResult = const_cast(cppSelf)->getLayerName(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -515,7 +514,7 @@ static PyObject* Sbk_ImageLayer_richcompare(PyObject* self, PyObject* pyArg, int // operator!=(const ImageLayer & other) const if (!Shiboken::Object::isValid(pyArg)) return 0; - ::ImageLayer cppArg0_local = ::ImageLayer(::std::string(), ::std::string(), ::std::vector()); + ::ImageLayer cppArg0_local = ::ImageLayer(::QString(), ::QString(), ::QStringList()); ::ImageLayer* cppArg0 = &cppArg0_local; if (Shiboken::Conversions::isImplicitConversion((SbkObjectType*)SbkNatronEngineTypes[SBK_IMAGELAYER_IDX], pythonToCpp)) pythonToCpp(pyArg, &cppArg0_local); @@ -535,7 +534,7 @@ static PyObject* Sbk_ImageLayer_richcompare(PyObject* self, PyObject* pyArg, int // operator<(const ImageLayer & other) const if (!Shiboken::Object::isValid(pyArg)) return 0; - ::ImageLayer cppArg0_local = ::ImageLayer(::std::string(), ::std::string(), ::std::vector()); + ::ImageLayer cppArg0_local = ::ImageLayer(::QString(), ::QString(), ::QStringList()); ::ImageLayer* cppArg0 = &cppArg0_local; if (Shiboken::Conversions::isImplicitConversion((SbkObjectType*)SbkNatronEngineTypes[SBK_IMAGELAYER_IDX], pythonToCpp)) pythonToCpp(pyArg, &cppArg0_local); @@ -554,7 +553,7 @@ static PyObject* Sbk_ImageLayer_richcompare(PyObject* self, PyObject* pyArg, int // operator==(const ImageLayer & other) const if (!Shiboken::Object::isValid(pyArg)) return 0; - ::ImageLayer cppArg0_local = ::ImageLayer(::std::string(), ::std::string(), ::std::vector()); + ::ImageLayer cppArg0_local = ::ImageLayer(::QString(), ::QString(), ::QStringList()); ::ImageLayer* cppArg0 = &cppArg0_local; if (Shiboken::Conversions::isImplicitConversion((SbkObjectType*)SbkNatronEngineTypes[SBK_IMAGELAYER_IDX], pythonToCpp)) pythonToCpp(pyArg, &cppArg0_local); diff --git a/Engine/NatronEngine/itembase_wrapper.cpp b/Engine/NatronEngine/itembase_wrapper.cpp index 6cf2d8fb23..cdaf7ad7fb 100644 --- a/Engine/NatronEngine/itembase_wrapper.cpp +++ b/Engine/NatronEngine/itembase_wrapper.cpp @@ -52,8 +52,8 @@ static PyObject* Sbk_ItemBaseFunc_getLabel(PyObject* self) if (!PyErr_Occurred()) { // getLabel()const - std::string cppResult = const_cast(cppSelf)->getLabel(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = const_cast(cppSelf)->getLabel(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -129,9 +129,9 @@ static PyObject* Sbk_ItemBaseFunc_getParam(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: getParam(std::string)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getParam(std::string)const + // 0: getParam(QString)const + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // getParam(QString)const } // Function signature not found. @@ -139,11 +139,11 @@ static PyObject* Sbk_ItemBaseFunc_getParam(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // getParam(std::string)const + // getParam(QString)const Param * cppResult = const_cast(cppSelf)->getParam(cppArg0); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_PARAM_IDX], cppResult); } @@ -156,7 +156,7 @@ static PyObject* Sbk_ItemBaseFunc_getParam(PyObject* self, PyObject* pyArg) return pyResult; Sbk_ItemBaseFunc_getParam_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ItemBase.getParam", overloads); return 0; } @@ -204,8 +204,8 @@ static PyObject* Sbk_ItemBaseFunc_getScriptName(PyObject* self) if (!PyErr_Occurred()) { // getScriptName()const - std::string cppResult = const_cast(cppSelf)->getScriptName(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = const_cast(cppSelf)->getScriptName(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -254,9 +254,9 @@ static PyObject* Sbk_ItemBaseFunc_setLabel(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: setLabel(std::string) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setLabel(std::string) + // 0: setLabel(QString) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // setLabel(QString) } // Function signature not found. @@ -264,11 +264,11 @@ static PyObject* Sbk_ItemBaseFunc_setLabel(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // setLabel(std::string) + // setLabel(QString) // Begin code injection cppSelf->setLabel(cppArg0); @@ -285,7 +285,7 @@ static PyObject* Sbk_ItemBaseFunc_setLabel(PyObject* self, PyObject* pyArg) Py_RETURN_NONE; Sbk_ItemBaseFunc_setLabel_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ItemBase.setLabel", overloads); return 0; } @@ -345,9 +345,9 @@ static PyObject* Sbk_ItemBaseFunc_setScriptName(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: setScriptName(std::string) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setScriptName(std::string) + // 0: setScriptName(QString) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // setScriptName(QString) } // Function signature not found. @@ -355,11 +355,11 @@ static PyObject* Sbk_ItemBaseFunc_setScriptName(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // setScriptName(std::string) + // setScriptName(QString) // Begin code injection bool cppResult = cppSelf->setScriptName(cppArg0); @@ -378,7 +378,7 @@ static PyObject* Sbk_ItemBaseFunc_setScriptName(PyObject* self, PyObject* pyArg) return pyResult; Sbk_ItemBaseFunc_setScriptName_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ItemBase.setScriptName", overloads); return 0; } diff --git a/Engine/NatronEngine/natronengine_module_wrapper.cpp b/Engine/NatronEngine/natronengine_module_wrapper.cpp index 4e85564c23..ad33903877 100644 --- a/Engine/NatronEngine/natronengine_module_wrapper.cpp +++ b/Engine/NatronEngine/natronengine_module_wrapper.cpp @@ -35,7 +35,6 @@ static PyMethodDef NatronEngine_methods[] = { }; // Classes initialization functions ------------------------------------------------------------ -void init_RectD(PyObject* module); void init_PyCoreApplication(PyObject* module); void init_Group(PyObject* module); void init_App(PyObject* module); @@ -51,9 +50,6 @@ void init_UserParamHolder(PyObject* module); void init_Effect(PyObject* module); void init_Param(PyObject* module); void init_AnimatedParam(PyObject* module); -void init_DoubleParam(PyObject* module); -void init_Double2DParam(PyObject* module); -void init_Double3DParam(PyObject* module); void init_ColorParam(PyObject* module); void init_ChoiceParam(PyObject* module); void init_BooleanParam(PyObject* module); @@ -65,6 +61,9 @@ void init_PathParam(PyObject* module); void init_IntParam(PyObject* module); void init_Int2DParam(PyObject* module); void init_Int3DParam(PyObject* module); +void init_DoubleParam(PyObject* module); +void init_Double2DParam(PyObject* module); +void init_Double3DParam(PyObject* module); void init_ButtonParam(PyObject* module); void init_SeparatorParam(PyObject* module); void init_GroupParam(PyObject* module); @@ -76,6 +75,7 @@ void init_Double2DTuple(PyObject* module); void init_Double3DTuple(PyObject* module); void init_ColorTuple(PyObject* module); void init_RectI(PyObject* module); +void init_RectD(PyObject* module); void init_NATRON_NAMESPACE(PyObject* module); // Required modules' type and converter arrays. @@ -144,96 +144,60 @@ static PythonToCppFunc is_std_vector_RectI__PythonToCpp_std_vector_RectI__Conver return 0; } -// C++ to Python conversion for type 'std::vector'. -static PyObject* std_vector_std_string__CppToPython_std_vector_std_string_(const void* cppIn) { - ::std::vector& cppInRef = *((::std::vector*)cppIn); - - // TEMPLATE - stdVectorToPyList - START - ::std::vector::size_type vectorSize = cppInRef.size(); - PyObject* pyOut = PyList_New((int) vectorSize); - for (::std::vector::size_type idx = 0; idx < vectorSize; ++idx) { - ::std::string cppItem(cppInRef[idx]); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppItem)); - } - return pyOut; - // TEMPLATE - stdVectorToPyList - END - -} -static void std_vector_std_string__PythonToCpp_std_vector_std_string_(PyObject* pyIn, void* cppOut) { - ::std::vector& cppOutRef = *((::std::vector*)cppOut); - - // TEMPLATE - pySeqToStdVector - START - int vectorSize = PySequence_Size(pyIn); - cppOutRef.reserve(vectorSize); - for (int idx = 0; idx < vectorSize; ++idx) { - Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, idx)); - ::std::string cppItem; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), pyItem, &(cppItem)); - cppOutRef.push_back(cppItem); - } - // TEMPLATE - pySeqToStdVector - END - -} -static PythonToCppFunc is_std_vector_std_string__PythonToCpp_std_vector_std_string__Convertible(PyObject* pyIn) { - if (Shiboken::Conversions::convertibleSequenceTypes(Shiboken::Conversions::PrimitiveTypeConverter(), pyIn)) - return std_vector_std_string__PythonToCpp_std_vector_std_string_; - return 0; -} - -// C++ to Python conversion for type 'std::pair'. -static PyObject* std_pair_std_string_std_string__CppToPython_std_pair_std_string_std_string_(const void* cppIn) { - ::std::pair& cppInRef = *((::std::pair*)cppIn); +// C++ to Python conversion for type 'std::pair'. +static PyObject* std_pair_QString_QString__CppToPython_std_pair_QString_QString_(const void* cppIn) { + ::std::pair& cppInRef = *((::std::pair*)cppIn); PyObject* pyOut = PyTuple_New(2); - PyTuple_SET_ITEM(pyOut, 0, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppInRef.first)); - PyTuple_SET_ITEM(pyOut, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppInRef.second)); + PyTuple_SET_ITEM(pyOut, 0, Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppInRef.first)); + PyTuple_SET_ITEM(pyOut, 1, Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppInRef.second)); return pyOut; } -static void std_pair_std_string_std_string__PythonToCpp_std_pair_std_string_std_string_(PyObject* pyIn, void* cppOut) { - ::std::pair& cppOutRef = *((::std::pair*)cppOut); +static void std_pair_QString_QString__PythonToCpp_std_pair_QString_QString_(PyObject* pyIn, void* cppOut) { + ::std::pair& cppOutRef = *((::std::pair*)cppOut); - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PySequence_Fast_GET_ITEM(pyIn, 0), &(cppOutRef.first)); - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PySequence_Fast_GET_ITEM(pyIn, 1), &(cppOutRef.second)); + Shiboken::Conversions::pythonToCppCopy(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], PySequence_Fast_GET_ITEM(pyIn, 0), &(cppOutRef.first)); + Shiboken::Conversions::pythonToCppCopy(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], PySequence_Fast_GET_ITEM(pyIn, 1), &(cppOutRef.second)); } -static PythonToCppFunc is_std_pair_std_string_std_string__PythonToCpp_std_pair_std_string_std_string__Convertible(PyObject* pyIn) { - if (Shiboken::Conversions::convertiblePairTypes(Shiboken::Conversions::PrimitiveTypeConverter(), false, Shiboken::Conversions::PrimitiveTypeConverter(), false, pyIn)) - return std_pair_std_string_std_string__PythonToCpp_std_pair_std_string_std_string_; +static PythonToCppFunc is_std_pair_QString_QString__PythonToCpp_std_pair_QString_QString__Convertible(PyObject* pyIn) { + if (Shiboken::Conversions::convertiblePairTypes(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], false, SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], false, pyIn)) + return std_pair_QString_QString__PythonToCpp_std_pair_QString_QString_; return 0; } -// C++ to Python conversion for type 'const std::list > &'. -static PyObject* conststd_list_std_pair_std_string_std_string__REF_CppToPython_conststd_list_std_pair_std_string_std_string__REF(const void* cppIn) { - ::std::list >& cppInRef = *((::std::list >*)cppIn); +// C++ to Python conversion for type 'const std::list > &'. +static PyObject* conststd_list_std_pair_QString_QString__REF_CppToPython_conststd_list_std_pair_QString_QString__REF(const void* cppIn) { + ::std::list >& cppInRef = *((::std::list >*)cppIn); // TEMPLATE - stdListToPyList - START PyObject* pyOut = PyList_New((int) cppInRef.size()); - ::std::list >::const_iterator it = cppInRef.begin(); + ::std::list >::const_iterator it = cppInRef.begin(); for (int idx = 0; it != cppInRef.end(); ++it, ++idx) { - ::std::pair cppItem(*it); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_PAIR_STD_STRING_STD_STRING_IDX], &cppItem)); + ::std::pair cppItem(*it); + PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_PAIR_QSTRING_QSTRING_IDX], &cppItem)); } return pyOut; // TEMPLATE - stdListToPyList - END } -static void conststd_list_std_pair_std_string_std_string__REF_PythonToCpp_conststd_list_std_pair_std_string_std_string__REF(PyObject* pyIn, void* cppOut) { - ::std::list >& cppOutRef = *((::std::list >*)cppOut); +static void conststd_list_std_pair_QString_QString__REF_PythonToCpp_conststd_list_std_pair_QString_QString__REF(PyObject* pyIn, void* cppOut) { + ::std::list >& cppOutRef = *((::std::list >*)cppOut); // TEMPLATE - pyListToStdList - START for (int i = 0; i < PySequence_Size(pyIn); i++) { Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, i)); - ::std::pair cppItem = ::std::pair(); - Shiboken::Conversions::pythonToCppCopy(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_PAIR_STD_STRING_STD_STRING_IDX], pyItem, &(cppItem)); + ::std::pair cppItem = ::std::pair(); + Shiboken::Conversions::pythonToCppCopy(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_PAIR_QSTRING_QSTRING_IDX], pyItem, &(cppItem)); cppOutRef.push_back(cppItem); } // TEMPLATE - pyListToStdList - END } -static PythonToCppFunc is_conststd_list_std_pair_std_string_std_string__REF_PythonToCpp_conststd_list_std_pair_std_string_std_string__REF_Convertible(PyObject* pyIn) { - if (Shiboken::Conversions::convertibleSequenceTypes(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_PAIR_STD_STRING_STD_STRING_IDX], pyIn)) - return conststd_list_std_pair_std_string_std_string__REF_PythonToCpp_conststd_list_std_pair_std_string_std_string__REF; +static PythonToCppFunc is_conststd_list_std_pair_QString_QString__REF_PythonToCpp_conststd_list_std_pair_QString_QString__REF_Convertible(PyObject* pyIn) { + if (Shiboken::Conversions::convertibleSequenceTypes(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_PAIR_QSTRING_QSTRING_IDX], pyIn)) + return conststd_list_std_pair_QString_QString__REF_PythonToCpp_conststd_list_std_pair_QString_QString__REF; return 0; } @@ -373,37 +337,37 @@ static PythonToCppFunc is_std_list_EffectPTR__PythonToCpp_std_list_EffectPTR__Co return 0; } -// C++ to Python conversion for type 'std::list'. -static PyObject* std_list_std_string__CppToPython_std_list_std_string_(const void* cppIn) { - ::std::list& cppInRef = *((::std::list*)cppIn); +// C++ to Python conversion for type 'std::list'. +static PyObject* std_list_QString__CppToPython_std_list_QString_(const void* cppIn) { + ::std::list& cppInRef = *((::std::list*)cppIn); // TEMPLATE - stdListToPyList - START PyObject* pyOut = PyList_New((int) cppInRef.size()); - ::std::list::const_iterator it = cppInRef.begin(); + ::std::list::const_iterator it = cppInRef.begin(); for (int idx = 0; it != cppInRef.end(); ++it, ++idx) { - ::std::string cppItem(*it); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppItem)); + ::QString cppItem(*it); + PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppItem)); } return pyOut; // TEMPLATE - stdListToPyList - END } -static void std_list_std_string__PythonToCpp_std_list_std_string_(PyObject* pyIn, void* cppOut) { - ::std::list& cppOutRef = *((::std::list*)cppOut); +static void std_list_QString__PythonToCpp_std_list_QString_(PyObject* pyIn, void* cppOut) { + ::std::list& cppOutRef = *((::std::list*)cppOut); // TEMPLATE - pyListToStdList - START for (int i = 0; i < PySequence_Size(pyIn); i++) { Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, i)); - ::std::string cppItem; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), pyItem, &(cppItem)); + ::QString cppItem = ::QString(); + Shiboken::Conversions::pythonToCppCopy(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], pyItem, &(cppItem)); cppOutRef.push_back(cppItem); } // TEMPLATE - pyListToStdList - END } -static PythonToCppFunc is_std_list_std_string__PythonToCpp_std_list_std_string__Convertible(PyObject* pyIn) { - if (Shiboken::Conversions::convertibleSequenceTypes(Shiboken::Conversions::PrimitiveTypeConverter(), pyIn)) - return std_list_std_string__PythonToCpp_std_list_std_string_; +static PythonToCppFunc is_std_list_QString__PythonToCpp_std_list_QString__Convertible(PyObject* pyIn) { + if (Shiboken::Conversions::convertibleSequenceTypes(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], pyIn)) + return std_list_QString__PythonToCpp_std_list_QString_; return 0; } @@ -469,7 +433,7 @@ static void std_map_ImageLayer_EffectPTR__PythonToCpp_std_map_ImageLayer_EffectP PyObject* value; Py_ssize_t pos = 0; while (PyDict_Next(pyIn, &pos, &key, &value)) { - ::ImageLayer cppKey = ::ImageLayer(::std::string(), ::std::string(), ::std::vector()); + ::ImageLayer cppKey = ::ImageLayer(::QString(), ::QString(), ::QStringList()); Shiboken::Conversions::pythonToCppCopy((SbkObjectType*)SbkNatronEngineTypes[SBK_IMAGELAYER_IDX], key, &(cppKey)); ::Effect* cppValue = ((::Effect*)0); Shiboken::Conversions::pythonToCppPointer((SbkObjectType*)SbkNatronEngineTypes[SBK_EFFECT_IDX], value, &(cppValue)); @@ -642,7 +606,6 @@ SBK_MODULE_INIT_FUNCTION_BEGIN(NatronEngine) #endif // Initialize classes in the type system - init_RectD(module); init_PyCoreApplication(module); init_Group(module); init_App(module); @@ -658,9 +621,6 @@ SBK_MODULE_INIT_FUNCTION_BEGIN(NatronEngine) init_Effect(module); init_Param(module); init_AnimatedParam(module); - init_DoubleParam(module); - init_Double2DParam(module); - init_Double3DParam(module); init_ColorParam(module); init_ChoiceParam(module); init_BooleanParam(module); @@ -672,6 +632,9 @@ SBK_MODULE_INIT_FUNCTION_BEGIN(NatronEngine) init_IntParam(module); init_Int2DParam(module); init_Int3DParam(module); + init_DoubleParam(module); + init_Double2DParam(module); + init_Double3DParam(module); init_ButtonParam(module); init_SeparatorParam(module); init_GroupParam(module); @@ -683,6 +646,7 @@ SBK_MODULE_INIT_FUNCTION_BEGIN(NatronEngine) init_Double3DTuple(module); init_ColorTuple(module); init_RectI(module); + init_RectD(module); init_NATRON_NAMESPACE(module); // Register converter for type 'NatronEngine.std::size_t'. @@ -701,27 +665,20 @@ SBK_MODULE_INIT_FUNCTION_BEGIN(NatronEngine) std_vector_RectI__PythonToCpp_std_vector_RectI_, is_std_vector_RectI__PythonToCpp_std_vector_RectI__Convertible); - // Register converter for type 'std::vector'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_STD_STRING_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, std_vector_std_string__CppToPython_std_vector_std_string_); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_STD_STRING_IDX], "std::vector"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_STD_STRING_IDX], - std_vector_std_string__PythonToCpp_std_vector_std_string_, - is_std_vector_std_string__PythonToCpp_std_vector_std_string__Convertible); - - // Register converter for type 'std::pair'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_PAIR_STD_STRING_STD_STRING_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, std_pair_std_string_std_string__CppToPython_std_pair_std_string_std_string_); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_PAIR_STD_STRING_STD_STRING_IDX], "std::pair"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_PAIR_STD_STRING_STD_STRING_IDX], - std_pair_std_string_std_string__PythonToCpp_std_pair_std_string_std_string_, - is_std_pair_std_string_std_string__PythonToCpp_std_pair_std_string_std_string__Convertible); - - // Register converter for type 'const std::list>&'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_PAIR_STD_STRING_STD_STRING_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, conststd_list_std_pair_std_string_std_string__REF_CppToPython_conststd_list_std_pair_std_string_std_string__REF); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_PAIR_STD_STRING_STD_STRING_IDX], "const std::list>&"); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_PAIR_STD_STRING_STD_STRING_IDX], "std::list>"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_PAIR_STD_STRING_STD_STRING_IDX], - conststd_list_std_pair_std_string_std_string__REF_PythonToCpp_conststd_list_std_pair_std_string_std_string__REF, - is_conststd_list_std_pair_std_string_std_string__REF_PythonToCpp_conststd_list_std_pair_std_string_std_string__REF_Convertible); + // Register converter for type 'std::pair'. + SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_PAIR_QSTRING_QSTRING_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, std_pair_QString_QString__CppToPython_std_pair_QString_QString_); + Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_PAIR_QSTRING_QSTRING_IDX], "std::pair"); + Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_PAIR_QSTRING_QSTRING_IDX], + std_pair_QString_QString__PythonToCpp_std_pair_QString_QString_, + is_std_pair_QString_QString__PythonToCpp_std_pair_QString_QString__Convertible); + + // Register converter for type 'const std::list>&'. + SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_PAIR_QSTRING_QSTRING_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, conststd_list_std_pair_QString_QString__REF_CppToPython_conststd_list_std_pair_QString_QString__REF); + Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_PAIR_QSTRING_QSTRING_IDX], "const std::list>&"); + Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_PAIR_QSTRING_QSTRING_IDX], "std::list>"); + Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_PAIR_QSTRING_QSTRING_IDX], + conststd_list_std_pair_QString_QString__REF_PythonToCpp_conststd_list_std_pair_QString_QString__REF, + is_conststd_list_std_pair_QString_QString__REF_PythonToCpp_conststd_list_std_pair_QString_QString__REF_Convertible); // Register converter for type 'std::list*'. SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_TRACKPTR_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, std_list_TrackPTR_PTR_CppToPython_std_list_TrackPTR_PTR); @@ -751,12 +708,12 @@ SBK_MODULE_INIT_FUNCTION_BEGIN(NatronEngine) std_list_EffectPTR__PythonToCpp_std_list_EffectPTR_, is_std_list_EffectPTR__PythonToCpp_std_list_EffectPTR__Convertible); - // Register converter for type 'std::list'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_STRING_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, std_list_std_string__CppToPython_std_list_std_string_); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_STRING_IDX], "std::list"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_STRING_IDX], - std_list_std_string__PythonToCpp_std_list_std_string_, - is_std_list_std_string__PythonToCpp_std_list_std_string__Convertible); + // Register converter for type 'std::list'. + SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_QSTRING_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, std_list_QString__CppToPython_std_list_QString_); + Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_QSTRING_IDX], "std::list"); + Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_QSTRING_IDX], + std_list_QString__PythonToCpp_std_list_QString_, + is_std_list_QString__PythonToCpp_std_list_QString__Convertible); // Register converter for type 'const std::list&'. SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_INT_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, conststd_list_int_REF_CppToPython_conststd_list_int_REF); diff --git a/Engine/NatronEngine/natronengine_python.h b/Engine/NatronEngine/natronengine_python.h index 1352c2bc20..a50c241cbf 100644 --- a/Engine/NatronEngine/natronengine_python.h +++ b/Engine/NatronEngine/natronengine_python.h @@ -72,6 +72,7 @@ CLANG_DIAG_ON(uninitialized) #define SBK_NATRON_NAMESPACE_PLAYBACKMODEENUM_IDX 36 #define SBK_NATRON_NAMESPACE_PIXMAPENUM_IDX 35 #define SBK_NATRON_NAMESPACE_VIEWERCOLORSPACEENUM_IDX 40 +#define SBK_RECTD_IDX 49 #define SBK_RECTI_IDX 50 #define SBK_COLORTUPLE_IDX 9 #define SBK_DOUBLE3DTUPLE_IDX 13 @@ -114,7 +115,6 @@ CLANG_DIAG_ON(uninitialized) #define SBK_APP_IDX 1 #define SBK_EFFECT_IDX 15 #define SBK_PYCOREAPPLICATION_IDX 47 -#define SBK_RECTD_IDX 49 #define SBK_NatronEngine_IDX_COUNT 59 // This variable stores all Python types exported by this module. @@ -124,16 +124,16 @@ extern PyTypeObject** SbkNatronEngineTypes; extern SbkConverter** SbkNatronEngineTypeConverters; // Converter indices -#define SBK_STD_SIZE_T_IDX 0 -#define SBK_NATRONENGINE_STD_VECTOR_RECTI_IDX 1 // std::vector -#define SBK_NATRONENGINE_STD_VECTOR_STD_STRING_IDX 2 // std::vector -#define SBK_NATRONENGINE_STD_PAIR_STD_STRING_STD_STRING_IDX 3 // std::pair -#define SBK_NATRONENGINE_STD_LIST_STD_PAIR_STD_STRING_STD_STRING_IDX 4 // const std::list > & +#define SBK_STD_STRING_IDX 0 +#define SBK_STD_SIZE_T_IDX 1 +#define SBK_NATRONENGINE_STD_VECTOR_RECTI_IDX 2 // std::vector +#define SBK_NATRONENGINE_STD_PAIR_QSTRING_QSTRING_IDX 3 // std::pair +#define SBK_NATRONENGINE_STD_LIST_STD_PAIR_QSTRING_QSTRING_IDX 4 // const std::list > & #define SBK_NATRONENGINE_STD_LIST_TRACKPTR_IDX 5 // std::list * #define SBK_NATRONENGINE_STD_LIST_ITEMBASEPTR_IDX 6 // std::list #define SBK_NATRONENGINE_STD_LIST_PARAMPTR_IDX 7 // std::list #define SBK_NATRONENGINE_STD_LIST_EFFECTPTR_IDX 8 // std::list -#define SBK_NATRONENGINE_STD_LIST_STD_STRING_IDX 9 // std::list +#define SBK_NATRONENGINE_STD_LIST_QSTRING_IDX 9 // std::list #define SBK_NATRONENGINE_STD_LIST_INT_IDX 10 // const std::list & #define SBK_NATRONENGINE_STD_MAP_IMAGELAYER_EFFECTPTR_IDX 11 // std::map #define SBK_NATRONENGINE_QLIST_QVARIANT_IDX 12 // QList @@ -162,6 +162,7 @@ template<> inline PyTypeObject* SbkType inline PyTypeObject* SbkType() { return SbkNatronEngineTypes[SBK_NATRON_NAMESPACE_PLAYBACKMODEENUM_IDX]; } template<> inline PyTypeObject* SbkType() { return SbkNatronEngineTypes[SBK_NATRON_NAMESPACE_PIXMAPENUM_IDX]; } template<> inline PyTypeObject* SbkType() { return SbkNatronEngineTypes[SBK_NATRON_NAMESPACE_VIEWERCOLORSPACEENUM_IDX]; } +template<> inline PyTypeObject* SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_RECTD_IDX]); } template<> inline PyTypeObject* SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_RECTI_IDX]); } template<> inline PyTypeObject* SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_COLORTUPLE_IDX]); } template<> inline PyTypeObject* SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_DOUBLE3DTUPLE_IDX]); } @@ -204,7 +205,6 @@ template<> inline PyTypeObject* SbkType inline PyTypeObject* SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_APP_IDX]); } template<> inline PyTypeObject* SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_EFFECT_IDX]); } template<> inline PyTypeObject* SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX]); } -template<> inline PyTypeObject* SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_RECTD_IDX]); } } // namespace Shiboken diff --git a/Engine/NatronEngine/param_wrapper.cpp b/Engine/NatronEngine/param_wrapper.cpp index ecd3010eab..a643378a79 100644 --- a/Engine/NatronEngine/param_wrapper.cpp +++ b/Engine/NatronEngine/param_wrapper.cpp @@ -347,8 +347,8 @@ static PyObject* Sbk_ParamFunc_getHelp(PyObject* self) if (!PyErr_Occurred()) { // getHelp()const - std::string cppResult = const_cast(cppSelf)->getHelp(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = const_cast(cppSelf)->getHelp(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -522,8 +522,8 @@ static PyObject* Sbk_ParamFunc_getLabel(PyObject* self) if (!PyErr_Occurred()) { // getLabel()const - std::string cppResult = const_cast(cppSelf)->getLabel(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = const_cast(cppSelf)->getLabel(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -603,8 +603,8 @@ static PyObject* Sbk_ParamFunc_getScriptName(PyObject* self) if (!PyErr_Occurred()) { // getScriptName()const - std::string cppResult = const_cast(cppSelf)->getScriptName(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = const_cast(cppSelf)->getScriptName(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -629,8 +629,8 @@ static PyObject* Sbk_ParamFunc_getTypeName(PyObject* self) if (!PyErr_Occurred()) { // getTypeName()const - std::string cppResult = const_cast(cppSelf)->getTypeName(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = const_cast(cppSelf)->getTypeName(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -1153,9 +1153,9 @@ static PyObject* Sbk_ParamFunc_setHelp(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: setHelp(std::string) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setHelp(std::string) + // 0: setHelp(QString) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // setHelp(QString) } // Function signature not found. @@ -1163,11 +1163,11 @@ static PyObject* Sbk_ParamFunc_setHelp(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // setHelp(std::string) + // setHelp(QString) cppSelf->setHelp(cppArg0); } } @@ -1178,7 +1178,7 @@ static PyObject* Sbk_ParamFunc_setHelp(PyObject* self, PyObject* pyArg) Py_RETURN_NONE; Sbk_ParamFunc_setHelp_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Param.setHelp", overloads); return 0; } diff --git a/Engine/NatronEngine/pycoreapplication_wrapper.cpp b/Engine/NatronEngine/pycoreapplication_wrapper.cpp index 91a7876105..1bd5922082 100644 --- a/Engine/NatronEngine/pycoreapplication_wrapper.cpp +++ b/Engine/NatronEngine/pycoreapplication_wrapper.cpp @@ -20,7 +20,6 @@ GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF // Extra includes NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING #include -#include // Native --------------------------------------------------------- @@ -84,9 +83,9 @@ static PyObject* Sbk_PyCoreApplicationFunc_appendToNatronPath(PyObject* self, Py SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: appendToNatronPath(std::string) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // appendToNatronPath(std::string) + // 0: appendToNatronPath(QString) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // appendToNatronPath(QString) } // Function signature not found. @@ -94,11 +93,11 @@ static PyObject* Sbk_PyCoreApplicationFunc_appendToNatronPath(PyObject* self, Py // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // appendToNatronPath(std::string) + // appendToNatronPath(QString) cppSelf->appendToNatronPath(cppArg0); } } @@ -109,7 +108,7 @@ static PyObject* Sbk_PyCoreApplicationFunc_appendToNatronPath(PyObject* self, Py Py_RETURN_NONE; Sbk_PyCoreApplicationFunc_appendToNatronPath_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.PyCoreApplication.appendToNatronPath", overloads); return 0; } @@ -231,8 +230,8 @@ static PyObject* Sbk_PyCoreApplicationFunc_getNatronDevelopmentStatus(PyObject* if (!PyErr_Occurred()) { // getNatronDevelopmentStatus()const - std::string cppResult = const_cast(cppSelf)->getNatronDevelopmentStatus(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = const_cast(cppSelf)->getNatronDevelopmentStatus(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -257,8 +256,8 @@ static PyObject* Sbk_PyCoreApplicationFunc_getNatronPath(PyObject* self) if (!PyErr_Occurred()) { // getNatronPath()const - std::list cppResult = const_cast(cppSelf)->getNatronPath(); - pyResult = Shiboken::Conversions::copyToPython(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_STRING_IDX], &cppResult); + QStringList cppResult = const_cast(cppSelf)->getNatronPath(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], &cppResult); } } @@ -387,8 +386,8 @@ static PyObject* Sbk_PyCoreApplicationFunc_getNatronVersionString(PyObject* self if (!PyErr_Occurred()) { // getNatronVersionString()const - std::string cppResult = const_cast(cppSelf)->getNatronVersionString(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = const_cast(cppSelf)->getNatronVersionString(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -474,12 +473,12 @@ static PyObject* Sbk_PyCoreApplicationFunc_getPluginIDs(PyObject* self, PyObject // Overloaded function decisor // 0: getPluginIDs()const - // 1: getPluginIDs(std::string)const + // 1: getPluginIDs(QString)const if (numArgs == 0) { overloadId = 0; // getPluginIDs()const } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 1; // getPluginIDs(std::string)const + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0])))) { + overloadId = 1; // getPluginIDs(QString)const } // Function signature not found. @@ -492,20 +491,20 @@ static PyObject* Sbk_PyCoreApplicationFunc_getPluginIDs(PyObject* self, PyObject if (!PyErr_Occurred()) { // getPluginIDs()const - std::list cppResult = const_cast(cppSelf)->getPluginIDs(); - pyResult = Shiboken::Conversions::copyToPython(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_STRING_IDX], &cppResult); + QStringList cppResult = const_cast(cppSelf)->getPluginIDs(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], &cppResult); } break; } - case 1: // getPluginIDs(const std::string & filter) const + case 1: // getPluginIDs(const QString & filter) const { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); if (!PyErr_Occurred()) { - // getPluginIDs(std::string)const - std::list cppResult = const_cast(cppSelf)->getPluginIDs(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_STRING_IDX], &cppResult); + // getPluginIDs(QString)const + QStringList cppResult = const_cast(cppSelf)->getPluginIDs(cppArg0); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], &cppResult); } break; } @@ -518,7 +517,7 @@ static PyObject* Sbk_PyCoreApplicationFunc_getPluginIDs(PyObject* self, PyObject return pyResult; Sbk_PyCoreApplicationFunc_getPluginIDs_TypeError: - const char* overloads[] = {"", "std::string", 0}; + const char* overloads[] = {"", "unicode", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.PyCoreApplication.getPluginIDs", overloads); return 0; } @@ -720,9 +719,9 @@ static PyObject* Sbk_PyCoreApplicationFunc_setOnProjectCreatedCallback(PyObject* SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: setOnProjectCreatedCallback(std::string) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setOnProjectCreatedCallback(std::string) + // 0: setOnProjectCreatedCallback(QString) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // setOnProjectCreatedCallback(QString) } // Function signature not found. @@ -730,11 +729,11 @@ static PyObject* Sbk_PyCoreApplicationFunc_setOnProjectCreatedCallback(PyObject* // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // setOnProjectCreatedCallback(std::string) + // setOnProjectCreatedCallback(QString) cppSelf->setOnProjectCreatedCallback(cppArg0); } } @@ -745,7 +744,7 @@ static PyObject* Sbk_PyCoreApplicationFunc_setOnProjectCreatedCallback(PyObject* Py_RETURN_NONE; Sbk_PyCoreApplicationFunc_setOnProjectCreatedCallback_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.PyCoreApplication.setOnProjectCreatedCallback", overloads); return 0; } @@ -762,9 +761,9 @@ static PyObject* Sbk_PyCoreApplicationFunc_setOnProjectLoadedCallback(PyObject* SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: setOnProjectLoadedCallback(std::string) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setOnProjectLoadedCallback(std::string) + // 0: setOnProjectLoadedCallback(QString) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // setOnProjectLoadedCallback(QString) } // Function signature not found. @@ -772,11 +771,11 @@ static PyObject* Sbk_PyCoreApplicationFunc_setOnProjectLoadedCallback(PyObject* // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // setOnProjectLoadedCallback(std::string) + // setOnProjectLoadedCallback(QString) cppSelf->setOnProjectLoadedCallback(cppArg0); } } @@ -787,7 +786,7 @@ static PyObject* Sbk_PyCoreApplicationFunc_setOnProjectLoadedCallback(PyObject* Py_RETURN_NONE; Sbk_PyCoreApplicationFunc_setOnProjectLoadedCallback_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.PyCoreApplication.setOnProjectLoadedCallback", overloads); return 0; } diff --git a/Engine/NatronEngine/roto_wrapper.cpp b/Engine/NatronEngine/roto_wrapper.cpp index 0e10ab2649..b1004d012e 100644 --- a/Engine/NatronEngine/roto_wrapper.cpp +++ b/Engine/NatronEngine/roto_wrapper.cpp @@ -322,9 +322,9 @@ static PyObject* Sbk_RotoFunc_getItemByName(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: getItemByName(std::string)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getItemByName(std::string)const + // 0: getItemByName(QString)const + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // getItemByName(QString)const } // Function signature not found. @@ -332,11 +332,11 @@ static PyObject* Sbk_RotoFunc_getItemByName(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // getItemByName(std::string)const + // getItemByName(QString)const ItemBase * cppResult = const_cast(cppSelf)->getItemByName(cppArg0); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_ITEMBASE_IDX], cppResult); @@ -352,7 +352,7 @@ static PyObject* Sbk_RotoFunc_getItemByName(PyObject* self, PyObject* pyArg) return pyResult; Sbk_RotoFunc_getItemByName_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Roto.getItemByName", overloads); return 0; } diff --git a/Engine/NatronEngine/stringparambase_wrapper.cpp b/Engine/NatronEngine/stringparambase_wrapper.cpp index 0559c34a04..c89d3458fa 100644 --- a/Engine/NatronEngine/stringparambase_wrapper.cpp +++ b/Engine/NatronEngine/stringparambase_wrapper.cpp @@ -83,8 +83,8 @@ static PyObject* Sbk_StringParamBaseFunc_addAsDependencyOf(PyObject* self, PyObj if (!PyErr_Occurred()) { // addAsDependencyOf(int,Param*,int) - std::string cppResult = cppSelf->addAsDependencyOf(cppArg0, cppArg1, cppArg2); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = cppSelf->addAsDependencyOf(cppArg0, cppArg1, cppArg2); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -141,8 +141,8 @@ static PyObject* Sbk_StringParamBaseFunc_get(PyObject* self, PyObject* args) if (!PyErr_Occurred()) { // get()const - std::string cppResult = const_cast(cppSelf)->get(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = const_cast(cppSelf)->get(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } break; } @@ -153,8 +153,8 @@ static PyObject* Sbk_StringParamBaseFunc_get(PyObject* self, PyObject* args) if (!PyErr_Occurred()) { // get(double)const - std::string cppResult = const_cast(cppSelf)->get(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = const_cast(cppSelf)->get(cppArg0); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } break; } @@ -186,8 +186,8 @@ static PyObject* Sbk_StringParamBaseFunc_getDefaultValue(PyObject* self) if (!PyErr_Occurred()) { // getDefaultValue()const - std::string cppResult = const_cast(cppSelf)->getDefaultValue(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = const_cast(cppSelf)->getDefaultValue(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -212,8 +212,8 @@ static PyObject* Sbk_StringParamBaseFunc_getValue(PyObject* self) if (!PyErr_Occurred()) { // getValue()const - std::string cppResult = const_cast(cppSelf)->getValue(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = const_cast(cppSelf)->getValue(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -252,8 +252,8 @@ static PyObject* Sbk_StringParamBaseFunc_getValueAtTime(PyObject* self, PyObject if (!PyErr_Occurred()) { // getValueAtTime(double)const - std::string cppResult = const_cast(cppSelf)->getValueAtTime(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = const_cast(cppSelf)->getValueAtTime(cppArg0); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -313,14 +313,14 @@ static PyObject* Sbk_StringParamBaseFunc_set(PyObject* self, PyObject* args) // Overloaded function decisor - // 0: set(std::string) - // 1: set(std::string,double) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { + // 0: set(QString) + // 1: set(QString,double) + if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0])))) { if (numArgs == 1) { - overloadId = 0; // set(std::string) + overloadId = 0; // set(QString) } else if (numArgs == 2 && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 1; // set(std::string,double) + overloadId = 1; // set(QString,double) } } @@ -329,26 +329,26 @@ static PyObject* Sbk_StringParamBaseFunc_set(PyObject* self, PyObject* args) // Call function/method switch (overloadId) { - case 0: // set(const std::string & x) + case 0: // set(const QString & x) { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); if (!PyErr_Occurred()) { - // set(std::string) + // set(QString) cppSelf->set(cppArg0); } break; } - case 1: // set(const std::string & x, double frame) + case 1: // set(const QString & x, double frame) { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); double cppArg1; pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // set(std::string,double) + // set(QString,double) cppSelf->set(cppArg0, cppArg1); } break; @@ -361,7 +361,7 @@ static PyObject* Sbk_StringParamBaseFunc_set(PyObject* self, PyObject* args) Py_RETURN_NONE; Sbk_StringParamBaseFunc_set_TypeError: - const char* overloads[] = {"std::string", "std::string, float", 0}; + const char* overloads[] = {"unicode", "unicode, float", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.StringParamBase.set", overloads); return 0; } @@ -378,9 +378,9 @@ static PyObject* Sbk_StringParamBaseFunc_setDefaultValue(PyObject* self, PyObjec SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: setDefaultValue(std::string) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setDefaultValue(std::string) + // 0: setDefaultValue(QString) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // setDefaultValue(QString) } // Function signature not found. @@ -388,11 +388,11 @@ static PyObject* Sbk_StringParamBaseFunc_setDefaultValue(PyObject* self, PyObjec // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // setDefaultValue(std::string) + // setDefaultValue(QString) cppSelf->setDefaultValue(cppArg0); } } @@ -403,7 +403,7 @@ static PyObject* Sbk_StringParamBaseFunc_setDefaultValue(PyObject* self, PyObjec Py_RETURN_NONE; Sbk_StringParamBaseFunc_setDefaultValue_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.StringParamBase.setDefaultValue", overloads); return 0; } @@ -420,9 +420,9 @@ static PyObject* Sbk_StringParamBaseFunc_setValue(PyObject* self, PyObject* pyAr SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: setValue(std::string) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setValue(std::string) + // 0: setValue(QString) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // setValue(QString) } // Function signature not found. @@ -430,11 +430,11 @@ static PyObject* Sbk_StringParamBaseFunc_setValue(PyObject* self, PyObject* pyAr // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // setValue(std::string) + // setValue(QString) cppSelf->setValue(cppArg0); } } @@ -445,7 +445,7 @@ static PyObject* Sbk_StringParamBaseFunc_setValue(PyObject* self, PyObject* pyAr Py_RETURN_NONE; Sbk_StringParamBaseFunc_setValue_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.StringParamBase.setValue", overloads); return 0; } @@ -471,11 +471,11 @@ static PyObject* Sbk_StringParamBaseFunc_setValueAtTime(PyObject* self, PyObject // Overloaded function decisor - // 0: setValueAtTime(std::string,double) + // 0: setValueAtTime(QString,double) if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setValueAtTime(std::string,double) + overloadId = 0; // setValueAtTime(QString,double) } // Function signature not found. @@ -483,13 +483,13 @@ static PyObject* Sbk_StringParamBaseFunc_setValueAtTime(PyObject* self, PyObject // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); double cppArg1; pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // setValueAtTime(std::string,double) + // setValueAtTime(QString,double) cppSelf->setValueAtTime(cppArg0, cppArg1); } } @@ -500,7 +500,7 @@ static PyObject* Sbk_StringParamBaseFunc_setValueAtTime(PyObject* self, PyObject Py_RETURN_NONE; Sbk_StringParamBaseFunc_setValueAtTime_TypeError: - const char* overloads[] = {"std::string, float", 0}; + const char* overloads[] = {"unicode, float", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.StringParamBase.setValueAtTime", overloads); return 0; } diff --git a/Engine/NatronEngine/track_wrapper.cpp b/Engine/NatronEngine/track_wrapper.cpp index b7d82cc286..4886b944fd 100644 --- a/Engine/NatronEngine/track_wrapper.cpp +++ b/Engine/NatronEngine/track_wrapper.cpp @@ -39,9 +39,9 @@ static PyObject* Sbk_TrackFunc_getParam(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: getParam(std::string)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getParam(std::string)const + // 0: getParam(QString)const + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // getParam(QString)const } // Function signature not found. @@ -49,11 +49,11 @@ static PyObject* Sbk_TrackFunc_getParam(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // getParam(std::string)const + // getParam(QString)const Param * cppResult = const_cast(cppSelf)->getParam(cppArg0); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_PARAM_IDX], cppResult); @@ -69,7 +69,7 @@ static PyObject* Sbk_TrackFunc_getParam(PyObject* self, PyObject* pyArg) return pyResult; Sbk_TrackFunc_getParam_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Track.getParam", overloads); return 0; } @@ -88,8 +88,8 @@ static PyObject* Sbk_TrackFunc_getScriptName(PyObject* self) if (!PyErr_Occurred()) { // getScriptName()const - std::string cppResult = const_cast(cppSelf)->getScriptName(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = const_cast(cppSelf)->getScriptName(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -135,9 +135,9 @@ static PyObject* Sbk_TrackFunc_setScriptName(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: setScriptName(std::string) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setScriptName(std::string) + // 0: setScriptName(QString) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // setScriptName(QString) } // Function signature not found. @@ -145,11 +145,11 @@ static PyObject* Sbk_TrackFunc_setScriptName(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // setScriptName(std::string) + // setScriptName(QString) cppSelf->setScriptName(cppArg0); } } @@ -160,7 +160,7 @@ static PyObject* Sbk_TrackFunc_setScriptName(PyObject* self, PyObject* pyArg) Py_RETURN_NONE; Sbk_TrackFunc_setScriptName_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Track.setScriptName", overloads); return 0; } diff --git a/Engine/NatronEngine/tracker_wrapper.cpp b/Engine/NatronEngine/tracker_wrapper.cpp index 35cded33ce..bb94112ed4 100644 --- a/Engine/NatronEngine/tracker_wrapper.cpp +++ b/Engine/NatronEngine/tracker_wrapper.cpp @@ -126,9 +126,9 @@ static PyObject* Sbk_TrackerFunc_getTrackByName(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: getTrackByName(std::string)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getTrackByName(std::string)const + // 0: getTrackByName(QString)const + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // getTrackByName(QString)const } // Function signature not found. @@ -136,11 +136,11 @@ static PyObject* Sbk_TrackerFunc_getTrackByName(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // getTrackByName(std::string)const + // getTrackByName(QString)const Track * cppResult = const_cast(cppSelf)->getTrackByName(cppArg0); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_TRACK_IDX], cppResult); @@ -156,7 +156,7 @@ static PyObject* Sbk_TrackerFunc_getTrackByName(PyObject* self, PyObject* pyArg) return pyResult; Sbk_TrackerFunc_getTrackByName_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Tracker.getTrackByName", overloads); return 0; } diff --git a/Engine/NatronEngine/userparamholder_wrapper.cpp b/Engine/NatronEngine/userparamholder_wrapper.cpp index 9506544ec9..7f64e4608d 100644 --- a/Engine/NatronEngine/userparamholder_wrapper.cpp +++ b/Engine/NatronEngine/userparamholder_wrapper.cpp @@ -93,11 +93,11 @@ static PyObject* Sbk_UserParamHolderFunc_createBooleanParam(PyObject* self, PyOb // Overloaded function decisor - // 0: createBooleanParam(std::string,std::string) + // 0: createBooleanParam(QString,QString) if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // createBooleanParam(std::string,std::string) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // createBooleanParam(QString,QString) } // Function signature not found. @@ -105,13 +105,13 @@ static PyObject* Sbk_UserParamHolderFunc_createBooleanParam(PyObject* self, PyOb // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // createBooleanParam(std::string,std::string) + // createBooleanParam(QString,QString) BooleanParam * cppResult = cppSelf->createBooleanParam(cppArg0, cppArg1); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_BOOLEANPARAM_IDX], cppResult); @@ -127,7 +127,7 @@ static PyObject* Sbk_UserParamHolderFunc_createBooleanParam(PyObject* self, PyOb return pyResult; Sbk_UserParamHolderFunc_createBooleanParam_TypeError: - const char* overloads[] = {"std::string, std::string", 0}; + const char* overloads[] = {"unicode, unicode", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createBooleanParam", overloads); return 0; } @@ -154,11 +154,11 @@ static PyObject* Sbk_UserParamHolderFunc_createButtonParam(PyObject* self, PyObj // Overloaded function decisor - // 0: createButtonParam(std::string,std::string) + // 0: createButtonParam(QString,QString) if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // createButtonParam(std::string,std::string) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // createButtonParam(QString,QString) } // Function signature not found. @@ -166,13 +166,13 @@ static PyObject* Sbk_UserParamHolderFunc_createButtonParam(PyObject* self, PyObj // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // createButtonParam(std::string,std::string) + // createButtonParam(QString,QString) ButtonParam * cppResult = cppSelf->createButtonParam(cppArg0, cppArg1); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_BUTTONPARAM_IDX], cppResult); @@ -188,7 +188,7 @@ static PyObject* Sbk_UserParamHolderFunc_createButtonParam(PyObject* self, PyObj return pyResult; Sbk_UserParamHolderFunc_createButtonParam_TypeError: - const char* overloads[] = {"std::string, std::string", 0}; + const char* overloads[] = {"unicode, unicode", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createButtonParam", overloads); return 0; } @@ -215,11 +215,11 @@ static PyObject* Sbk_UserParamHolderFunc_createChoiceParam(PyObject* self, PyObj // Overloaded function decisor - // 0: createChoiceParam(std::string,std::string) + // 0: createChoiceParam(QString,QString) if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // createChoiceParam(std::string,std::string) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // createChoiceParam(QString,QString) } // Function signature not found. @@ -227,13 +227,13 @@ static PyObject* Sbk_UserParamHolderFunc_createChoiceParam(PyObject* self, PyObj // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // createChoiceParam(std::string,std::string) + // createChoiceParam(QString,QString) ChoiceParam * cppResult = cppSelf->createChoiceParam(cppArg0, cppArg1); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_CHOICEPARAM_IDX], cppResult); @@ -249,7 +249,7 @@ static PyObject* Sbk_UserParamHolderFunc_createChoiceParam(PyObject* self, PyObj return pyResult; Sbk_UserParamHolderFunc_createChoiceParam_TypeError: - const char* overloads[] = {"std::string, std::string", 0}; + const char* overloads[] = {"unicode, unicode", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createChoiceParam", overloads); return 0; } @@ -276,12 +276,12 @@ static PyObject* Sbk_UserParamHolderFunc_createColorParam(PyObject* self, PyObje // Overloaded function decisor - // 0: createColorParam(std::string,std::string,bool) + // 0: createColorParam(QString,QString,bool) if (numArgs == 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1]))) && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // createColorParam(std::string,std::string,bool) + overloadId = 0; // createColorParam(QString,QString,bool) } // Function signature not found. @@ -289,15 +289,15 @@ static PyObject* Sbk_UserParamHolderFunc_createColorParam(PyObject* self, PyObje // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); bool cppArg2; pythonToCpp[2](pyArgs[2], &cppArg2); if (!PyErr_Occurred()) { - // createColorParam(std::string,std::string,bool) + // createColorParam(QString,QString,bool) ColorParam * cppResult = cppSelf->createColorParam(cppArg0, cppArg1, cppArg2); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_COLORPARAM_IDX], cppResult); @@ -313,7 +313,7 @@ static PyObject* Sbk_UserParamHolderFunc_createColorParam(PyObject* self, PyObje return pyResult; Sbk_UserParamHolderFunc_createColorParam_TypeError: - const char* overloads[] = {"std::string, std::string, bool", 0}; + const char* overloads[] = {"unicode, unicode, bool", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createColorParam", overloads); return 0; } @@ -340,11 +340,11 @@ static PyObject* Sbk_UserParamHolderFunc_createDouble2DParam(PyObject* self, PyO // Overloaded function decisor - // 0: createDouble2DParam(std::string,std::string) + // 0: createDouble2DParam(QString,QString) if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // createDouble2DParam(std::string,std::string) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // createDouble2DParam(QString,QString) } // Function signature not found. @@ -352,13 +352,13 @@ static PyObject* Sbk_UserParamHolderFunc_createDouble2DParam(PyObject* self, PyO // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // createDouble2DParam(std::string,std::string) + // createDouble2DParam(QString,QString) Double2DParam * cppResult = cppSelf->createDouble2DParam(cppArg0, cppArg1); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_DOUBLE2DPARAM_IDX], cppResult); @@ -374,7 +374,7 @@ static PyObject* Sbk_UserParamHolderFunc_createDouble2DParam(PyObject* self, PyO return pyResult; Sbk_UserParamHolderFunc_createDouble2DParam_TypeError: - const char* overloads[] = {"std::string, std::string", 0}; + const char* overloads[] = {"unicode, unicode", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createDouble2DParam", overloads); return 0; } @@ -401,11 +401,11 @@ static PyObject* Sbk_UserParamHolderFunc_createDouble3DParam(PyObject* self, PyO // Overloaded function decisor - // 0: createDouble3DParam(std::string,std::string) + // 0: createDouble3DParam(QString,QString) if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // createDouble3DParam(std::string,std::string) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // createDouble3DParam(QString,QString) } // Function signature not found. @@ -413,13 +413,13 @@ static PyObject* Sbk_UserParamHolderFunc_createDouble3DParam(PyObject* self, PyO // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // createDouble3DParam(std::string,std::string) + // createDouble3DParam(QString,QString) Double3DParam * cppResult = cppSelf->createDouble3DParam(cppArg0, cppArg1); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_DOUBLE3DPARAM_IDX], cppResult); @@ -435,7 +435,7 @@ static PyObject* Sbk_UserParamHolderFunc_createDouble3DParam(PyObject* self, PyO return pyResult; Sbk_UserParamHolderFunc_createDouble3DParam_TypeError: - const char* overloads[] = {"std::string, std::string", 0}; + const char* overloads[] = {"unicode, unicode", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createDouble3DParam", overloads); return 0; } @@ -462,11 +462,11 @@ static PyObject* Sbk_UserParamHolderFunc_createDoubleParam(PyObject* self, PyObj // Overloaded function decisor - // 0: createDoubleParam(std::string,std::string) + // 0: createDoubleParam(QString,QString) if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // createDoubleParam(std::string,std::string) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // createDoubleParam(QString,QString) } // Function signature not found. @@ -474,13 +474,13 @@ static PyObject* Sbk_UserParamHolderFunc_createDoubleParam(PyObject* self, PyObj // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // createDoubleParam(std::string,std::string) + // createDoubleParam(QString,QString) DoubleParam * cppResult = cppSelf->createDoubleParam(cppArg0, cppArg1); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX], cppResult); @@ -496,7 +496,7 @@ static PyObject* Sbk_UserParamHolderFunc_createDoubleParam(PyObject* self, PyObj return pyResult; Sbk_UserParamHolderFunc_createDoubleParam_TypeError: - const char* overloads[] = {"std::string, std::string", 0}; + const char* overloads[] = {"unicode, unicode", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createDoubleParam", overloads); return 0; } @@ -523,11 +523,11 @@ static PyObject* Sbk_UserParamHolderFunc_createFileParam(PyObject* self, PyObjec // Overloaded function decisor - // 0: createFileParam(std::string,std::string) + // 0: createFileParam(QString,QString) if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // createFileParam(std::string,std::string) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // createFileParam(QString,QString) } // Function signature not found. @@ -535,13 +535,13 @@ static PyObject* Sbk_UserParamHolderFunc_createFileParam(PyObject* self, PyObjec // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // createFileParam(std::string,std::string) + // createFileParam(QString,QString) FileParam * cppResult = cppSelf->createFileParam(cppArg0, cppArg1); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_FILEPARAM_IDX], cppResult); @@ -557,7 +557,7 @@ static PyObject* Sbk_UserParamHolderFunc_createFileParam(PyObject* self, PyObjec return pyResult; Sbk_UserParamHolderFunc_createFileParam_TypeError: - const char* overloads[] = {"std::string, std::string", 0}; + const char* overloads[] = {"unicode, unicode", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createFileParam", overloads); return 0; } @@ -584,11 +584,11 @@ static PyObject* Sbk_UserParamHolderFunc_createGroupParam(PyObject* self, PyObje // Overloaded function decisor - // 0: createGroupParam(std::string,std::string) + // 0: createGroupParam(QString,QString) if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // createGroupParam(std::string,std::string) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // createGroupParam(QString,QString) } // Function signature not found. @@ -596,13 +596,13 @@ static PyObject* Sbk_UserParamHolderFunc_createGroupParam(PyObject* self, PyObje // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // createGroupParam(std::string,std::string) + // createGroupParam(QString,QString) GroupParam * cppResult = cppSelf->createGroupParam(cppArg0, cppArg1); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_GROUPPARAM_IDX], cppResult); @@ -618,7 +618,7 @@ static PyObject* Sbk_UserParamHolderFunc_createGroupParam(PyObject* self, PyObje return pyResult; Sbk_UserParamHolderFunc_createGroupParam_TypeError: - const char* overloads[] = {"std::string, std::string", 0}; + const char* overloads[] = {"unicode, unicode", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createGroupParam", overloads); return 0; } @@ -645,11 +645,11 @@ static PyObject* Sbk_UserParamHolderFunc_createInt2DParam(PyObject* self, PyObje // Overloaded function decisor - // 0: createInt2DParam(std::string,std::string) + // 0: createInt2DParam(QString,QString) if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // createInt2DParam(std::string,std::string) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // createInt2DParam(QString,QString) } // Function signature not found. @@ -657,13 +657,13 @@ static PyObject* Sbk_UserParamHolderFunc_createInt2DParam(PyObject* self, PyObje // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // createInt2DParam(std::string,std::string) + // createInt2DParam(QString,QString) Int2DParam * cppResult = cppSelf->createInt2DParam(cppArg0, cppArg1); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_INT2DPARAM_IDX], cppResult); @@ -679,7 +679,7 @@ static PyObject* Sbk_UserParamHolderFunc_createInt2DParam(PyObject* self, PyObje return pyResult; Sbk_UserParamHolderFunc_createInt2DParam_TypeError: - const char* overloads[] = {"std::string, std::string", 0}; + const char* overloads[] = {"unicode, unicode", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createInt2DParam", overloads); return 0; } @@ -706,11 +706,11 @@ static PyObject* Sbk_UserParamHolderFunc_createInt3DParam(PyObject* self, PyObje // Overloaded function decisor - // 0: createInt3DParam(std::string,std::string) + // 0: createInt3DParam(QString,QString) if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // createInt3DParam(std::string,std::string) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // createInt3DParam(QString,QString) } // Function signature not found. @@ -718,13 +718,13 @@ static PyObject* Sbk_UserParamHolderFunc_createInt3DParam(PyObject* self, PyObje // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // createInt3DParam(std::string,std::string) + // createInt3DParam(QString,QString) Int3DParam * cppResult = cppSelf->createInt3DParam(cppArg0, cppArg1); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_INT3DPARAM_IDX], cppResult); @@ -740,7 +740,7 @@ static PyObject* Sbk_UserParamHolderFunc_createInt3DParam(PyObject* self, PyObje return pyResult; Sbk_UserParamHolderFunc_createInt3DParam_TypeError: - const char* overloads[] = {"std::string, std::string", 0}; + const char* overloads[] = {"unicode, unicode", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createInt3DParam", overloads); return 0; } @@ -767,11 +767,11 @@ static PyObject* Sbk_UserParamHolderFunc_createIntParam(PyObject* self, PyObject // Overloaded function decisor - // 0: createIntParam(std::string,std::string) + // 0: createIntParam(QString,QString) if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // createIntParam(std::string,std::string) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // createIntParam(QString,QString) } // Function signature not found. @@ -779,13 +779,13 @@ static PyObject* Sbk_UserParamHolderFunc_createIntParam(PyObject* self, PyObject // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // createIntParam(std::string,std::string) + // createIntParam(QString,QString) IntParam * cppResult = cppSelf->createIntParam(cppArg0, cppArg1); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_INTPARAM_IDX], cppResult); @@ -801,7 +801,7 @@ static PyObject* Sbk_UserParamHolderFunc_createIntParam(PyObject* self, PyObject return pyResult; Sbk_UserParamHolderFunc_createIntParam_TypeError: - const char* overloads[] = {"std::string, std::string", 0}; + const char* overloads[] = {"unicode, unicode", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createIntParam", overloads); return 0; } @@ -828,11 +828,11 @@ static PyObject* Sbk_UserParamHolderFunc_createOutputFileParam(PyObject* self, P // Overloaded function decisor - // 0: createOutputFileParam(std::string,std::string) + // 0: createOutputFileParam(QString,QString) if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // createOutputFileParam(std::string,std::string) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // createOutputFileParam(QString,QString) } // Function signature not found. @@ -840,13 +840,13 @@ static PyObject* Sbk_UserParamHolderFunc_createOutputFileParam(PyObject* self, P // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // createOutputFileParam(std::string,std::string) + // createOutputFileParam(QString,QString) OutputFileParam * cppResult = cppSelf->createOutputFileParam(cppArg0, cppArg1); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_OUTPUTFILEPARAM_IDX], cppResult); @@ -862,7 +862,7 @@ static PyObject* Sbk_UserParamHolderFunc_createOutputFileParam(PyObject* self, P return pyResult; Sbk_UserParamHolderFunc_createOutputFileParam_TypeError: - const char* overloads[] = {"std::string, std::string", 0}; + const char* overloads[] = {"unicode, unicode", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createOutputFileParam", overloads); return 0; } @@ -889,11 +889,11 @@ static PyObject* Sbk_UserParamHolderFunc_createPageParam(PyObject* self, PyObjec // Overloaded function decisor - // 0: createPageParam(std::string,std::string) + // 0: createPageParam(QString,QString) if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // createPageParam(std::string,std::string) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // createPageParam(QString,QString) } // Function signature not found. @@ -901,13 +901,13 @@ static PyObject* Sbk_UserParamHolderFunc_createPageParam(PyObject* self, PyObjec // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // createPageParam(std::string,std::string) + // createPageParam(QString,QString) PageParam * cppResult = cppSelf->createPageParam(cppArg0, cppArg1); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_PAGEPARAM_IDX], cppResult); @@ -923,7 +923,7 @@ static PyObject* Sbk_UserParamHolderFunc_createPageParam(PyObject* self, PyObjec return pyResult; Sbk_UserParamHolderFunc_createPageParam_TypeError: - const char* overloads[] = {"std::string, std::string", 0}; + const char* overloads[] = {"unicode, unicode", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createPageParam", overloads); return 0; } @@ -950,12 +950,12 @@ static PyObject* Sbk_UserParamHolderFunc_createParametricParam(PyObject* self, P // Overloaded function decisor - // 0: createParametricParam(std::string,std::string,int) + // 0: createParametricParam(QString,QString,int) if (numArgs == 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1]))) && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // createParametricParam(std::string,std::string,int) + overloadId = 0; // createParametricParam(QString,QString,int) } // Function signature not found. @@ -963,15 +963,15 @@ static PyObject* Sbk_UserParamHolderFunc_createParametricParam(PyObject* self, P // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); int cppArg2; pythonToCpp[2](pyArgs[2], &cppArg2); if (!PyErr_Occurred()) { - // createParametricParam(std::string,std::string,int) + // createParametricParam(QString,QString,int) ParametricParam * cppResult = cppSelf->createParametricParam(cppArg0, cppArg1, cppArg2); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_PARAMETRICPARAM_IDX], cppResult); @@ -987,7 +987,7 @@ static PyObject* Sbk_UserParamHolderFunc_createParametricParam(PyObject* self, P return pyResult; Sbk_UserParamHolderFunc_createParametricParam_TypeError: - const char* overloads[] = {"std::string, std::string, int", 0}; + const char* overloads[] = {"unicode, unicode, int", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createParametricParam", overloads); return 0; } @@ -1014,11 +1014,11 @@ static PyObject* Sbk_UserParamHolderFunc_createPathParam(PyObject* self, PyObjec // Overloaded function decisor - // 0: createPathParam(std::string,std::string) + // 0: createPathParam(QString,QString) if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // createPathParam(std::string,std::string) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // createPathParam(QString,QString) } // Function signature not found. @@ -1026,13 +1026,13 @@ static PyObject* Sbk_UserParamHolderFunc_createPathParam(PyObject* self, PyObjec // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // createPathParam(std::string,std::string) + // createPathParam(QString,QString) PathParam * cppResult = cppSelf->createPathParam(cppArg0, cppArg1); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_PATHPARAM_IDX], cppResult); @@ -1048,7 +1048,7 @@ static PyObject* Sbk_UserParamHolderFunc_createPathParam(PyObject* self, PyObjec return pyResult; Sbk_UserParamHolderFunc_createPathParam_TypeError: - const char* overloads[] = {"std::string, std::string", 0}; + const char* overloads[] = {"unicode, unicode", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createPathParam", overloads); return 0; } @@ -1075,11 +1075,11 @@ static PyObject* Sbk_UserParamHolderFunc_createSeparatorParam(PyObject* self, Py // Overloaded function decisor - // 0: createSeparatorParam(std::string,std::string) + // 0: createSeparatorParam(QString,QString) if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // createSeparatorParam(std::string,std::string) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // createSeparatorParam(QString,QString) } // Function signature not found. @@ -1087,13 +1087,13 @@ static PyObject* Sbk_UserParamHolderFunc_createSeparatorParam(PyObject* self, Py // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // createSeparatorParam(std::string,std::string) + // createSeparatorParam(QString,QString) SeparatorParam * cppResult = cppSelf->createSeparatorParam(cppArg0, cppArg1); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_SEPARATORPARAM_IDX], cppResult); @@ -1109,7 +1109,7 @@ static PyObject* Sbk_UserParamHolderFunc_createSeparatorParam(PyObject* self, Py return pyResult; Sbk_UserParamHolderFunc_createSeparatorParam_TypeError: - const char* overloads[] = {"std::string, std::string", 0}; + const char* overloads[] = {"unicode, unicode", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createSeparatorParam", overloads); return 0; } @@ -1136,11 +1136,11 @@ static PyObject* Sbk_UserParamHolderFunc_createStringParam(PyObject* self, PyObj // Overloaded function decisor - // 0: createStringParam(std::string,std::string) + // 0: createStringParam(QString,QString) if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // createStringParam(std::string,std::string) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // createStringParam(QString,QString) } // Function signature not found. @@ -1148,13 +1148,13 @@ static PyObject* Sbk_UserParamHolderFunc_createStringParam(PyObject* self, PyObj // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // createStringParam(std::string,std::string) + // createStringParam(QString,QString) StringParam * cppResult = cppSelf->createStringParam(cppArg0, cppArg1); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_STRINGPARAM_IDX], cppResult); @@ -1170,7 +1170,7 @@ static PyObject* Sbk_UserParamHolderFunc_createStringParam(PyObject* self, PyObj return pyResult; Sbk_UserParamHolderFunc_createStringParam_TypeError: - const char* overloads[] = {"std::string, std::string", 0}; + const char* overloads[] = {"unicode, unicode", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createStringParam", overloads); return 0; } diff --git a/Engine/Node.cpp b/Engine/Node.cpp index 4b819b3047..54f68c7e7b 100644 --- a/Engine/Node.cpp +++ b/Engine/Node.cpp @@ -111,7 +111,6 @@ namespace { // protect local classes in anonymous namespace public: boost::weak_ptr layer; - boost::weak_ptr layerName; bool hasAllChoice; // if true, the layer has a "all" entry mutable QMutex compsMutex; @@ -121,7 +120,6 @@ namespace { // protect local classes in anonymous namespace ChannelSelector() : layer() - , layerName() , hasAllChoice(false) , compsMutex() , compsAvailable() @@ -136,7 +134,6 @@ namespace { // protect local classes in anonymous namespace void operator=(const ChannelSelector& other) { layer = other.layer; hasAllChoice = other.hasAllChoice; - layerName = other.layerName; QMutexLocker k(&compsMutex); compsAvailable = other.compsAvailable; } @@ -148,7 +145,6 @@ namespace { // protect local classes in anonymous namespace boost::weak_ptr enabled; boost::weak_ptr channel; - boost::weak_ptr channelName; mutable QMutex compsMutex; //Stores the components available at build time of the choice menu @@ -158,7 +154,6 @@ namespace { // protect local classes in anonymous namespace MaskSelector() : enabled() , channel() - , channelName() , compsMutex() , compsAvailable() { @@ -172,7 +167,6 @@ namespace { // protect local classes in anonymous namespace void operator=(const MaskSelector& other) { enabled = other.enabled; channel = other.channel; - channelName = other.channelName; QMutexLocker k(&compsMutex); compsAvailable = other.compsAvailable; } @@ -368,7 +362,7 @@ struct Node::Implementation void runInputChangedCallback(int index,const std::string& script); - void createChannelSelector(int inputNb,const std::string & inputName, bool isOutput,const boost::shared_ptr& page); + void createChannelSelector(int inputNb,const std::string & inputName, bool isOutput,const boost::shared_ptr& page, KnobPtr* lastKnobBeforeAdvancedOption); void onLayerChanged(int inputNb,const ChannelSelector& selector); @@ -822,6 +816,15 @@ Node::load(const CreateNodeArgs& args) #endif assert(_imp->effect); } + + // For readers, set their original frame range when creating them + if (!args.serialization && _imp->effect->isReader()) { + KnobPtr filenameKnob = getKnobByName(kOfxImageEffectFileParamName); + if (filenameKnob) { + computeFrameRangeForReader(filenameKnob.get()); + } + } + _imp->effect->initializeOverlayInteract(); @@ -942,7 +945,7 @@ Node::load(const CreateNodeArgs& args) ///Now that the instance is created, make sure instanceChangedActino is called for all extra default values ///that we set - double time = getEffectInstance()->getCurrentTime(); + /* double time = getEffectInstance()->getCurrentTime(); for (std::list >::const_iterator it = args.paramValues.begin(); it != args.paramValues.end(); ++it) { KnobPtr knob = getKnobByName((*it)->getName()); if (knob) { @@ -962,7 +965,7 @@ Node::load(const CreateNodeArgs& args) } } #endif - + */ } // load bool @@ -2198,7 +2201,16 @@ Node::Implementation::restoreUserKnobsRecursive(const std::listcloneDefaultValues(sKnob.get()); - knob->clone(sKnob.get()); + if (isChoice) { + const ChoiceExtraData* data = dynamic_cast(isRegular->getExtraData()); + assert(data); + if (data) { + isChoice->choiceRestoration(dynamic_cast(sKnob.get()), data); + } + } else { + + knob->clone(sKnob.get()); + } knob->setAsUserKnob(); if (group) { group->addKnob(knob); @@ -3111,7 +3123,7 @@ Node::findPluginFormatKnobs(const KnobsVec & knobs,bool loadingSerialization) std::vector formats; int defValue; getApp()->getProject()->getProjectFormatEntries(&formats, &defValue); - refreshFormatParamChoice(formats, defValue, !loadingSerialization); + refreshFormatParamChoice(formats, defValue, loadingSerialization); } } } @@ -3351,7 +3363,8 @@ void Node::createMaskSelectors(const std::vector >& hasMaskChannelSelector, const std::vector& inputLabels, const boost::shared_ptr& mainPage, - bool addNewLineOnLastMask) + bool addNewLineOnLastMask, + KnobPtr* lastKnobCreated) { assert(hasMaskChannelSelector.size() == inputLabels.size()); @@ -3390,6 +3403,14 @@ Node::createMaskSelectors(const std::vector >& hasMaskChann std::vector choices; choices.push_back("None"); + + const ImageComponents& rgba = ImageComponents::getRGBAComponents(); + const std::string& rgbaCompname = rgba.getComponentsGlobalName(); + const std::vector& rgbaChannels = rgba.getComponentsNames(); + for (std::size_t i = 0; i < rgbaChannels.size(); ++i) { + std::string option = rgbaCompname + '.' + rgbaChannels[i]; + choices.push_back(option); + } /*const ImageComponents& rgba = ImageComponents::getRGBAComponents(); const std::vector& channels = rgba.getComponentsNames(); const std::string& layerName = rgba.getComponentsGlobalName(); @@ -3410,27 +3431,19 @@ Node::createMaskSelectors(const std::vector >& hasMaskChann channel->setName(channelMaskName); } sel.channel = channel; - channel->setAddNewLine(false); if (mainPage) { mainPage->addKnob(channel); } - - boost::shared_ptr channelName = AppManager::createKnob(_imp->effect.get(), "",1,false); - channelName->setSecretByDefault(true); - channelName->setEvaluateOnChange(false); - channelName->setDefaultValue(choices[choices.size() - 1]); - if (mainPage) { - mainPage->addKnob(channelName); - } - sel.channelName = channelName; - + //Make sure the first default param in the vector is MaskInvert if (!addNewLineOnLastMask) { //If there is a MaskInvert parameter, make it on the same line as the Mask channel parameter - channelName->setAddNewLine(false); + channel->setAddNewLine(false); + } + if (!*lastKnobCreated) { + *lastKnobCreated = channel; } - _imp->maskSelectors[i] = sel; @@ -3525,16 +3538,24 @@ Node::findOrCreateChannelEnabled(const boost::shared_ptr& mainPage) bool foundAll = foundEnabled[0] && foundEnabled[1] && foundEnabled[2] && foundEnabled[3]; + bool isWriter = _imp->effect->isWriter(); + if (foundAll) { for (int i = 0; i < 4; ++i) { - if (foundEnabled[i]->getParentKnob() == mainPage) { - //foundEnabled[i]->setAddNewLine(i == 3); - mainPage->removeKnob(foundEnabled[i].get()); - mainPage->insertKnob(i,foundEnabled[i]); + + // Writers already have their checkboxes places correctly + if (!isWriter) { + if (foundEnabled[i]->getParentKnob() == mainPage) { + //foundEnabled[i]->setAddNewLine(i == 3); + mainPage->removeKnob(foundEnabled[i].get()); + mainPage->insertKnob(i,foundEnabled[i]); + } } _imp->enabledChan[i] = foundEnabled[i]; } + + } bool pluginDefaultPref[4]; @@ -3559,7 +3580,7 @@ Node::findOrCreateChannelEnabled(const boost::shared_ptr& mainPage) foundAll = true; } } - if (foundAll && !getApp()->isBackground()) { + if (!isWriter && foundAll && !getApp()->isBackground()) { _imp->enabledChan[3].lock()->setAddNewLine(false); boost::shared_ptr premultWarning = AppManager::createKnob(_imp->effect.get(), "", 1, false); premultWarning->setIconLabel("dialog-warning"); @@ -3581,26 +3602,19 @@ Node::findOrCreateChannelEnabled(const boost::shared_ptr& mainPage) void Node::createChannelSelectors(const std::vector >& hasMaskChannelSelector, const std::vector& inputLabels, - const boost::shared_ptr& mainPage) + const boost::shared_ptr& mainPage, + KnobPtr* lastKnobBeforeAdvancedOption) { - KnobsVec mainPageChildren = mainPage->getChildren(); - bool skipSeparator = !mainPageChildren.empty() && dynamic_cast(mainPageChildren.back().get()); - - if (!skipSeparator) { - boost::shared_ptr sep = AppManager::createKnob(_imp->effect.get(), "", 1, false); - sep->setName("advancedSep"); - mainPage->addKnob(sep); - } - + ///Create input layer selectors for (std::size_t i = 0; i < inputLabels.size(); ++i) { if (!hasMaskChannelSelector[i].first) { - _imp->createChannelSelector(i,inputLabels[i], false, mainPage); + _imp->createChannelSelector(i,inputLabels[i], false, mainPage, lastKnobBeforeAdvancedOption); } } ///Create output layer selectors - _imp->createChannelSelector(-1, "Output", true, mainPage); + _imp->createChannelSelector(-1, "Output", true, mainPage, lastKnobBeforeAdvancedOption); } void @@ -3662,8 +3676,9 @@ Node::initializeDefaultKnobs(int renderScaleSupportPref,bool loadingSerializatio assert(mainPage); // Create the Output Layer choice if needed plus input layers selectors + KnobPtr lastKnobBeforeAdvancedOption; if (_imp->effect->getCreateChannelSelectorKnob()) { - createChannelSelectors(hasMaskChannelSelector, inputLabels, mainPage); + createChannelSelectors(hasMaskChannelSelector, inputLabels, mainPage, &lastKnobBeforeAdvancedOption); } @@ -3686,7 +3701,7 @@ Node::initializeDefaultKnobs(int renderScaleSupportPref,bool loadingSerializatio assert(foundPluginDefaultKnobsToReorder.size() > 0 && foundPluginDefaultKnobsToReorder[0].first == kOfxMaskInvertParamName); - createMaskSelectors(hasMaskChannelSelector, inputLabels, mainPage, !foundPluginDefaultKnobsToReorder[0].second.get()); + createMaskSelectors(hasMaskChannelSelector, inputLabels, mainPage, !foundPluginDefaultKnobsToReorder[0].second.get(), &lastKnobBeforeAdvancedOption); //Create the host mix if needed @@ -3707,6 +3722,28 @@ Node::initializeDefaultKnobs(int renderScaleSupportPref,bool loadingSerializatio } } + if (lastKnobBeforeAdvancedOption) { + KnobsVec mainPageChildren = mainPage->getChildren(); + int i = 0; + for (KnobsVec::iterator it = mainPageChildren.begin(); it != mainPageChildren.end(); ++it, ++i) { + if (*it == lastKnobBeforeAdvancedOption) { + if (i > 0) { + KnobsVec::iterator prev = it; + --prev; + if (!dynamic_cast(prev->get())) { + boost::shared_ptr sep = AppManager::createKnob(_imp->effect.get(), "", 1, false); + sep->setName("advancedSep"); + mainPage->insertKnob(i - 1, sep); + } + } + + break; + } + } + + } + + createNodePage(settingsPage,renderScaleSupportPref); createInfoPage(); @@ -3767,7 +3804,8 @@ Node::initializeKnobs(int renderScaleSupportPref,bool loadingSerialization) void Node::Implementation::createChannelSelector(int inputNb,const std::string & inputName,bool isOutput, - const boost::shared_ptr& page) + const boost::shared_ptr& page, + KnobPtr* lastKnobBeforeAdvancedOption) { ChannelSelector sel; @@ -3797,14 +3835,9 @@ Node::Implementation::createChannelSelector(int inputNb,const std::string & inpu std::map defaultLayers; { - int i = 0; - while (ImageComponents::defaultComponents[i][0] != 0) { - std::string layer = ImageComponents::defaultComponents[i][0]; - if (layer != kNatronAlphaComponentsName && layer != kNatronRGBAComponentsName && layer != kNatronRGBComponentsName) { - //Do not add the color plane, because it is handled in a separate case to make sure it is always the first choice - defaultLayers[layer] = -1; - } - ++i; + std::vector projectLayers = _publicInterface->getApp()->getProject()->getProjectDefaultLayerNames(); + for (std::size_t i = 0; i < projectLayers.size(); ++i) { + defaultLayers[projectLayers[i]] = -1; } } baseLayers.push_back(kNatronRGBAPlaneUserName); @@ -3827,14 +3860,9 @@ Node::Implementation::createChannelSelector(int inputNb,const std::string & inpu } layer->setDefaultValue(defVal); - boost::shared_ptr layerName = AppManager::createKnob(effect.get(), inputName + "_layer_name", 1, false); - layerName->setSecretByDefault(true); - layerName->setAnimationEnabled(false); - layerName->setEvaluateOnChange(false); - layerName->setDefaultValue(baseLayers[defVal]); - //layerName->setAddNewLine(!sel.useRGBASelectors); - page->addKnob(layerName); - sel.layerName = layerName; + if (!*lastKnobBeforeAdvancedOption) { + *lastKnobBeforeAdvancedOption = layer; + } channelsSelectors[inputNb] = sel; @@ -4818,6 +4846,8 @@ Node::connectInput(const NodePtr & input, input->connectOutput(useGuiInputs,shared_from_this()); } + getApp()->recheckInvalidExpressions(); + ///Get notified when the input name has changed QObject::connect( input.get(), SIGNAL(labelChanged(QString)), this, SLOT(onInputLabelChanged(QString)) ); @@ -5347,9 +5377,10 @@ Node::deactivate(const std::list< NodePtr > & outputsToDisconnect, clearPersistentMessage(false); boost::shared_ptr parentCol = getGroup(); - NodeGroup* isParentGroup = dynamic_cast(parentCol.get()); - ///For all knobs that have listeners, kill expressions + + ///For all knobs that have listeners, invalidate expressions + NodeGroup* isParentGroup = dynamic_cast(parentCol.get()); const KnobsVec & knobs = getKnobs(); for (U32 i = 0; i < knobs.size(); ++i) { KnobI::ListenerDimsMap listeners; @@ -5388,12 +5419,18 @@ Node::deactivate(const std::list< NodePtr > & outputsToDisconnect, std::string hasExpr = listener->getExpression(dim); if (!hasExpr.empty()) { - listener->clearExpression(dim,true); + std::stringstream ss; + ss << tr("Missing node ").toStdString(); + ss << getFullyQualifiedName(); + ss << ' '; + ss << tr("in expression.").toStdString(); + listener->setExpressionInvalid(dim, false, ss.str()); } } isEffect->endChanges(true); } } + ///if the node has 1 non-optional input, attempt to connect the outputs to the input of the current node ///this node is the node the outputs should attempt to connect to @@ -5550,6 +5587,8 @@ Node::deactivate(const std::list< NodePtr > & outputsToDisconnect, _imp->runOnNodeDeleteCB(); } + deleteNodeVariableToPython(getFullyQualifiedName()); + } // deactivate void @@ -5642,6 +5681,9 @@ Node::activate(const std::list< NodePtr > & outputsToRestore, } _imp->runOnNodeCreatedCB(true); + + getApp()->recheckInvalidExpressions(); + declareAllPythonAttributes(); } // activate void @@ -5692,6 +5734,8 @@ Node::destroyNodeInternal(bool fromDest, bool autoReconnect) ///This will not remove from the disk cache if the project is closing removeAllImagesFromCache(false); + getApp()->recheckInvalidExpressions(); + ///Remove the Python node deleteNodeVariableToPython(getFullyQualifiedName()); @@ -5702,6 +5746,7 @@ Node::destroyNodeInternal(bool fromDest, bool autoReconnect) }*/ ///Kill the effect + _imp->effect->clearPluginMemoryChunks(); _imp->effect.reset(); ///If inside the group, remove it from the group @@ -6593,7 +6638,7 @@ Node::onAllKnobsSlaved(bool isSlave, } void -Node::onKnobSlaved(KnobI* slave,KnobI* master, +Node::onKnobSlaved(const KnobPtr& slave,const KnobPtr& master, int dimension, bool isSlave) { @@ -6787,39 +6832,7 @@ Node::isMaskChannelKnob(const KnobI* knob) const return -1; } -int -Node::getMaskChannel(int inputNb,ImageComponents* comps,NodePtr* maskInput) const -{ - std::map::const_iterator it = _imp->maskSelectors.find(inputNb); - if ( it != _imp->maskSelectors.end() ) { - int index = it->second.channel.lock()->getValue(); - if (index == 0) { - *comps = ImageComponents::getNoneComponents(); - maskInput->reset(); - return -1; - } else { - index -= 1; // None choice - QMutexLocker locker(&it->second.compsMutex); - int k = 0; - for (std::size_t i = 0; i < it->second.compsAvailable.size(); ++i) { - if (index >= k && index < (it->second.compsAvailable[i].first.getNumComponents() + k)) { - int compIndex = index - k; - assert(compIndex >= 0 && compIndex <= 3); - *comps = it->second.compsAvailable[i].first; - *maskInput = it->second.compsAvailable[i].second.lock(); - return compIndex; - } - k += it->second.compsAvailable[i].first.getNumComponents(); - } - - } - //Default to alpha - *comps = ImageComponents::getAlphaComponents(); - return 0; - } - return -1; - -} + bool Node::isMaskEnabled(int inputNb) const @@ -7065,7 +7078,7 @@ Node::duringInputChangedAction() const } void -Node::computeFrameRangeForReader(const KnobI* fileKnob) +Node::computeFrameRangeForReader(KnobI* fileKnob) { /* We compute the original frame range of the sequence for the plug-in @@ -7092,7 +7105,7 @@ Node::computeFrameRangeForReader(const KnobI* fileKnob) KnobInt* originalFrameRange = dynamic_cast(knob.get()); if (originalFrameRange && originalFrameRange->getDimension() == 2) { - const KnobFile* isFile = dynamic_cast(fileKnob); + KnobFile* isFile = dynamic_cast(fileKnob); assert(isFile); if (!isFile) { throw std::logic_error("Node::computeFrameRangeForReader"); @@ -7669,6 +7682,24 @@ Node::onEffectKnobValueChanged(KnobI* what, } } } else if (_imp->effect->isWriter()) { + + KnobPtr sublabelKnob = getKnobByName(kNatronOfxParamStringSublabelName); + KnobOutputFile* isFile = dynamic_cast(what); + if (isFile && sublabelKnob && reason != eValueChangedReasonPluginEdited) { + Knob* isString = dynamic_cast*>(sublabelKnob.get()); + + std::string pattern = isFile->getValue(); + if (isString) { + + std::size_t foundSlash = pattern.find_last_of("/"); + if (foundSlash != std::string::npos) { + pattern = pattern.substr(foundSlash + 1); + } + + isString->setValue(pattern); + } + } + /* Check if the filename param has a %V in it, in which case make sure to hide the Views parameter */ @@ -7765,15 +7796,8 @@ Node::Implementation::getSelectedLayerInternal(int inputNb,const ChannelSelector boost::shared_ptr layerKnob = selector.layer.lock(); assert(layerKnob); - int index = layerKnob->getValue(); - std::vector entries = layerKnob->getEntries_mt_safe(); - if (entries.empty()) { - return false; - } - if (index < 0 || index >= (int)entries.size()) { - return false; - } - const std::string& layer = entries[index]; + std::string layer = layerKnob->getActiveEntryText_mt_safe(); + if (layer == "All") { return false; } @@ -7803,17 +7827,16 @@ Node::Implementation::getSelectedLayerInternal(int inputNb,const ChannelSelector } } } + + if (comp->getNumComponents() == 0) { - if (mappedLayerName == kNatronRGBAComponentsName) { - *comp = ImageComponents::getRGBAComponents(); - } else if (mappedLayerName == kNatronDisparityLeftPlaneName) { - *comp = ImageComponents::getDisparityLeftComponents(); - } else if (mappedLayerName == kNatronDisparityRightPlaneName) { - *comp = ImageComponents::getDisparityRightComponents(); - } else if (mappedLayerName == kNatronBackwardMotionVectorsPlaneName) { - *comp = ImageComponents::getBackwardMotionComponents(); - } else if (mappedLayerName == kNatronForwardMotionVectorsPlaneName) { - *comp = ImageComponents::getForwardMotionComponents(); + + std::vector projectLayers = _publicInterface->getApp()->getProject()->getProjectDefaultLayers(); + for (std::size_t i = 0; i < projectLayers.size(); ++i) { + if (projectLayers[i].getLayerName() == mappedLayerName) { + *comp = projectLayers[i]; + break; + } } } return true; @@ -7826,13 +7849,10 @@ Node::Implementation::onLayerChanged(int inputNb,const ChannelSelector& selector { boost::shared_ptr layerKnob = selector.layer.lock(); - std::vector entries = layerKnob->getEntries_mt_safe(); - int curLayer_i = layerKnob->getValue(); - assert(curLayer_i >= 0 && curLayer_i < (int)entries.size()); - selector.layerName.lock()->setValue(entries[curLayer_i]); + std::string curLayer = layerKnob->getActiveEntryText_mt_safe(); if (inputNb == -1) { - bool outputIsAll = entries[curLayer_i] == "All"; + bool outputIsAll = curLayer == "All"; ///Disable all input selectors as it doesn't make sense to edit them whilst output is All for (std::map::iterator it = channelsSelectors.begin(); it != channelsSelectors.end(); ++it) { @@ -7949,15 +7969,6 @@ Node::Implementation::onMaskSelectorChanged(int inputNb,const MaskSelector& sele } } - std::vector entries = channel->getEntries_mt_safe(); - int curChan_i = channel->getValue(); - if (curChan_i < 0 || curChan_i >= (int)entries.size()) { - _publicInterface->refreshChannelSelectors(); - return; - } - selector.channelName.lock()->setValue(entries[curChan_i]); - - if (!isRefreshingInputRelatedData) { ///Clip preferences have changed RenderScale s(1.); @@ -8754,7 +8765,7 @@ bool Node::refreshLayersChoiceSecretness(int inputNb) { std::map::iterator foundChan = _imp->channelsSelectors.find(inputNb); - NodePtr inp = getInput(inputNb); + NodePtr inp = getInputInternal(false/*useGuiInput*/, false/*useGroupRedirections*/, inputNb); if ( foundChan != _imp->channelsSelectors.end() ) { std::map::iterator foundOuptut = _imp->channelsSelectors.find(-1); bool outputIsAll = false; @@ -8834,12 +8845,16 @@ Node::refreshAllInputRelatedData(bool /*canChangeValues*/,const std::vectorgetProject()->isLoadingProject(); ///if all non optional clips are connected, call getClipPrefs ///The clip preferences action is never called until all non optional clips have been attached to the plugin. - if (!hasMandatoryInputDisconnected()) { + /// EDIT: we allow calling getClipPreferences even if some non optional clip is not connected so that layer menus get properly created + const bool canCallRefreshMetaData = true; // = !hasMandatoryInputDisconnected(); + + if (canCallRefreshMetaData) { - if (getApp()->getProject()->isLoadingProject()) { + if (loadingProject) { //Nb: we clear the action cache because when creating the node many calls to getRoD and stuff might have returned //empty rectangles, but since we force the hash to remain what was in the project file, we might then get wrong RoDs returned _imp->effect->clearActionsCache(); @@ -8871,7 +8886,7 @@ Node::refreshAllInputRelatedData(bool /*canChangeValues*/,const std::vectorgetProject()->isLoadingProject()) { + if (loadingProject) { //When loading the project, refresh the hash of the nodes in a recursive manner in the proper order //for the disk cache to work hasChanged |= computeHashInternal(); @@ -9252,14 +9267,21 @@ Node::deleteNodeVariableToPython(const std::string& nodeName) return; } QString appID = QString::fromUtf8(getApp()->getAppIDString().c_str()); - QString str = QString(QString::fromUtf8("del ") + appID + QString::fromUtf8(".%1")).arg(QString::fromUtf8(nodeName.c_str())); - std::string script = str.toStdString(); - std::string err; - if (!appPTR->isBackground()) { - getApp()->printAutoDeclaredVariable(script); - } - if (!NATRON_PYTHON_NAMESPACE::interpretPythonScript(script, &err, 0)) { - qDebug() << err.c_str(); + + std::string nodeFullName = appID.toStdString() + "." + nodeName; + bool alreadyDefined = false; + PyObject* nodeObj = Python::getAttrRecursive(nodeFullName, appPTR->getMainModule(), &alreadyDefined); + assert(nodeObj); + Q_UNUSED(nodeObj); + if (alreadyDefined) { + std::string script = "del " + nodeFullName; + std::string err; + if (!appPTR->isBackground()) { + getApp()->printAutoDeclaredVariable(script); + } + if (!NATRON_PYTHON_NAMESPACE::interpretPythonScript(script, &err, 0)) { + qDebug() << err.c_str(); + } } } @@ -9357,7 +9379,16 @@ Node::removeParameterFromPython(const std::string& parameterName) } } - +void +Node::declareAllPythonAttributes() +{ + declareNodeVariableToPython(getFullyQualifiedName()); + declarePythonFields(); + if (_imp->rotoContext) { + declareRotoPythonField(); + } +#pragma message WARN("Also declare tracker ctx to python in 2.1") +} std::string Node::getKnobChangedCallback() const @@ -9650,6 +9681,9 @@ Node::getChannelSelectorKnob(int inputNb) const void Node::checkForPremultWarningAndCheckboxes() { + if (isOutputNode()) { + return; + } boost::shared_ptr chans[4]; boost::shared_ptr premultWarn = _imp->premultWarning.lock(); if (!premultWarn) { @@ -9708,6 +9742,201 @@ Node::checkForPremultWarningAndCheckboxes() } + +static void parseLayerString(const std::string& encoded, bool* isColor) +{ + if (encoded == kNatronRGBAPlaneUserName || + encoded == kNatronRGBPlaneUserName || + encoded == kNatronAlphaPlaneUserName) { + *isColor = true; + } else { + *isColor = false; + } +} + +static bool parseMaskChannelString(const std::string& encodedChannel, + std::string* nodeName, + std::string* layerName, + std::string* channelName, + bool *isColor) +{ + std::size_t foundLastDot = encodedChannel.find_last_of('.'); + if (foundLastDot == std::string::npos) { + *isColor = false; + if (encodedChannel == "None") { + *layerName = "None"; + return true; + } + return false; + } + *channelName = encodedChannel.substr(foundLastDot + 1); + + std::string baseName = encodedChannel.substr(0, foundLastDot); + std::size_t foundPrevDot = baseName.find_first_of('.'); + if (foundPrevDot != std::string::npos) { + //Remove the node name + *layerName = baseName.substr(foundPrevDot + 1); + *nodeName = baseName.substr(0, foundPrevDot); + } else { + *layerName = baseName; + nodeName->clear(); + } + *isColor = *layerName == kNatronRGBAComponentsName || *layerName == kNatronRGBComponentsName || *layerName == kNatronAlphaComponentsName; + return true; +} + +class MergeMaskChannelData : public KnobChoiceMergeEntriesData +{ +public: + + std::string bNode, bLayer, bChannel; + bool isColor; + bool dataSet; + + MergeMaskChannelData() + : KnobChoiceMergeEntriesData() + , isColor(false) + , dataSet(false) + { + + } + + virtual void clear() + { + dataSet = false; + bNode.clear(); + bLayer.clear(); + bChannel.clear(); + } + + virtual ~MergeMaskChannelData() + { + + } +}; + +static bool maskChannelEqualityFunctorInternal(const std::string& aLayer, + const std::string& aChannel, + const std::string& bLayer, + const std::string& bChannel, + bool aIsColor, + bool bIsColor) +{ + if (aChannel.empty() && bChannel.empty()) { + // None choice + return aLayer == bLayer; + } else if (aChannel != bChannel) { + return false; + } else { + // Same channel, check layer + if (aLayer == bLayer) { + return true; + } else if (aIsColor && bIsColor) { + return true; + } + } + return false; +} + +static bool maskChannelEqualityFunctor(const std::string& a, const std::string& b, KnobChoiceMergeEntriesData* data) +{ + MergeMaskChannelData* mergeData = dynamic_cast(data); + assert(mergeData); + std::string aNode,aLayer,aChannel; + bool aIsColor; + parseMaskChannelString(a,&aNode,&aLayer,&aChannel,&aIsColor); + if (!mergeData->dataSet) { + parseMaskChannelString(b,&mergeData->bNode,&mergeData->bLayer,&mergeData->bChannel,&mergeData->isColor); + mergeData->dataSet = true; + } + return maskChannelEqualityFunctorInternal(aLayer, aChannel, mergeData->bLayer, mergeData->bChannel, aIsColor, mergeData->isColor); +} + + +class MergeLayerData : public KnobChoiceMergeEntriesData +{ +public: + + bool isColor; + bool dataSet; + + MergeLayerData() + : KnobChoiceMergeEntriesData() + , isColor(false) + , dataSet(false) + { + + } + + virtual void clear() + { + dataSet = false; + } + + virtual ~MergeLayerData() + { + + } +}; + + +static bool layerEqualityFunctor(const std::string& a, const std::string& b, KnobChoiceMergeEntriesData* data) +{ + MergeLayerData* mergeData = dynamic_cast(data); + assert(mergeData); + bool aIsColor; + parseLayerString(a, &aIsColor); + if (!mergeData->dataSet) { + parseLayerString(b, &mergeData->isColor); + mergeData->dataSet = true; + } + if (aIsColor && mergeData->isColor) { + return true; + } else if (a == b) { + return true; + } + return false; +} + +int +Node::getMaskChannel(int inputNb,ImageComponents* comps,NodePtr* maskInput) const +{ + std::map::const_iterator it = _imp->maskSelectors.find(inputNb); + if ( it != _imp->maskSelectors.end() ) { + std::string maskEncoded = it->second.channel.lock()->getActiveEntryText_mt_safe(); + std::string nodeName, layerName, channelName; + bool isColor; + bool ok = parseMaskChannelString(maskEncoded, &nodeName, &layerName, &channelName, &isColor); + if (!ok || layerName == "None") { + *comps = ImageComponents::getNoneComponents(); + maskInput->reset(); + return -1; + } else { + QMutexLocker locker(&it->second.compsMutex); + for (std::size_t i = 0; i < it->second.compsAvailable.size(); ++i) { + if (it->second.compsAvailable[i].first.getLayerName() == layerName || + (isColor && it->second.compsAvailable[i].first.isColorPlane())) { + + const std::vector& channels = it->second.compsAvailable[i].first.getComponentsNames(); + for (std::size_t j = 0; j < channels.size(); ++j) { + if (channels[j] == channelName) { + *comps = it->second.compsAvailable[i].first; + *maskInput = it->second.compsAvailable[i].second.lock(); + return j; + } + } + } + } + + } + //Default to alpha + // *comps = ImageComponents::getAlphaComponents(); + //return 0; + } + return -1; + +} + bool Node::refreshChannelSelectors() { @@ -9729,12 +9958,8 @@ Node::refreshChannelSelectors() } boost::shared_ptr layerKnob = it->second.layer.lock(); - const std::vector currentLayerEntries = layerKnob->getEntries_mt_safe(); - const std::string curLayer_internalName = it->second.layerName.lock()->getValue(); - const std::string curLayer = ImageComponents::mapUserFriendlyPlaneNameToNatronInternalPlaneName(curLayer_internalName); - - bool isCurLayerColorComp = curLayer == kNatronAlphaComponentsName || curLayer == kNatronRGBAComponentsName || curLayer == kNatronRGBComponentsName; - + + // The Output Layer menu has a All choice, input layers menus have a None choice. std::vector choices; if (it->second.hasAllChoice) { choices.push_back("All"); @@ -9743,31 +9968,25 @@ Node::refreshChannelSelectors() } int gotColor = -1; - ImageComponents colorComp,selectedComp; + ImageComponents colorComp; - /* - These are default layers that we always display in the layer selector. - If one of them is found in the clip preferences, we set the default value to it. - */ + // + // These are default layers that we always display in the layer selector. + // If one of them is found in the clip preferences, we set the default value to it. + // std::map defaultLayers; { - int i = 0; - while (ImageComponents::defaultComponents[i][0] != 0) { - std::string layer = ImageComponents::defaultComponents[i][0]; - if (layer != kNatronAlphaComponentsName && layer != kNatronRGBAComponentsName && layer != kNatronRGBComponentsName) { - //Do not add the color plane, because it is handled in a separate case to make sure it is always the first choice - defaultLayers[layer] = -1; - } - ++i; + std::vector projectLayers = getApp()->getProject()->getProjectDefaultLayerNames(); + for (std::size_t i = 0; i < projectLayers.size(); ++i) { + defaultLayers[projectLayers[i]] = -1; } } + - int foundCurLayerChoice = -1; - if (curLayer == "All" || curLayer == "None") { - foundCurLayerChoice = 0; - } - + // We may not have an input if (node) { + + // Get the components available on the node EffectInstance::ComponentsAvailableMap compsAvailable; node->getEffectInstance()->getComponentsAvailable(it->first != -1, true, time, &compsAvailable); { @@ -9775,6 +9994,8 @@ Node::refreshChannelSelectors() it->second.compsAvailable = compsAvailable; } for (EffectInstance::ComponentsAvailableMap::iterator it2 = compsAvailable.begin(); it2!= compsAvailable.end(); ++it2) { + + // Insert the color plane second in the menu if (it2->first.isColorPlane()) { int numComp = it2->first.getNumComponents(); colorComp = it2->first; @@ -9797,13 +10018,8 @@ Node::refreshChannelSelectors() } choices.insert(pos,colorCompName); - if (foundCurLayerChoice == -1 && isCurLayerColorComp) { - selectedComp = it2->first; - foundCurLayerChoice = 1; - } - - - ///Increment all default indexes + + // Increment all default indexes since we inserted color in the list for (std::map::iterator it = defaultLayers.begin() ;it!=defaultLayers.end(); ++it) { if (it->second != -1) { ++it->second; @@ -9820,15 +10036,11 @@ Node::refreshChannelSelectors() choices.push_back(choiceName); - if (foundCurLayerChoice == -1 && it2->first.getLayerName() == curLayer) { - selectedComp = it2->first; - foundCurLayerChoice = choices.size()-1; - } - } } } // if (node) { + // If we did not find the color plane, insert it since it is the unique mandatory plane. if (gotColor == -1) { assert(choices.size() > 0); std::vector::iterator pos = choices.begin(); @@ -9844,76 +10056,29 @@ Node::refreshChannelSelectors() choices.insert(pos,kNatronRGBAPlaneUserName); } + + // Insert default layers for (std::map::iterator itl = defaultLayers.begin(); itl != defaultLayers.end(); ++itl) { if (itl->second == -1) { std::string choiceName = ImageComponents::mapNatronInternalPlaneNameToUserFriendlyPlaneName(itl->first); choices.push_back(choiceName); - - if (foundCurLayerChoice == -1 && itl->first == curLayer) { - selectedComp = ImageComponents::getDefaultComponent(itl->first); - foundCurLayerChoice = choices.size()-1; - } - } } - if (choices.size() != currentLayerEntries.size()) { - hasChanged = true; - } else { - for (std::size_t i = 0; i < currentLayerEntries.size(); ++i) { - if (currentLayerEntries[i] != choices[i]) { - hasChanged = true; - break; - } - } - } - - layerKnob->populateChoices(choices); - if (hasChanged) { - s_outputLayerChanged(); - } + const std::vector currentLayerEntries = layerKnob->getEntries_mt_safe(); + const std::string curLayer_FriendlyName = layerKnob->getActiveEntryText_mt_safe(); + const std::string curLayer = ImageComponents::mapUserFriendlyPlaneNameToNatronInternalPlaneName(curLayer_FriendlyName); - if (!curLayer.empty() && foundCurLayerChoice != -1) { - //We already had a choice and it was found in the current layers - assert(foundCurLayerChoice >= 0 && foundCurLayerChoice < (int)choices.size()); - layerKnob->blockValueChanges(); - _imp->effect->beginChanges(); - layerKnob->setValue(foundCurLayerChoice); - _imp->effect->endChanges(true); - layerKnob->unblockValueChanges(); - if (it->first == -1 && _imp->enabledChan[0].lock()) { - refreshEnabledKnobsLabel(selectedComp); - } - - } else { - //fallback - bool foundLayer = false; - if (!curLayer_internalName.empty()) { - //check if the layer is in the available options: since we had default layers that may not be produced, it may be in the list - //but not in the components presents - for (std::size_t i = 0; i < currentLayerEntries.size(); ++i) { - if (currentLayerEntries[i] == curLayer_internalName) { - layerKnob->setValue(i); - it->second.layerName.lock()->setValue(choices[i]); - foundLayer = true; - break; - } - } - + { + MergeLayerData tmpData; + bool menuChanged = layerKnob->populateChoices(choices, std::vector(), layerEqualityFunctor,&tmpData); + if (menuChanged) { + hasChanged = true; + s_outputLayerChanged(); } - if (!foundLayer) { - if (it->second.hasAllChoice && - _imp->effect->isPassThroughForNonRenderedPlanes() == EffectInstance::ePassThroughRenderAllRequestedPlanes) { - layerKnob->setValue(0); - it->second.layerName.lock()->setValue(choices[0]); - } else { - assert(gotColor != -1 && gotColor >= 0 && gotColor < (int)choices.size()); - layerKnob->setValue(gotColor); - it->second.layerName.lock()->setValue(choices[gotColor]); - } - } // !foundLayer } + } // for (std::map::iterator it = _imp->channelsSelectors.begin(); it != _imp->channelsSelectors.end(); ++it) { NodePtr prefInputNode; @@ -9931,33 +10096,10 @@ Node::refreshChannelSelectors() } else { node = getInput(it->first); } - - boost::shared_ptr channelKnob = it->second.channel.lock(); - boost::shared_ptr channelNameKnob = it->second.channelName.lock(); - const std::vector currentLayerEntries = channelKnob->getEntries_mt_safe(); - const std::string curLayer = channelNameKnob->getValue(); - std::string curLayerName = curLayer,curChannelName; - { - std::size_t foundLastDot = curLayer.find_last_of("."); - if (foundLastDot != std::string::npos) { - curLayerName = curLayer.substr(0, foundLastDot); - std::size_t foundPrevDot = curLayerName.find_first_of("."); - if (foundPrevDot != std::string::npos) { - //Remove the node name - curLayerName = curLayerName.substr(foundPrevDot + 1); - } - curChannelName = curLayer.substr(foundLastDot + 1); - } - } - - bool isCurLayerColor = curLayerName == kNatronRGBAComponentsName || - curLayerName == kNatronRGBComponentsName || - curLayerName == kNatronAlphaComponentsName; - + std::vector choices; choices.push_back("None"); - int alphaIndex = 0; //Get the mask input components EffectInstance::ComponentsAvailableMap compsAvailable; @@ -10010,21 +10152,12 @@ Node::refreshChannelSelectors() QMutexLocker k(&it->second.compsMutex); it->second.compsAvailable = compsOrdered; } - int foundLastLayerChoice = -1; - if (curLayer == "None") { - foundLastLayerChoice = 0; - } + for (std::vector >::iterator it2 = compsOrdered.begin(); it2!= compsOrdered.end(); ++it2) { const std::vector& channels = it2->first.getComponentsNames(); - const std::string& layerName = it2->first.isColorPlane() ? it2->first.getComponentsGlobalName() : it2->first.getLayerName(); - bool isLastLayer = false; - bool isColorPlane = it2->first.isColorPlane(); - - if (foundLastLayerChoice == -1 && (layerName == curLayerName || (isCurLayerColor && isColorPlane))) { - isLastLayer = true; - } - + bool isColor = it2->first.isColorPlane(); + const std::string& layerName = isColor ? it2->first.getComponentsGlobalName() : it2->first.getLayerName(); NodePtr providerNode = it2->second.lock(); std::string nodeName; @@ -10033,74 +10166,36 @@ Node::refreshChannelSelectors() } for (std::size_t i = 0; i < channels.size(); ++i) { + std::string option; - if (!nodeName.empty()) { + if (!isColor) { option += nodeName; - option += '.'; + if (!nodeName.empty()) { + option += '.'; + } } + option += layerName; if (!layerName.empty()) { - option += layerName; option += '.'; } option += channels[i]; choices.push_back(option); - if (isLastLayer && channels[i] == curChannelName) { - foundLastLayerChoice = choices.size() - 1; - } } - if (it2->first.isColorPlane()) { - if (channels.size() == 1 || channels.size() == 4) { - alphaIndex = choices.size() - 1; - } else { - alphaIndex = 0; - } - } + + } + boost::shared_ptr channelKnob = it->second.channel.lock(); + const std::vector currentLayerEntries = channelKnob->getEntries_mt_safe(); + const std::string curChannelEncoded = channelKnob->getActiveEntryText_mt_safe(); - /*if (!gotColor) { - const ImageComponents& rgba = ImageComponents::getRGBAComponents(); - const std::vector& channels = rgba.getComponentsNames(); - const std::string& layerName = rgba.getComponentsGlobalName(); - for (std::size_t i = 0; i < channels.size(); ++i) { - choices.push_back(layerName + "." + channels[i]); - } - alphaIndex = choices.size() - 1; - }*/ - - if (choices.size() != currentLayerEntries.size()) { - hasChanged = true; - } else { - for (std::size_t i = 0; i < currentLayerEntries.size(); ++i) { - if (currentLayerEntries[i] != choices[i]) { - hasChanged = true; - break; - } - } + // This will merge previous channels with new channels available while retaining previously existing channels. + { + MergeMaskChannelData tmpData; + hasChanged |= channelKnob->populateChoices(choices, std::vector(), maskChannelEqualityFunctor, &tmpData); } - channelKnob->populateChoices(choices); - - /*if (setValues) { - assert(alphaIndex != -1 && alphaIndex >= 0 && alphaIndex < (int)choices.size()); - channelKnob->setValue(alphaIndex,0); - channelNameKnob->setValue(choices[alphaIndex], 0); - } else {*/ - if (foundLastLayerChoice != -1 && foundLastLayerChoice != 0) { - channelKnob->blockValueChanges(); - _imp->effect->beginChanges(); - channelKnob->setValue(foundLastLayerChoice); - channelKnob->unblockValueChanges(); - channelNameKnob->setValue(choices[foundLastLayerChoice]); - _imp->effect->endChanges(); - - } else { - assert(alphaIndex != -1 && alphaIndex >= 0 && alphaIndex < (int)choices.size()); - channelKnob->setValue(alphaIndex); - channelNameKnob->setValue(choices[alphaIndex]); - } - //} } //Notify the effect channels have changed (the viewer needs this) diff --git a/Engine/Node.h b/Engine/Node.h index 7e7eff2e76..3ad4920a04 100644 --- a/Engine/Node.h +++ b/Engine/Node.h @@ -817,7 +817,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON void onAllKnobsSlaved(bool isSlave,KnobHolder* master); - void onKnobSlaved(KnobI* slave,KnobI* master,int dimension,bool isSlave); + void onKnobSlaved(const KnobPtr& slave,const KnobPtr& master,int dimension,bool isSlave); NodePtr getMasterNode() const; @@ -919,8 +919,8 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON struct KnobLink { ///The knob being slaved - KnobI* slave; - KnobI* master; + KnobWPtr slave; + KnobWPtr master; ///The master node to which the knob is slaved to NodeWPtr masterNode; @@ -962,7 +962,8 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON void createMaskSelectors(const std::vector >& hasMaskChannelSelector, const std::vector& inputLabels, const boost::shared_ptr& mainPage, - bool addNewLineOnLastMask); + bool addNewLineOnLastMask, + KnobPtr* lastKnobCreated); boost::shared_ptr getOrCreateMainPage(); @@ -972,7 +973,8 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON void createChannelSelectors(const std::vector >& hasMaskChannelSelector, const std::vector& inputLabels, - const boost::shared_ptr& mainPage); + const boost::shared_ptr& mainPage, + KnobPtr* lastKnobBeforeAdvancedOption); public: @@ -1017,7 +1019,14 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON * @brief Declares to Python all parameters as attribute of the variable representing this node. **/ void declarePythonFields(); - + +private: + /** + * @brief Declares to Python all parameters, roto, tracking attributes + * This is called in activate() whenever the node was deleted + **/ + void declareAllPythonAttributes(); +public: /** * @brief Set the node name. * Throws a run-time error with the message in case of error @@ -1055,7 +1064,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON std::string getAfterNodeCreatedCallback() const; std::string getBeforeNodeRemovalCallback() const; - void computeFrameRangeForReader(const KnobI* fileKnob); + void computeFrameRangeForReader(KnobI* fileKnob); bool getOverlayColor(double* r,double* g,double* b) const; diff --git a/Engine/NodeGroupSerialization.cpp b/Engine/NodeGroupSerialization.cpp index 664128bf5f..04da11c216 100644 --- a/Engine/NodeGroupSerialization.cpp +++ b/Engine/NodeGroupSerialization.cpp @@ -258,6 +258,10 @@ NodeCollectionSerialization::restoreFromSerialization(const std::list< boost::sh } } + if (!createNodes && n) { + // If we created the node using a PyPlug, deserialize the project too to override any modification made by the user. + n->loadKnobs(**it); + } assert(n); createdNodes[n] = *it; diff --git a/Engine/OfxClipInstance.cpp b/Engine/OfxClipInstance.cpp index 9d6a234d8a..0083c3c054 100644 --- a/Engine/OfxClipInstance.cpp +++ b/Engine/OfxClipInstance.cpp @@ -646,7 +646,15 @@ OfxClipInstance::getImagePlane(OfxTime time, return NULL; } - return getImagePlaneInternal(time, ViewIdx(view), optionalBounds, &plane); + + ViewSpec spec; + // The Foundry Furnace plug-ins pass -1 to the view parameter, we need to deal with it. + if (view == -1) { + spec = ViewSpec::current(); + } else { + spec = ViewIdx(view); + } + return getImagePlaneInternal(time, spec, optionalBounds, &plane); } OFX::Host::ImageEffect::Image* @@ -683,6 +691,9 @@ OfxClipInstance::getInputImageInternal(const OfxTime time, int inputnb = getInputNb(); //If components param is not set (i.e: the plug-in uses regular clipGetImage call) then figure out the plane from the TLS set in OfxEffectInstance::render //otherwise use the param sent by the plug-in call of clipGetImagePlane + + bool isMultiplanar = effect->isMultiPlanar(); + ImageComponents comp; if (!ofxPlane) { @@ -786,7 +797,7 @@ OfxClipInstance::getInputImageInternal(const OfxTime time, //If the plug-in used fetchImage and not fetchImagePlane it is expected that we return //an image mapped to the clip components - const bool mapImageToClipPref = ofxPlane == 0; + const bool mapImageToClipPref = !isMultiplanar; ImagePtr image = effect->getImage(inputnb, time, renderScale, view, optionalBounds ? &bounds : NULL, &comp, @@ -844,6 +855,8 @@ OfxClipInstance::getOutputImageInternal(const std::string* ofxPlane) EffectInstPtr effect = getEffectHolder(); + bool isMultiplanar = effect->isMultiPlanar(); + ImageComponents natronPlane; if (!ofxPlane) { @@ -885,7 +898,6 @@ OfxClipInstance::getOutputImageInternal(const std::string* ofxPlane) If the plugin is multiplanar return exactly what it requested. Otherwise, hack the clipGetImage and return the plane requested by the user via the interface instead of the colour plane. */ - bool multiPlanar = effect->isMultiPlanar(); const std::string& layerName = /*multiPlanar ?*/ natronPlane.getLayerName();// : planeBeingRendered.getLayerName(); for (std::map::iterator it = outputPlanes.begin(); it != outputPlanes.end(); ++it) { @@ -923,7 +935,7 @@ OfxClipInstance::getOutputImageInternal(const std::string* ofxPlane) //This is the firs time the plug-ins asks for this OfxImage, just allocate it and register it in the TLS std::string ofxComponents; int nComps; - if (multiPlanar) { + if (isMultiplanar) { ofxComponents = OfxClipInstance::natronsComponentsToOfxComponents(outputImage->getComponents()); nComps = outputImage->getComponents().getNumComponents(); } else { @@ -1042,13 +1054,19 @@ OfxClipInstance::ofxPlaneToNatronPlane(const std::string& plane) } } -std::string -OfxClipInstance::natronsPlaneToOfxPlane(const ImageComponents& plane) +void +OfxClipInstance::natronsPlaneToOfxPlane(const ImageComponents& plane, std::list* ofxPlanes) { if (plane.getLayerName() == kNatronColorPlaneName) { - return kFnOfxImagePlaneColour; + ofxPlanes->push_back(kFnOfxImagePlaneColour); + } else if (plane == ImageComponents::getPairedMotionVectors()) { + ofxPlanes->push_back(kFnOfxImagePlaneBackwardMotionVector); + ofxPlanes->push_back(kFnOfxImagePlaneForwardMotionVector); + } else if (plane == ImageComponents::getPairedStereoDisparity()) { + ofxPlanes->push_back(kFnOfxImagePlaneStereoDisparityLeft); + ofxPlanes->push_back(kFnOfxImagePlaneStereoDisparityRight); } else { - return natronCustomCompToOfxComp(plane); + ofxPlanes->push_back(natronCustomCompToOfxComp(plane)); } } @@ -1064,9 +1082,16 @@ OfxClipInstance::natronsComponentsToOfxComponents(const ImageComponents& comp) return kOfxImageComponentRGB; } else if (comp == ImageComponents::getRGBAComponents()) { return kOfxImageComponentRGBA; - } else if (QString::fromUtf8(comp.getComponentsGlobalName().c_str()).compare(QString::fromUtf8("UV"), Qt::CaseInsensitive) == 0) { + /* } + else if (QString::fromUtf8(comp.getComponentsGlobalName().c_str()).compare(QString::fromUtf8("UV"), Qt::CaseInsensitive) == 0) { return kFnOfxImageComponentMotionVectors; } else if (QString::fromUtf8(comp.getComponentsGlobalName().c_str()).compare(QString::fromUtf8("XY"), Qt::CaseInsensitive) == 0) { + return kFnOfxImageComponentStereoDisparity;*/ + } else if (comp == ImageComponents::getXYComponents()) { + return kNatronOfxImageComponentXY; + } else if (comp == ImageComponents::getPairedMotionVectors()) { + return kFnOfxImageComponentMotionVectors; + } else if (comp == ImageComponents::getPairedStereoDisparity()) { return kFnOfxImageComponentStereoDisparity; } else { return natronCustomCompToOfxComp(comp); diff --git a/Engine/OfxClipInstance.h b/Engine/OfxClipInstance.h index fa7f5202d2..36b6b230d5 100644 --- a/Engine/OfxClipInstance.h +++ b/Engine/OfxClipInstance.h @@ -211,11 +211,25 @@ class OfxClipInstance int getInputNb() const WARN_UNUSED_RETURN; EffectInstPtr getAssociatedNode() const WARN_UNUSED_RETURN; - + + + /** + * @brief Used to convert plane argument as passed to the clipGetImage() function to Natron plane. + **/ ImageComponents ofxPlaneToNatronPlane(const std::string& plane); - static std::string natronsPlaneToOfxPlane(const ImageComponents& plane); + + /** + * @brief Used to convert Natron planes given to the render() function to OpenFX layer name. + **/ + static void natronsPlaneToOfxPlane(const ImageComponents& plane, std::list* ofxPlanes); + + /** + * @brief Converts Natron components to OpenFX components. + **/ static std::string natronsComponentsToOfxComponents(const ImageComponents& comp); static ImageComponents ofxComponentsToNatronComponents(const std::string & comp); + + static ImageBitDepthEnum ofxDepthToNatronDepth(const std::string & depth); static const std::string& natronsDepthToOfxDepth(ImageBitDepthEnum depth); static ImagePremultiplicationEnum ofxPremultToNatronPremult(const std::string& premult); diff --git a/Engine/OfxEffectInstance.cpp b/Engine/OfxEffectInstance.cpp index f69701eb90..f46782b1b2 100644 --- a/Engine/OfxEffectInstance.cpp +++ b/Engine/OfxEffectInstance.cpp @@ -230,6 +230,7 @@ struct OfxEffectInstancePrivate bool supportsMultipleClipsPar; bool supportsMultipleClipsBitdepth; bool doesTemporalAccess; + bool multiplanar; OfxEffectInstancePrivate() : effect() @@ -252,6 +253,7 @@ struct OfxEffectInstancePrivate , supportsMultipleClipsPar(false) , supportsMultipleClipsBitdepth(false) , doesTemporalAccess(false) + , multiplanar(false) { } @@ -364,6 +366,7 @@ OfxEffectInstance::createOfxImageEffectInstance(OFX::Host::ImageEffect::ImageEff _imp->supportsMultipleClipsPar = _imp->effect->supportsMultipleClipPARs(); _imp->supportsMultipleClipsBitdepth = _imp->effect->supportsMultipleClipDepths(); _imp->doesTemporalAccess = _imp->effect->temporalAccess(); + _imp->multiplanar = _imp->effect->isMultiPlanar(); int sequential = _imp->effect->getPlugin()->getDescriptor().getProps().getIntProperty(kOfxImageEffectInstancePropSequentialRender); switch (sequential) { case 0: @@ -1809,9 +1812,10 @@ OfxEffectInstance::render(const RenderActionArgs& args) for (std::list > >::const_iterator it = args.outputPlanes.begin(); it!=args.outputPlanes.end(); ++it) { if (!multiPlanar) { - ofxPlanes.push_back(OfxClipInstance::natronsPlaneToOfxPlane(it->second->getComponents())); + // When not multi-planar, the components of the image will be the colorplane + OfxClipInstance::natronsPlaneToOfxPlane(it->second->getComponents(), &ofxPlanes); } else { - ofxPlanes.push_back(OfxClipInstance::natronsPlaneToOfxPlane(it->first)); + OfxClipInstance::natronsPlaneToOfxPlane(it->first, &ofxPlanes); } } @@ -2562,7 +2566,9 @@ OfxEffectInstance::getComponentsNeededAndProduced(double time, std::vector compNeeded; for (std::list::iterator it2 = it->second.begin(); it2 != it->second.end(); ++it2) { ImageComponents ofxComp = OfxClipInstance::ofxComponentsToNatronComponents(*it2); - compNeeded.push_back(ofxComp); + if (ofxComp.getNumComponents() > 0) { + compNeeded.push_back(ofxComp); + } } comps->insert(std::make_pair(index, compNeeded)); } @@ -2577,7 +2583,7 @@ OfxEffectInstance::getComponentsNeededAndProduced(double time, bool OfxEffectInstance::isMultiPlanar() const { - return effectInstance()->isMultiPlanar(); + return _imp->multiplanar; } EffectInstance::PassThroughEnum diff --git a/Engine/OfxParamInstance.cpp b/Engine/OfxParamInstance.cpp index c280f4e004..4130833b2c 100644 --- a/Engine/OfxParamInstance.cpp +++ b/Engine/OfxParamInstance.cpp @@ -309,6 +309,66 @@ OfxParamToKnob::onKnobAnimationLevelChanged(ViewSpec /*view*/, int /*dimension*/ param->getProperties().setIntProperty(kOfxParamPropIsAutoKeying, l == eAnimationLevelInterpolatedValue); } +void +OfxParamToKnob::onChoiceMenuReset() +{ + onChoiceMenuPopulated(); +} + +static void setStringPropertyN(const std::vector& entries, + OFX::Host::Param::Instance* param, + const std::string& property) +{ + try { + OFX::Host::Property::PropertyTemplate *prop = 0; + if (param->getProperties().fetchTypedProperty(property, prop)) { + prop->reset(); + for (std::size_t i = 0; i < entries.size(); ++i) { + prop->setValue(entries[i], i); + } + + } + } catch(...) { + + } +} + +void +OfxParamToKnob::onChoiceMenuPopulated() +{ + DYNAMIC_PROPERTY_CHECK(); + + OFX::Host::Param::Instance* param = getOfxParam(); + assert(param); + KnobPtr knob = getKnob(); + if (!knob) { + return; + } + KnobChoice* isChoice = dynamic_cast(knob.get()); + if (!isChoice) { + return; + } + std::vector entries = isChoice->getEntries_mt_safe(); + std::vector entriesHelp = isChoice->getEntriesHelp_mt_safe(); + setStringPropertyN(entries, param, kOfxParamPropChoiceOption); + setStringPropertyN(entriesHelp, param, kOfxParamPropChoiceLabelOption); + +} + +void +OfxParamToKnob::onChoiceMenuEntryAppended(const QString& entry, const QString& help) +{ + DYNAMIC_PROPERTY_CHECK(); + + OFX::Host::Param::Instance* param = getOfxParam(); + assert(param); + int nProps = param->getProperties().getDimension(kOfxParamPropChoiceOption); + int nLabelProps = param->getProperties().getDimension(kOfxParamPropChoiceLabelOption); + assert(nProps == nLabelProps); + param->getProperties().setStringProperty(kOfxParamPropChoiceOption, entry.toStdString(),nProps); + param->getProperties().setStringProperty(kOfxParamPropChoiceLabelOption, help.toStdString(),nLabelProps); +} + void OfxParamToKnob::onEvaluateOnChangeChanged(bool evaluate) { @@ -997,7 +1057,7 @@ OfxChoiceInstance::OfxChoiceInstance(const boost::shared_ptr& boost::shared_ptr choice = checkIfKnobExistsWithNameOrCreate(descriptor.getName(), this, 1); _knob = choice; - + int dim = getProperties().getDimension(kOfxParamPropChoiceOption); int labelOptionDim = getProperties().getDimension(kOfxParamPropChoiceLabelOption); @@ -1032,6 +1092,10 @@ OfxChoiceInstance::OfxChoiceInstance(const boost::shared_ptr& if (canAddOptions) { choice->setHostCanAddOptions(true); } + QObject::connect(choice.get(), SIGNAL(populated()), this, SLOT(onChoiceMenuPopulated())); + QObject::connect(choice.get(), SIGNAL(entryAppended(QString,QString)), this, SLOT(onChoiceMenuEntryAppended(QString,QString))); + QObject::connect(choice.get(), SIGNAL(entriesReset()), this, SLOT(onChoiceMenuReset())); + } OfxStatus @@ -1121,25 +1185,44 @@ OfxChoiceInstance::setEvaluateOnChange() void OfxChoiceInstance::setOption(int num) { + + DYNAMIC_PROPERTY_CHECK(); + + /* + This function can serve 3 type of behaviours depending on num: + - 0: meaning resetOptions + - num == nDim - 1: meaning appendOption + - num == nDim: meaning setOptions + */ int dim = getProperties().getDimension(kOfxParamPropChoiceOption); boost::shared_ptr knob = _knob.lock(); if (dim == 0) { knob->resetChoices(); return; } - //Only 2 kind of behaviours are supported: either resetOptions (dim == 0) or - //appendOption, hence num == dim -1 - assert(num == dim - 1); - if (num != (dim -1)) { - return; - } - std::string entry = getProperties().getStringProperty(kOfxParamPropChoiceOption,num); - std::string help; - int labelOptionDim = getProperties().getDimension(kOfxParamPropChoiceLabelOption); - if (num < labelOptionDim) { - help = getProperties().getStringProperty(kOfxParamPropChoiceLabelOption,num); + + assert(num == dim - 1 || num == dim); + + if (num == (dim -1)) { + std::string entry = getProperties().getStringProperty(kOfxParamPropChoiceOption,num); + std::string help; + int labelOptionDim = getProperties().getDimension(kOfxParamPropChoiceLabelOption); + if (num < labelOptionDim) { + help = getProperties().getStringProperty(kOfxParamPropChoiceLabelOption,num); + } + knob->appendChoice(entry,help); + } else if (num == dim) { + int labelOptionDim = getProperties().getDimension(kOfxParamPropChoiceLabelOption); + assert(labelOptionDim == 0 || labelOptionDim == dim); + std::vector entries(dim), helps(labelOptionDim); + for (std::size_t i = 0; i < entries.size(); ++i) { + entries[i] = getProperties().getStringProperty(kOfxParamPropChoiceOption,i); + if ((int)i < labelOptionDim) { + helps[i] = getProperties().getStringProperty(kOfxParamPropChoiceLabelOption,i); + } + } + knob->populateChoices(entries, helps); } - knob->appendChoice(entry,help); } KnobPtr diff --git a/Engine/OfxParamInstance.h b/Engine/OfxParamInstance.h index 1b715f52b8..64728718f2 100644 --- a/Engine/OfxParamInstance.h +++ b/Engine/OfxParamInstance.h @@ -177,6 +177,9 @@ public Q_SLOTS: void onDisplayMinMaxChanged(double min, double max, int index); void onMinMaxChanged(double min, double max, int index); void onKnobAnimationLevelChanged(ViewSpec view, int dimension); + void onChoiceMenuReset(); + void onChoiceMenuPopulated(); + void onChoiceMenuEntryAppended(const QString& entry, const QString& help); protected: diff --git a/Engine/ParallelRenderArgs.cpp b/Engine/ParallelRenderArgs.cpp index fa2afaec6e..1de71e404e 100644 --- a/Engine/ParallelRenderArgs.cpp +++ b/Engine/ParallelRenderArgs.cpp @@ -396,22 +396,15 @@ StatusEnum EffectInstance::getInputsRoIsFunctor(bool useTransforms, fvRequest = &nodeRequest->frames[frameView]; - ///Get the RoD - StatusEnum stat = effect->getRegionOfDefinition_public(nodeRequest->nodeHash, time, nodeRequest->mappedScale, view, &fvRequest->globalData.rod, &fvRequest->globalData.isProjectFormat); - //If failed it should have failed earlier - if (stat == eStatusFailed && !fvRequest->globalData.rod.isNull()) { - return stat; - } - ///Check identity fvRequest->globalData.identityInputNb = -1; fvRequest->globalData.inputIdentityTime = 0.; fvRequest->globalData.identityView = view; - RectI pixelRod; - fvRequest->globalData.rod.toPixelEnclosing(mappedLevel, par, &pixelRod); + RectI identityRegionPixel; + canonicalRenderWindow.toPixelEnclosing(mappedLevel, par, &identityRegionPixel); if (view != 0 && viewInvariance == eViewInvarianceAllViewsInvariant) { fvRequest->globalData.isIdentity = true; @@ -419,12 +412,27 @@ StatusEnum EffectInstance::getInputsRoIsFunctor(bool useTransforms, fvRequest->globalData.inputIdentityTime = time; } else { try { - fvRequest->globalData.isIdentity = effect->isIdentity_public(true, nodeRequest->nodeHash, time, nodeRequest->mappedScale, pixelRod, view, &fvRequest->globalData.inputIdentityTime, &fvRequest->globalData.identityView, &fvRequest->globalData.identityInputNb); + fvRequest->globalData.isIdentity = effect->isIdentity_public(true, nodeRequest->nodeHash, time, nodeRequest->mappedScale, identityRegionPixel, view, &fvRequest->globalData.inputIdentityTime, &fvRequest->globalData.identityView, &fvRequest->globalData.identityInputNb); } catch (...) { return eStatusFailed; } } + /* + Do NOT call getRegionOfDefinition on the identity time, if the plug-in returns an identity time different from + this time, we expect that it handles getRegionOfDefinition itself correctly. + */ + double rodTime = time;//fvRequest->globalData.isIdentity ? fvRequest->globalData.inputIdentityTime : time; + ViewIdx rodView = view;//fvRequest->globalData.isIdentity ? fvRequest->globalData.identityView : view; + + ///Get the RoD + StatusEnum stat = effect->getRegionOfDefinition_public(nodeRequest->nodeHash, rodTime, nodeRequest->mappedScale, rodView, &fvRequest->globalData.rod, &fvRequest->globalData.isProjectFormat); + //If failed it should have failed earlier + if (stat == eStatusFailed && !fvRequest->globalData.rod.isNull()) { + return stat; + } + + ///Concatenate transforms if needed if (useTransforms) { diff --git a/Engine/Project.cpp b/Engine/Project.cpp index 7e149456ed..488d05503d 100644 --- a/Engine/Project.cpp +++ b/Engine/Project.cpp @@ -750,64 +750,16 @@ Project::initializeKnobs() _imp->addFormatKnob->setName("newFormat"); page->addKnob(_imp->addFormatKnob); - boost::shared_ptr viewsPage = AppManager::createKnob(this, "Views"); - - _imp->viewsList = AppManager::createKnob(this, "Views List"); - _imp->viewsList->setName("viewsList"); - _imp->viewsList->setHintToolTip("The list of the views in the project"); - _imp->viewsList->setAnimationEnabled(false); - _imp->viewsList->setEvaluateOnChange(false); - _imp->viewsList->setAsStringList(true); - std::list > defaultViews; - defaultViews.push_back(std::make_pair("Main","")); - std::string encodedDefaultViews = KnobPath::encodeToMultiPathFormat(defaultViews); - _imp->viewsList->setDefaultValue(encodedDefaultViews); - viewsPage->addKnob(_imp->viewsList); - - _imp->setupForStereoButton = AppManager::createKnob(this, "Setup views for stereo"); - _imp->setupForStereoButton->setName("setupForStereo"); - _imp->setupForStereoButton->setHintToolTip("Quickly setup the views list for stereo"); - _imp->setupForStereoButton->setEvaluateOnChange(false); - viewsPage->addKnob(_imp->setupForStereoButton); - _imp->previewMode = AppManager::createKnob(this, "Auto Previews"); _imp->previewMode->setName("autoPreviews"); _imp->previewMode->setHintToolTip("When checked, preview images on the node graph will be " - "refreshed automatically. You can uncheck this option to improve performances." - "Press P in the node graph to refresh the previews yourself."); + "refreshed automatically. You can uncheck this option to improve performances."); _imp->previewMode->setAnimationEnabled(false); _imp->previewMode->setEvaluateOnChange(false); page->addKnob(_imp->previewMode); bool autoPreviewEnabled = appPTR->getCurrentSettings()->isAutoPreviewOnForNewProjects(); _imp->previewMode->setDefaultValue(autoPreviewEnabled,0); - std::vector colorSpaces; - colorSpaces.push_back("sRGB"); - colorSpaces.push_back("Linear"); - colorSpaces.push_back("Rec.709"); - _imp->colorSpace8u = AppManager::createKnob(this, "Colorspace for 8-Bit Integer Images"); - _imp->colorSpace8u->setName("defaultColorSpace8u"); - _imp->colorSpace8u->setHintToolTip("Defines the color-space in which 8-bit images are assumed to be by default."); - _imp->colorSpace8u->setAnimationEnabled(false); - _imp->colorSpace8u->populateChoices(colorSpaces); - _imp->colorSpace8u->setDefaultValue(0); - page->addKnob(_imp->colorSpace8u); - - _imp->colorSpace16u = AppManager::createKnob(this, "Colorspace for 16-Bit Integer Images"); - _imp->colorSpace16u->setName("defaultColorSpace16u"); - _imp->colorSpace16u->setHintToolTip("Defines the color-space in which 16-bit integer images are assumed to be by default."); - _imp->colorSpace16u->setAnimationEnabled(false); - _imp->colorSpace16u->populateChoices(colorSpaces); - _imp->colorSpace16u->setDefaultValue(2); - page->addKnob(_imp->colorSpace16u); - - _imp->colorSpace32f = AppManager::createKnob(this, "Colorspace for 32-Bit Floating Point Images"); - _imp->colorSpace32f->setName("defaultColorSpace32f"); - _imp->colorSpace32f->setHintToolTip("Defines the color-space in which 32-bit floating point images are assumed to be by default."); - _imp->colorSpace32f->setAnimationEnabled(false); - _imp->colorSpace32f->populateChoices(colorSpaces); - _imp->colorSpace32f->setDefaultValue(1); - page->addKnob(_imp->colorSpace32f); _imp->frameRange = AppManager::createKnob(this, "Frame Range",2); _imp->frameRange->setDefaultValue(1,0); @@ -843,6 +795,92 @@ Project::initializeKnobs() _imp->frameRate->setDisplayMaximum(50.); page->addKnob(_imp->frameRate); + + boost::shared_ptr viewsPage = AppManager::createKnob(this, "Views"); + + _imp->viewsList = AppManager::createKnob(this, "Views List"); + _imp->viewsList->setName("viewsList"); + _imp->viewsList->setHintToolTip("The list of the views in the project"); + _imp->viewsList->setAnimationEnabled(false); + _imp->viewsList->setEvaluateOnChange(false); + _imp->viewsList->setAsStringList(true); + std::list defaultViews; + defaultViews.push_back("Main"); + std::string encodedDefaultViews = _imp->viewsList->encodeToKnobTableFormatSingleCol(defaultViews); + _imp->viewsList->setDefaultValue(encodedDefaultViews); + viewsPage->addKnob(_imp->viewsList); + + _imp->setupForStereoButton = AppManager::createKnob(this, "Setup views for stereo"); + _imp->setupForStereoButton->setName("setupForStereo"); + _imp->setupForStereoButton->setHintToolTip("Quickly setup the views list for stereo"); + _imp->setupForStereoButton->setEvaluateOnChange(false); + viewsPage->addKnob(_imp->setupForStereoButton); + + + boost::shared_ptr LayersPage = AppManager::createKnob(this, "Layers"); + + _imp->defaultLayersList = AppManager::createKnob(this, "Default Layers"); + _imp->defaultLayersList->setName("defaultLayers"); + _imp->defaultLayersList->setHintToolTip("The list of the default layers available in layers menus on nodes."); + _imp->defaultLayersList->setAnimationEnabled(false); + _imp->defaultLayersList->setEvaluateOnChange(false); + std::list > defaultLayers; + { + //Do not add the color plane, because it is handled in a separate case to make sure it is always the first choice + int i = 3; + while (ImageComponents::defaultComponents[i][0]) { + std::vector row(2); + row[0] = ImageComponents::defaultComponents[i][1]; + const ImageComponents& comps = ImageComponents::getDefaultComponent(ImageComponents::defaultComponents[i][0]); + std::string channelsStr; + const std::vector& channels = comps.getComponentsNames(); + for (std::size_t i = 0; i < channels.size(); ++i) { + channelsStr += channels[i]; + if (i < (channels.size() - 1)) { + channelsStr += ' '; + } + } + row[1] = channelsStr; + defaultLayers.push_back(row); + ++i; + } + } + std::string encodedDefaultLayers = _imp->defaultLayersList->encodeToKnobTableFormat(defaultLayers); + _imp->defaultLayersList->setDefaultValue(encodedDefaultLayers); + LayersPage->addKnob(_imp->defaultLayersList); + + + + boost::shared_ptr lutPages = AppManager::createKnob(this, "LUT"); + + std::vector colorSpaces; + colorSpaces.push_back("sRGB"); + colorSpaces.push_back("Linear"); + colorSpaces.push_back("Rec.709"); + _imp->colorSpace8u = AppManager::createKnob(this, "8-Bit Colorspace"); + _imp->colorSpace8u->setName("defaultColorSpace8u"); + _imp->colorSpace8u->setHintToolTip("Defines the color-space in which 8-bit images are assumed to be by default."); + _imp->colorSpace8u->setAnimationEnabled(false); + _imp->colorSpace8u->populateChoices(colorSpaces); + _imp->colorSpace8u->setDefaultValue(0); + lutPages->addKnob(_imp->colorSpace8u); + + _imp->colorSpace16u = AppManager::createKnob(this, "16-Bit Colorspace"); + _imp->colorSpace16u->setName("defaultColorSpace16u"); + _imp->colorSpace16u->setHintToolTip("Defines the color-space in which 16-bit integer images are assumed to be by default."); + _imp->colorSpace16u->setAnimationEnabled(false); + _imp->colorSpace16u->populateChoices(colorSpaces); + _imp->colorSpace16u->setDefaultValue(2); + lutPages->addKnob(_imp->colorSpace16u); + + _imp->colorSpace32f = AppManager::createKnob(this, "32-Bit f.p Colorspace "); + _imp->colorSpace32f->setName("defaultColorSpace32f"); + _imp->colorSpace32f->setHintToolTip("Defines the color-space in which 32-bit floating point images are assumed to be by default."); + _imp->colorSpace32f->setAnimationEnabled(false); + _imp->colorSpace32f->populateChoices(colorSpaces); + _imp->colorSpace32f->setDefaultValue(1); + lutPages->addKnob(_imp->colorSpace32f); + boost::shared_ptr infoPage = AppManager::createKnob(this, tr("Info").toStdString()); _imp->projectName = AppManager::createKnob(this, "Project Name"); @@ -932,7 +970,7 @@ Project::initializeKnobs() "- app: points to the current application instance\n"); _imp->onProjectLoadCB->setAnimationEnabled(false); std::string onProjectLoad = appPTR->getCurrentSettings()->getDefaultOnProjectLoadedCB(); - _imp->onProjectLoadCB->setValue(onProjectLoad); + _imp->onProjectLoadCB->setDefaultValue(onProjectLoad); pythonPage->addKnob(_imp->onProjectLoadCB); @@ -948,7 +986,7 @@ Project::initializeKnobs() "You should return the new filename under which the project should be saved."); _imp->onProjectSaveCB->setAnimationEnabled(false); std::string onProjectSave = appPTR->getCurrentSettings()->getDefaultOnProjectSaveCB(); - _imp->onProjectSaveCB->setValue(onProjectSave); + _imp->onProjectSaveCB->setDefaultValue(onProjectSave); pythonPage->addKnob(_imp->onProjectSaveCB); _imp->onProjectCloseCB = AppManager::createKnob(this, "Before Project Close"); @@ -975,7 +1013,7 @@ Project::initializeKnobs() "- app: points to the current application instance\n"); _imp->onNodeCreated->setAnimationEnabled(false); std::string onNodeCreated = appPTR->getCurrentSettings()->getDefaultOnNodeCreatedCB(); - _imp->onNodeCreated->setValue(onNodeCreated); + _imp->onNodeCreated->setDefaultValue(onNodeCreated); pythonPage->addKnob(_imp->onNodeCreated); _imp->onNodeDeleted = AppManager::createKnob(this, "Before Node Removal"); @@ -987,7 +1025,7 @@ Project::initializeKnobs() "- app: points to the current application instance\n"); _imp->onNodeDeleted->setAnimationEnabled(false); std::string onNodeDelete = appPTR->getCurrentSettings()->getDefaultOnNodeDeleteCB(); - _imp->onNodeDeleted->setValue(onNodeDelete); + _imp->onNodeDeleted->setDefaultValue(onNodeDelete); pythonPage->addKnob(_imp->onNodeDeleted); @@ -1006,8 +1044,12 @@ Project::getProjectDefaultFormat(Format *f) const { assert(f); QMutexLocker l(&_imp->formatMutex); - int index = _imp->formatKnob->getValue(); - _imp->findFormat(index, f); + std::string formatSpec = _imp->formatKnob->getActiveEntryText_mt_safe(); + if (!formatSpec.empty()) { + ProjectPrivate::generateFormatFromString(QString::fromUtf8(formatSpec.c_str()), f); + } else { + _imp->findFormat(_imp->formatKnob->getValue(), f); + } } bool @@ -1056,9 +1098,8 @@ Project::tryAddProjectFormat(const Format & f) entries.push_back( formatStr.toStdString() ); } QString formatStr = ProjectPrivate::generateStringFromFormat(f); - entries.push_back( formatStr.toStdString() ); _imp->additionalFormats.push_back(f); - _imp->formatKnob->populateChoices(entries); + _imp->formatKnob->appendChoice(formatStr.toStdString()); return ( _imp->builtinFormats.size() + _imp->additionalFormats.size() ) - 1; } @@ -1083,10 +1124,83 @@ Project::getProjectFormatEntries(std::vector* formatStrings, int* c int Project::getProjectViewsCount() const { - std::list > pairs; - _imp->viewsList->getVariables(&pairs); + std::list > pairs; + _imp->viewsList->getTable(&pairs); return (int)pairs.size(); } + +std::vector +Project::getProjectDefaultLayers() const +{ + std::vector ret; + + std::list > pairs; + _imp->defaultLayersList->getTable(&pairs); + for (std::list >::iterator it = pairs.begin(); + it != pairs.end(); ++it) { + + bool found = false; + for (std::size_t i = 0; i < ret.size(); ++i) { + if (ret[i].getLayerName() == (*it)[0]) { + found = true; + break; + } + } + if (!found) { + std::vector componentsName; + QString str = QString::fromUtf8((*it)[1].c_str()); + QStringList channels = str.split(QLatin1Char(' ')); + componentsName.resize(channels.size()); + for (int i = 0; i < channels.size(); ++i) { + componentsName[i] = channels[i].toStdString(); + } + ImageComponents c((*it)[0],std::string(),componentsName); + ret.push_back(c); + } + } + return ret; + +} + +void +Project::addProjectDefaultLayer(const ImageComponents& comps) +{ + const std::vector& channels = comps.getComponentsNames(); + std::vector row(2); + row[0] = comps.getLayerName(); + std::string channelsStr; + for (std::size_t i = 0; i < channels.size(); ++i) { + channelsStr += channels[i]; + if (i < (channels.size() -1)) { + channelsStr += ' '; + } + } + row[1] = channelsStr; + _imp->defaultLayersList->appendRow(row); +} + +std::vector +Project::getProjectDefaultLayerNames() const +{ + std::vector ret; + + std::list > pairs; + _imp->defaultLayersList->getTable(&pairs); + for (std::list >::iterator it = pairs.begin(); + it != pairs.end(); ++it) { + bool found = false; + for (std::size_t i = 0; i < ret.size(); ++i) { + if (ret[i] == (*it)[0]) { + found = true; + break; + } + } + if (!found) { + ret.push_back((*it)[0]); + } + } + return ret; +} const std::vector& Project::getProjectViewNames() const @@ -1096,11 +1210,11 @@ Project::getProjectViewNames() const std::vector& tls = _imp->tlsData->getOrCreateTLSData()->viewNames; tls.clear(); - std::list > pairs; - _imp->viewsList->getVariables(&pairs); - for (std::list >::iterator it = pairs.begin(); + std::list > pairs; + _imp->viewsList->getTable(&pairs); + for (std::list >::iterator it = pairs.begin(); it != pairs.end(); ++it) { - tls.push_back(it->first); + tls.push_back((*it)[0]); } return tls; } @@ -1108,10 +1222,11 @@ Project::getProjectViewNames() const void Project::setupProjectForStereo() { - std::list > pairs; - pairs.push_back(std::make_pair("Left","")); - pairs.push_back(std::make_pair("Right","")); - std::string encoded = KnobPath::encodeToMultiPathFormat(pairs); + + std::list views; + views.push_back("Left"); + views.push_back("Right"); + std::string encoded = _imp->viewsList->encodeToKnobTableFormatSingleCol(views); _imp->viewsList->setValue(encoded); } @@ -1136,13 +1251,13 @@ static bool caseInsensitiveCompare(const std::string& lhs, const std::string& rh void Project::createProjectViews(const std::vector& views) { - std::list > pairs; - _imp->viewsList->getVariables(&pairs); + std::list pairs; + _imp->viewsList->getTableSingleCol(&pairs); for (std::size_t i = 0; i < views.size(); ++i) { bool found = false; - for (std::list >::iterator it = pairs.begin(); it != pairs.end(); ++it) { - if (caseInsensitiveCompare(it->first,views[i])) { + for (std::list::iterator it = pairs.begin(); it != pairs.end(); ++it) { + if (caseInsensitiveCompare(*it,views[i])) { found = true; break; } @@ -1152,9 +1267,9 @@ Project::createProjectViews(const std::vector& views) } std::string view = views[i]; view[0] = std::toupper(view[0]); - pairs.push_back(std::make_pair(view,std::string())); + pairs.push_back(view); } - std::string encoded = KnobPath::encodeToMultiPathFormat(pairs); + std::string encoded = _imp->viewsList->encodeToKnobTableFormatSingleCol(pairs); _imp->viewsList->setValue(encoded); } @@ -1273,6 +1388,11 @@ Project::onKnobValueChanged(KnobI* knob, forceComputeInputDependentDataOnAllTrees(); } Q_EMIT projectViewsChanged(); + } else if (knob == _imp->defaultLayersList.get()) { + if (reason == eValueChangedReasonUserEdited) { + ///default layers change, notify all nodes so they rebuild their layers menus + forceComputeInputDependentDataOnAllTrees(); + } } else if (knob == _imp->setupForStereoButton.get()) { setupProjectForStereo(); } else if ( knob == _imp->formatKnob.get() ) { @@ -1764,63 +1884,17 @@ Project::unescapeXML(const std::string &istr) return str; } -void - Project::makeEnvMapUnordered(const std::string& encoded,std::vector >& variables) -{ - std::string startNameTag(NATRON_ENV_VAR_NAME_START_TAG); - std::string endNameTag(NATRON_ENV_VAR_NAME_END_TAG); - std::string startValueTag(NATRON_ENV_VAR_VALUE_START_TAG); - std::string endValueTag(NATRON_ENV_VAR_VALUE_END_TAG); - - size_t i = encoded.find(startNameTag); - while (i != std::string::npos) { - i += startNameTag.size(); - assert(i < encoded.size()); - size_t endNamePos = encoded.find(endNameTag,i); - assert(endNamePos != std::string::npos && endNamePos < encoded.size()); - if (endNamePos == std::string::npos || endNamePos >= encoded.size()) { - throw std::logic_error("Project::makeEnvMap()"); - } - std::string name,value; - while (i < endNamePos) { - name.push_back(encoded[i]); - ++i; - } - - i = encoded.find(startValueTag,i); - i += startValueTag.size(); - assert(i != std::string::npos && i < encoded.size()); - - size_t endValuePos = encoded.find(endValueTag,i); - assert(endValuePos != std::string::npos && endValuePos < encoded.size()); - - while (endValuePos != std::string::npos && endValuePos < encoded.size() && i < endValuePos) { - value.push_back(encoded.at(i)); - ++i; - } - - // In order to use XML tags, the text inside the tags has to be unescaped. - variables.push_back(std::make_pair(unescapeXML(name), unescapeXML(value))); - - i = encoded.find(startNameTag,i); - } -} - -void -Project::makeEnvMap(const std::string& encoded,std::map& variables) -{ - std::vector > pairs; - makeEnvMapUnordered(encoded,pairs); - for (std::size_t i = 0; i < pairs.size(); ++i) { - variables[pairs[i].first] = pairs[i].second; - } -} + void Project::getEnvironmentVariables(std::map& env) const { - std::string raw = _imp->envVars->getValue(); - makeEnvMap(raw, env); + std::list > table; + _imp->envVars->getTable(&table); + for (std::list >::iterator it = table.begin(); it!=table.end(); ++it) { + assert(it->size() == 2); + env[(*it)[0]] = (*it)[1]; + } } void @@ -2017,30 +2091,30 @@ Project::onOCIOConfigPathChanged(const std::string& path,bool block) beginChanges(); try { - std::string env = _imp->envVars->getValue(); - std::map envMap; - makeEnvMap(env, envMap); + + std::string oldEnv = _imp->envVars->getValue(); + std::list > table; + _imp->envVars->decodeFromKnobTableFormat(oldEnv, &table); ///If there was already a OCIO variable, update it, otherwise create it - - std::map::iterator foundOCIO = envMap.find(NATRON_OCIO_ENV_VAR_NAME); - if (foundOCIO != envMap.end()) { - foundOCIO->second = path; - } else { - envMap.insert(std::make_pair(NATRON_OCIO_ENV_VAR_NAME, path)); + bool found = false; + for (std::list >::iterator it = table.begin(); it!=table.end(); ++it) { + if ((*it)[0] == NATRON_OCIO_ENV_VAR_NAME) { + (*it)[1] = path; + found = true; + break; + } } - - std::string newEnv; - for (std::map::iterator it = envMap.begin(); it != envMap.end(); ++it) { - // In order to use XML tags, the text inside the tags has to be escaped. - newEnv += NATRON_ENV_VAR_NAME_START_TAG; - newEnv += Project::escapeXML(it->first); - newEnv += NATRON_ENV_VAR_NAME_END_TAG; - newEnv += NATRON_ENV_VAR_VALUE_START_TAG; - newEnv += Project::escapeXML(it->second); - newEnv += NATRON_ENV_VAR_VALUE_END_TAG; + if (!found) { + std::vector vec(2); + vec[0] = NATRON_OCIO_ENV_VAR_NAME; + vec[1] = path; + table.push_back(vec); } - if (env != newEnv) { + + std::string newEnv = _imp->envVars->encodeToKnobTableFormat(table); + + if (oldEnv != newEnv) { if (appPTR->getCurrentSettings()->isAutoFixRelativeFilePathEnabled()) { fixRelativeFilePaths(NATRON_OCIO_ENV_VAR_NAME, path,block); } diff --git a/Engine/Project.h b/Engine/Project.h index 4035adb52a..4ebea289bf 100644 --- a/Engine/Project.h +++ b/Engine/Project.h @@ -150,6 +150,12 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON const std::vector& getProjectViewNames() const; int getProjectViewsCount() const; + + std::vector getProjectDefaultLayerNames() const; + + std::vector getProjectDefaultLayers() const; + + void addProjectDefaultLayer(const ImageComponents& comps); void setOrAddProjectFormat(const Format & frmt,bool skipAdd = false); @@ -206,12 +212,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON * @brief Returns the user environment variables for the project **/ void getEnvironmentVariables(std::map& env) const; - /** - * @brief Decode the project variables from the encoded version; - **/ - static void makeEnvMap(const std::string& encoded,std::map& variables); - static void makeEnvMapUnordered(const std::string& encoded,std::vector >& variables); - + /** * @brief Expands the environment variables in the given string that are found in env **/ diff --git a/Engine/ProjectPrivate.cpp b/Engine/ProjectPrivate.cpp index bb71f1629b..8082118f4f 100644 --- a/Engine/ProjectPrivate.cpp +++ b/Engine/ProjectPrivate.cpp @@ -266,28 +266,29 @@ ProjectPrivate::autoSetProjectDirectory(const QString& path) pathCpy.erase(pathCpy.size() - 1, 1); } std::string env = envVars->getValue(); - std::map envMap; - Project::makeEnvMap(env, envMap); + std::list > table; + envVars->decodeFromKnobTableFormat(env, &table); ///If there was already a OCIO variable, update it, otherwise create it - - std::map::iterator foundPROJECT = envMap.find(NATRON_PROJECT_ENV_VAR_NAME); - if (foundPROJECT != envMap.end()) { - foundPROJECT->second = pathCpy; - } else { - envMap.insert(std::make_pair(NATRON_PROJECT_ENV_VAR_NAME, pathCpy)); + bool foundProject = false; + for (std::list >::iterator it = table.begin(); it != table.end(); ++it) { + if ((*it)[0] == NATRON_PROJECT_ENV_VAR_NAME) { + (*it)[1] = pathCpy; + foundProject = true; + break; + } } - - std::string newEnv; - for (std::map::iterator it = envMap.begin(); it != envMap.end(); ++it) { - newEnv += NATRON_ENV_VAR_NAME_START_TAG; - // In order to use XML tags, the text inside the tags has to be escaped. - newEnv += Project::escapeXML(it->first); - newEnv += NATRON_ENV_VAR_NAME_END_TAG; - newEnv += NATRON_ENV_VAR_VALUE_START_TAG; - newEnv += Project::escapeXML(it->second); - newEnv += NATRON_ENV_VAR_VALUE_END_TAG; + if (!foundProject) { + std::vector vec(2); + vec[0] = NATRON_PROJECT_ENV_VAR_NAME; + vec[1] = pathCpy; + table.push_back(vec); } + + + + + std::string newEnv = envVars->encodeToKnobTableFormat(table); if (env != newEnv) { if (appPTR->getCurrentSettings()->isAutoFixRelativeFilePathEnabled()) { _publicInterface->fixRelativeFilePaths(NATRON_PROJECT_ENV_VAR_NAME, pathCpy,false); @@ -355,7 +356,7 @@ ProjectPrivate::runOnProjectSaveCallback(const std::string& filename, bool autoS } std::string filePath = filename; if (ret) { - filePath = NATRON_PYTHON_NAMESPACE::PY3String_asString(ret); + filePath = NATRON_PYTHON_NAMESPACE::PyString_asString(ret); std::string script = "del ret\n"; bool ok = NATRON_PYTHON_NAMESPACE::interpretPythonScript(script, &err, 0); assert(ok); diff --git a/Engine/ProjectPrivate.h b/Engine/ProjectPrivate.h index eeaef96efd..f0802d5dc9 100644 --- a/Engine/ProjectPrivate.h +++ b/Engine/ProjectPrivate.h @@ -72,6 +72,7 @@ struct ProjectPrivate boost::shared_ptr formatKnob; //< built from builtinFormats & additionalFormats boost::shared_ptr addFormatKnob; boost::shared_ptr viewsList; + boost::shared_ptr defaultLayersList; boost::shared_ptr setupForStereoButton; boost::shared_ptr previewMode; //< auto or manual boost::shared_ptr colorSpace8u; @@ -113,7 +114,7 @@ struct ProjectPrivate bool restoreFromSerialization(const ProjectSerialization & obj,const QString& name,const QString& path, bool* mustSave); bool findFormat(int index,Format* format) const; - + bool findFormat(const std::string& formatSpec,Format* format) const; /** * @brief Auto fills the project directory parameter given the project file path **/ @@ -154,7 +155,7 @@ struct ProjectPrivate generateFormatFromString(const QString& spec, Format* f) { QStringList splits = spec.split(QLatin1Char(' ')); - if (splits.size() != 3) { + if (splits.size() < 2 || splits.size() > 3) { return false; } @@ -169,7 +170,9 @@ struct ProjectPrivate f->x2 = sizes[0].toInt(); f->y2 = sizes[1].toInt(); - f->setPixelAspectRatio(splits[2].toDouble()); + if (splits.size() > 2) { + f->setPixelAspectRatio(splits[2].toDouble()); + } return true; } diff --git a/Engine/PyAppInstance.cpp b/Engine/PyAppInstance.cpp index 694e800f29..bfa4a0c6d9 100644 --- a/Engine/PyAppInstance.cpp +++ b/Engine/PyAppInstance.cpp @@ -92,14 +92,14 @@ App::getCollectionFromGroup(Group* group) const } Effect* -App::createNode(const std::string& pluginID, +App::createNode(const QString& pluginID, int majorVersion, Group* group) const { boost::shared_ptr collection = getCollectionFromGroup(group); assert(collection); - CreateNodeArgs args(QString::fromUtf8(pluginID.c_str()), eCreateNodeReasonInternal, collection); + CreateNodeArgs args(pluginID, eCreateNodeReasonInternal, collection); args.majorV = majorVersion; NodePtr node = _instance->createNode(args); @@ -111,12 +111,12 @@ App::createNode(const std::string& pluginID, } Effect* -App::createReader(const std::string& filename, +App::createReader(const QString& filename, Group* group) const { boost::shared_ptr collection = getCollectionFromGroup(group); assert(collection); - NodePtr node = _instance->createReader(filename, eCreateNodeReasonInternal, collection); + NodePtr node = _instance->createReader(filename.toStdString(), eCreateNodeReasonInternal, collection); if (node) { return new Effect(node); } else { @@ -125,12 +125,12 @@ App::createReader(const std::string& filename, } Effect* -App::createWriter(const std::string& filename, +App::createWriter(const QString& filename, Group* group) const { boost::shared_ptr collection = getCollectionFromGroup(group); assert(collection); - NodePtr node = _instance->createWriter(filename, eCreateNodeReasonInternal, collection); + NodePtr node = _instance->createWriter(filename.toStdString(), eCreateNodeReasonInternal, collection); if (node) { return new Effect(node); } else { @@ -168,9 +168,9 @@ AppSettings::AppSettings(const boost::shared_ptr& settings) } Param* -AppSettings::getParam(const std::string& scriptName) const +AppSettings::getParam(const QString& scriptName) const { - KnobPtr knob = _settings->getKnobByName(scriptName); + KnobPtr knob = _settings->getKnobByName(scriptName.toStdString()); if (!knob) { return 0; } @@ -282,9 +282,9 @@ App::renderInternal(bool forceBlocking,const std::list& effects,const s } Param* -App::getProjectParam(const std::string& name) const +App::getProjectParam(const QString& name) const { - KnobPtr knob = _instance->getProject()->getKnobByName(name); + KnobPtr knob = _instance->getProject()->getKnobByName(name.toStdString()); if (!knob) { return 0; } @@ -292,42 +292,42 @@ App::getProjectParam(const std::string& name) const } void -App::writeToScriptEditor(const std::string& message) +App::writeToScriptEditor(const QString& message) { - _instance->appendToScriptEditor(message); + _instance->appendToScriptEditor(message.toStdString()); } void -App::addFormat(const std::string& formatSpec) +App::addFormat(const QString& formatSpec) { - if (!_instance->getProject()->addFormat(formatSpec)) { - _instance->appendToScriptEditor(formatSpec); + if (!_instance->getProject()->addFormat(formatSpec.toStdString())) { + _instance->appendToScriptEditor(formatSpec.toStdString()); } } bool -App::saveTempProject(const std::string& filename) +App::saveTempProject(const QString& filename) { - return _instance->saveTemp(filename); + return _instance->saveTemp(filename.toStdString()); } bool -App::saveProject(const std::string& filename) +App::saveProject(const QString& filename) { - return _instance->save(filename); + return _instance->save(filename.toStdString()); } bool -App::saveProjectAs(const std::string& filename) +App::saveProjectAs(const QString& filename) { - return _instance->saveAs(filename); + return _instance->saveAs(filename.toStdString()); } App* -App::loadProject(const std::string& filename) +App::loadProject(const QString& filename) { - AppInstance* app =_instance->loadProject(filename); + AppInstance* app =_instance->loadProject(filename.toStdString()); if (!app) { return 0; } @@ -360,16 +360,22 @@ App::newProject() } -std::list +std::list App::getViewNames() const { - std::list ret; + std::list ret; const std::vector& v = _instance->getProject()->getProjectViewNames(); for (std::size_t i = 0; i < v.size(); ++i) { - ret.push_back(v[i]); + ret.push_back(QString::fromUtf8(v[i].c_str())); } return ret; } +void +App::addProjectLayer(const ImageLayer& layer) +{ + _instance->getProject()->addProjectDefaultLayer(layer.getInternalComps()); +} + NATRON_PYTHON_NAMESPACE_EXIT; NATRON_NAMESPACE_EXIT; diff --git a/Engine/PyAppInstance.h b/Engine/PyAppInstance.h index f58f4a505d..6c050f8732 100644 --- a/Engine/PyAppInstance.h +++ b/Engine/PyAppInstance.h @@ -45,7 +45,7 @@ class AppSettings AppSettings(const boost::shared_ptr& settings); - Param* getParam(const std::string& scriptName) const; + Param* getParam(const QString& scriptName) const; std::list getParams() const; @@ -81,14 +81,14 @@ class App : public Group * @param group If not NULL, this should be a pointer to a group node where-in to insert the newly created effect. * If NULL, the newly created node will be inserted in the project's root. **/ - Effect* createNode(const std::string& pluginID, + Effect* createNode(const QString& pluginID, int majorVersion = -1, Group* group = 0) const; - Effect* createReader(const std::string& filename, + Effect* createReader(const QString& filename, Group* group = 0) const; - Effect* createWriter(const std::string& filename, + Effect* createWriter(const QString& filename, Group* group = 0) const; int timelineGetTime() const; @@ -97,19 +97,19 @@ class App : public Group int timelineGetRightBound() const; - void addFormat(const std::string& formatSpec); + void addFormat(const QString& formatSpec); void render(Effect* writeNode,int firstFrame, int lastFrame, int frameStep = 1); void render(const std::list& effects,const std::list& firstFrames,const std::list& lastFrames, const std::list& frameSteps); - Param* getProjectParam(const std::string& name) const; + Param* getProjectParam(const QString& name) const; - void writeToScriptEditor(const std::string& message); + void writeToScriptEditor(const QString& message); - bool saveProject(const std::string& filename); - bool saveProjectAs(const std::string& filename); - bool saveTempProject(const std::string& filename); - App* loadProject(const std::string& filename); + bool saveProject(const QString& filename); + bool saveProjectAs(const QString& filename); + bool saveTempProject(const QString& filename); + App* loadProject(const QString& filename); ///Close the current project but keep the window bool resetProject(); @@ -120,7 +120,9 @@ class App : public Group ///Opens a new window App* newProject(); - std::list getViewNames() const; + std::list getViewNames() const; + + void addProjectLayer(const ImageLayer& layer); protected: diff --git a/Engine/PyGlobalFunctions.h b/Engine/PyGlobalFunctions.h index 0174a13251..5890351e08 100644 --- a/Engine/PyGlobalFunctions.h +++ b/Engine/PyGlobalFunctions.h @@ -42,22 +42,33 @@ NATRON_PYTHON_NAMESPACE_ENTER; class PyCoreApplication { + public: PyCoreApplication() {} virtual ~PyCoreApplication() {} - inline std::list + inline QStringList getPluginIDs() const { - return appPTR->getPluginIDs(); + QStringList ret; + std::list list = appPTR->getPluginIDs(); + for (std::list::iterator it = list.begin(); it!=list.end(); ++it) { + ret.push_back(QString::fromUtf8(it->c_str())); + } + return ret; } - inline std::list - getPluginIDs(const std::string& filter) const + inline QStringList + getPluginIDs(const QString& filter) const { - return appPTR->getPluginIDs(filter); + QStringList ret; + std::list list = appPTR->getPluginIDs(filter.toStdString()); + for (std::list::iterator it = list.begin(); it!=list.end(); ++it) { + ret.push_back(QString::fromUtf8(it->c_str())); + } + return ret; } inline int @@ -66,16 +77,21 @@ class PyCoreApplication return appPTR->getNumInstances(); } - inline std::list + inline QStringList getNatronPath() const { - return appPTR->getNatronPath(); + QStringList ret; + std::list list = appPTR->getNatronPath(); + for (std::list::iterator it = list.begin(); it!=list.end(); ++it) { + ret.push_back(QString::fromUtf8(it->c_str())); + } + return ret; } inline void - appendToNatronPath(const std::string& path) + appendToNatronPath(const QString& path) { - appPTR->appendToNatronPath(path); + appPTR->appendToNatronPath(path.toStdString()); } inline bool isLinux() const @@ -114,9 +130,9 @@ class PyCoreApplication #endif } - inline std::string getNatronVersionString() const + inline QString getNatronVersionString() const { - return NATRON_VERSION_STRING; + return QString::fromUtf8(NATRON_VERSION_STRING); } inline int getNatronVersionMajor() const @@ -139,9 +155,9 @@ class PyCoreApplication return NATRON_VERSION_ENCODED; } - inline std::string getNatronDevelopmentStatus() const + inline QString getNatronDevelopmentStatus() const { - return std::string(NATRON_DEVELOPMENT_STATUS); + return QString::fromUtf8(NATRON_DEVELOPMENT_STATUS); } inline int getBuildNumber() const @@ -190,14 +206,14 @@ class PyCoreApplication return new AppSettings(appPTR->getCurrentSettings()); } - inline void setOnProjectCreatedCallback(const std::string& pythonFunctionName) + inline void setOnProjectCreatedCallback(const QString& pythonFunctionName) { - appPTR->setOnProjectCreatedCallback(pythonFunctionName); + appPTR->setOnProjectCreatedCallback(pythonFunctionName.toStdString()); } - inline void setOnProjectLoadedCallback(const std::string& pythonFunctionName) + inline void setOnProjectLoadedCallback(const QString& pythonFunctionName) { - appPTR->setOnProjectLoadedCallback(pythonFunctionName); + appPTR->setOnProjectLoadedCallback(pythonFunctionName.toStdString()); } diff --git a/Engine/PyNode.cpp b/Engine/PyNode.cpp index 1d73d0e22e..8d90d05aa6 100644 --- a/Engine/PyNode.cpp +++ b/Engine/PyNode.cpp @@ -40,26 +40,40 @@ NATRON_NAMESPACE_ENTER; NATRON_PYTHON_NAMESPACE_ENTER; -ImageLayer::ImageLayer(const std::string& layerName, - const std::string& componentsPrettyName, - const std::vector& componentsName) -: _comps(layerName,componentsPrettyName, componentsName) +ImageLayer::ImageLayer(const QString& layerName, + const QString& componentsPrettyName, + const QStringList& componentsName) +: _layerName(layerName) +, _componentsPrettyName(componentsPrettyName) +, _componentsName(componentsName) +, _comps() { + std::vector channels(componentsName.size()); + int i = 0; + for (QStringList::const_iterator it = componentsName.begin(); it!=componentsName.end(); ++it,++i) { + channels[i] = it->toStdString(); + } + _comps.reset(new ImageComponents(layerName.toStdString(), componentsPrettyName.toStdString(), channels)); } -ImageLayer::ImageLayer(const ImageComponents& internalComps) -: _comps(internalComps) +ImageLayer::ImageLayer(const ImageComponents& comps) +: _layerName(QString::fromUtf8(comps.getLayerName().c_str())) +, _componentsPrettyName(QString::fromUtf8(comps.getComponentsGlobalName().c_str())) { - + const std::vector& channels = comps.getComponentsNames(); + for (std::size_t i = 0; i < channels.size(); ++i) { + _componentsName.push_back(QString::fromUtf8(channels[i].c_str())); + } + _comps.reset(new ImageComponents(comps)); } int ImageLayer::getHash(const ImageLayer& layer) { Hash64 h; - Hash64_appendQString(&h, QString::fromUtf8(layer._comps.getLayerName().c_str())); - const std::vector& comps = layer._comps.getComponentsNames(); + Hash64_appendQString(&h, QString::fromUtf8(layer._comps->getLayerName().c_str())); + const std::vector& comps = layer._comps->getComponentsNames(); for (std::size_t i = 0; i < comps.size(); ++i) { Hash64_appendQString(&h, QString::fromUtf8(comps[i].c_str())); } @@ -69,31 +83,31 @@ ImageLayer::getHash(const ImageLayer& layer) bool ImageLayer::isColorPlane() const { - return _comps.isColorPlane(); + return _comps->isColorPlane(); } int ImageLayer::getNumComponents() const { - return _comps.getNumComponents(); + return _comps->getNumComponents(); } -const std::string& +const QString& ImageLayer::getLayerName() const { - return _comps.getLayerName(); + return _layerName; } -const std::vector& +const QStringList& ImageLayer::getComponentsNames() const { - return _comps.getComponentsNames(); + return _componentsName; } -const std::string& +const QString& ImageLayer::getComponentsPrettyName() const { - return _comps.getComponentsGlobalName(); + return _componentsPrettyName; } bool ImageLayer::operator==(const ImageLayer& other) const @@ -251,51 +265,51 @@ Effect::getInput(int inputNumber) const return NULL; } -std::string +QString Effect::getScriptName() const { - return getInternalNode()->getScriptName_mt_safe(); + return QString::fromUtf8(getInternalNode()->getScriptName_mt_safe().c_str()); } bool -Effect::setScriptName(const std::string& scriptName) +Effect::setScriptName(const QString& scriptName) { try { - getInternalNode()->setScriptName(scriptName); + getInternalNode()->setScriptName(scriptName.toStdString()); } catch (...) { return false; } return true; } -std::string +QString Effect::getLabel() const { - return getInternalNode()->getLabel_mt_safe(); + return QString::fromUtf8(getInternalNode()->getLabel_mt_safe().c_str()); } void -Effect::setLabel(const std::string& name) +Effect::setLabel(const QString& name) { - return getInternalNode()->setLabel(name); + return getInternalNode()->setLabel(name.toStdString()); } -std::string +QString Effect::getInputLabel(int inputNumber) { try { - return getInternalNode()->getInputLabel(inputNumber); + return QString::fromUtf8(getInternalNode()->getInputLabel(inputNumber).c_str()); } catch (const std::exception& e) { getInternalNode()->getApp()->appendToScriptEditor(e.what()); } - return std::string(); + return QString(); } -std::string +QString Effect::getPluginID() const { - return getInternalNode()->getPluginID(); + return QString::fromUtf8(getInternalNode()->getPluginID().c_str()); } Param* @@ -382,9 +396,9 @@ Effect::getParams() const } Param* -Effect::getParam(const std::string& name) const +Effect::getParam(const QString& name) const { - KnobPtr knob = getInternalNode()->getKnobByName(name); + KnobPtr knob = getInternalNode()->getKnobByName(name.toStdString()); if (knob) { return createParamWrapperForKnob(knob); } else { @@ -455,9 +469,9 @@ Effect::endChanges() } IntParam* -UserParamHolder::createIntParam(const std::string& name, const std::string& label) +UserParamHolder::createIntParam(const QString& name, const QString& label) { - boost::shared_ptr knob = _holder->createIntKnob(name, label, 1); + boost::shared_ptr knob = _holder->createIntKnob(name.toStdString(), label.toStdString(), 1); if (knob) { return new IntParam(knob); } else { @@ -466,9 +480,9 @@ UserParamHolder::createIntParam(const std::string& name, const std::string& labe } Int2DParam* -UserParamHolder::createInt2DParam(const std::string& name, const std::string& label) +UserParamHolder::createInt2DParam(const QString& name, const QString& label) { - boost::shared_ptr knob = _holder->createIntKnob(name, label, 2); + boost::shared_ptr knob = _holder->createIntKnob(name.toStdString(), label.toStdString(), 2); if (knob) { return new Int2DParam(knob); } else { @@ -478,9 +492,9 @@ UserParamHolder::createInt2DParam(const std::string& name, const std::string& la } Int3DParam* -UserParamHolder::createInt3DParam(const std::string& name, const std::string& label) +UserParamHolder::createInt3DParam(const QString& name, const QString& label) { - boost::shared_ptr knob = _holder->createIntKnob(name, label, 3); + boost::shared_ptr knob = _holder->createIntKnob(name.toStdString(), label.toStdString(), 3); if (knob) { return new Int3DParam(knob); } else { @@ -490,9 +504,9 @@ UserParamHolder::createInt3DParam(const std::string& name, const std::string& la } DoubleParam* -UserParamHolder::createDoubleParam(const std::string& name, const std::string& label) +UserParamHolder::createDoubleParam(const QString& name, const QString& label) { - boost::shared_ptr knob = _holder->createDoubleKnob(name, label, 1); + boost::shared_ptr knob = _holder->createDoubleKnob(name.toStdString(), label.toStdString(), 1); if (knob) { return new DoubleParam(knob); } else { @@ -502,9 +516,9 @@ UserParamHolder::createDoubleParam(const std::string& name, const std::string& l } Double2DParam* -UserParamHolder::createDouble2DParam(const std::string& name, const std::string& label) +UserParamHolder::createDouble2DParam(const QString& name, const QString& label) { - boost::shared_ptr knob = _holder->createDoubleKnob(name, label, 2); + boost::shared_ptr knob = _holder->createDoubleKnob(name.toStdString(), label.toStdString(), 2); if (knob) { return new Double2DParam(knob); } else { @@ -513,9 +527,9 @@ UserParamHolder::createDouble2DParam(const std::string& name, const std::string& } Double3DParam* -UserParamHolder::createDouble3DParam(const std::string& name, const std::string& label) +UserParamHolder::createDouble3DParam(const QString& name, const QString& label) { - boost::shared_ptr knob = _holder->createDoubleKnob(name, label, 3); + boost::shared_ptr knob = _holder->createDoubleKnob(name.toStdString(), label.toStdString(), 3); if (knob) { return new Double3DParam(knob); } else { @@ -524,9 +538,9 @@ UserParamHolder::createDouble3DParam(const std::string& name, const std::string& } BooleanParam* -UserParamHolder::createBooleanParam(const std::string& name, const std::string& label) +UserParamHolder::createBooleanParam(const QString& name, const QString& label) { - boost::shared_ptr knob = _holder->createBoolKnob(name, label); + boost::shared_ptr knob = _holder->createBoolKnob(name.toStdString(), label.toStdString()); if (knob) { return new BooleanParam(knob); } else { @@ -535,9 +549,9 @@ UserParamHolder::createBooleanParam(const std::string& name, const std::string& } ChoiceParam* -UserParamHolder::createChoiceParam(const std::string& name, const std::string& label) +UserParamHolder::createChoiceParam(const QString& name, const QString& label) { - boost::shared_ptr knob = _holder->createChoiceKnob(name, label); + boost::shared_ptr knob = _holder->createChoiceKnob(name.toStdString(), label.toStdString()); if (knob) { return new ChoiceParam(knob); } else { @@ -546,9 +560,9 @@ UserParamHolder::createChoiceParam(const std::string& name, const std::string& l } ColorParam* -UserParamHolder::createColorParam(const std::string& name, const std::string& label, bool useAlpha) +UserParamHolder::createColorParam(const QString& name, const QString& label, bool useAlpha) { - boost::shared_ptr knob = _holder->createColorKnob(name, label, useAlpha ? 4 : 3); + boost::shared_ptr knob = _holder->createColorKnob(name.toStdString(), label.toStdString(), useAlpha ? 4 : 3); if (knob) { return new ColorParam(knob); } else { @@ -557,9 +571,9 @@ UserParamHolder::createColorParam(const std::string& name, const std::string& la } StringParam* -UserParamHolder::createStringParam(const std::string& name, const std::string& label) +UserParamHolder::createStringParam(const QString& name, const QString& label) { - boost::shared_ptr knob = _holder->createStringKnob(name, label); + boost::shared_ptr knob = _holder->createStringKnob(name.toStdString(), label.toStdString()); if (knob) { return new StringParam(knob); } else { @@ -568,9 +582,9 @@ UserParamHolder::createStringParam(const std::string& name, const std::string& l } FileParam* -UserParamHolder::createFileParam(const std::string& name, const std::string& label) +UserParamHolder::createFileParam(const QString& name, const QString& label) { - boost::shared_ptr knob = _holder->createFileKnob(name, label); + boost::shared_ptr knob = _holder->createFileKnob(name.toStdString(), label.toStdString()); if (knob) { return new FileParam(knob); } else { @@ -579,9 +593,9 @@ UserParamHolder::createFileParam(const std::string& name, const std::string& lab } OutputFileParam* -UserParamHolder::createOutputFileParam(const std::string& name, const std::string& label) +UserParamHolder::createOutputFileParam(const QString& name, const QString& label) { - boost::shared_ptr knob = _holder->createOuptutFileKnob(name, label); + boost::shared_ptr knob = _holder->createOuptutFileKnob(name.toStdString(), label.toStdString()); if (knob) { return new OutputFileParam(knob); } else { @@ -590,9 +604,9 @@ UserParamHolder::createOutputFileParam(const std::string& name, const std::strin } PathParam* -UserParamHolder::createPathParam(const std::string& name, const std::string& label) +UserParamHolder::createPathParam(const QString& name, const QString& label) { - boost::shared_ptr knob = _holder->createPathKnob(name, label); + boost::shared_ptr knob = _holder->createPathKnob(name.toStdString(), label.toStdString()); if (knob) { return new PathParam(knob); } else { @@ -601,9 +615,9 @@ UserParamHolder::createPathParam(const std::string& name, const std::string& lab } ButtonParam* -UserParamHolder::createButtonParam(const std::string& name, const std::string& label) +UserParamHolder::createButtonParam(const QString& name, const QString& label) { - boost::shared_ptr knob = _holder->createButtonKnob(name, label); + boost::shared_ptr knob = _holder->createButtonKnob(name.toStdString(), label.toStdString()); if (knob) { return new ButtonParam(knob); } else { @@ -612,9 +626,9 @@ UserParamHolder::createButtonParam(const std::string& name, const std::string& l } SeparatorParam* -UserParamHolder::createSeparatorParam(const std::string& name, const std::string& label) +UserParamHolder::createSeparatorParam(const QString& name, const QString& label) { - boost::shared_ptr knob = _holder->createSeparatorKnob(name, label); + boost::shared_ptr knob = _holder->createSeparatorKnob(name.toStdString(), label.toStdString()); if (knob) { return new SeparatorParam(knob); } else { @@ -623,9 +637,9 @@ UserParamHolder::createSeparatorParam(const std::string& name, const std::string } GroupParam* -UserParamHolder::createGroupParam(const std::string& name, const std::string& label) +UserParamHolder::createGroupParam(const QString& name, const QString& label) { - boost::shared_ptr knob = _holder->createGroupKnob(name, label); + boost::shared_ptr knob = _holder->createGroupKnob(name.toStdString(), label.toStdString()); if (knob) { return new GroupParam(knob); } else { @@ -634,13 +648,13 @@ UserParamHolder::createGroupParam(const std::string& name, const std::string& la } PageParam* -UserParamHolder::createPageParam(const std::string& name, const std::string& label) +UserParamHolder::createPageParam(const QString& name, const QString& label) { if (!_holder) { assert(false); return 0; } - boost::shared_ptr knob = _holder->createPageKnob(name, label); + boost::shared_ptr knob = _holder->createPageKnob(name.toStdString(), label.toStdString()); if (knob) { return new PageParam(knob); } else { @@ -649,9 +663,9 @@ UserParamHolder::createPageParam(const std::string& name, const std::string& lab } ParametricParam* -UserParamHolder::createParametricParam(const std::string& name, const std::string& label, int nbCurves) +UserParamHolder::createParametricParam(const QString& name, const QString& label, int nbCurves) { - boost::shared_ptr knob = _holder->createParametricKnob(name, label, nbCurves); + boost::shared_ptr knob = _holder->createParametricKnob(name.toStdString(), label.toStdString(), nbCurves); if (knob) { return new ParametricParam(knob); } else { @@ -758,18 +772,23 @@ Effect::setSubGraphEditable(bool editable) } bool -Effect::addUserPlane(const std::string& planeName, const std::vector& channels) +Effect::addUserPlane(const QString& planeName, const QStringList& channels) { - if (planeName.empty() || + if (planeName.isEmpty() || channels.size() < 1 || channels.size() > 4) { return false; } std::string compsGlobal; - for (std::size_t i = 0; i < channels.size(); ++i) { - compsGlobal.append(channels[i]); + std::vector chans(channels.size()); + int i = 0; + for (QStringList::const_iterator it = channels.begin(); it != channels.end(); ++it,++i) { + std::string c = it->toStdString(); + compsGlobal.append(c); + chans[i] = c; + } - ImageComponents comp(planeName,compsGlobal,channels); + ImageComponents comp(planeName.toStdString(),compsGlobal,chans); return getInternalNode()->addUserComponents(comp); } @@ -835,12 +854,17 @@ Effect::getPremult() const void -Effect::setPagesOrder(const std::list& pages) +Effect::setPagesOrder(const QStringList& pages) { if (!getInternalNode()) { return; } - getInternalNode()->setPagesOrder(pages); + + std::list order; + for (QStringList::const_iterator it= pages.begin() ; it!=pages.end(); ++it) { + order.push_back(it->toStdString()); + } + getInternalNode()->setPagesOrder(order); } diff --git a/Engine/PyNode.h b/Engine/PyNode.h index dd79ecd020..f3850830af 100644 --- a/Engine/PyNode.h +++ b/Engine/PyNode.h @@ -46,15 +46,23 @@ NATRON_PYTHON_NAMESPACE_ENTER; class ImageLayer { - ImageComponents _comps; -public: + QString _layerName; + QString _componentsPrettyName; + QStringList _componentsName; + boost::shared_ptr _comps; - ImageLayer(const std::string& layerName, - const std::string& componentsPrettyName, - const std::vector& componentsName); +public: - ImageLayer(const ImageComponents& internalComps); + ImageLayer(const QString& layerName, + const QString& componentsPrettyName, + const QStringList& componentsName); + + ImageLayer(const ImageComponents& comps); + const ImageComponents& getInternalComps() const + { + return *_comps; + } ~ImageLayer() {} @@ -64,11 +72,11 @@ class ImageLayer int getNumComponents() const; - const std::string& getLayerName() const; + const QString& getLayerName() const; - const std::vector& getComponentsNames() const; + const QStringList& getComponentsNames() const; - const std::string& getComponentsPrettyName() const; + const QString& getComponentsPrettyName() const; bool operator==(const ImageLayer& other) const; @@ -164,37 +172,37 @@ class UserParamHolder //////////// Note that ParametricParam , GroupParam, PageParam, ButtonParam, FileParam, OutputFileParam, //////////// PathParam cannot animate at all. - IntParam* createIntParam(const std::string& name, const std::string& label); - Int2DParam* createInt2DParam(const std::string& name, const std::string& label); - Int3DParam* createInt3DParam(const std::string& name, const std::string& label); + IntParam* createIntParam(const QString& name, const QString& label); + Int2DParam* createInt2DParam(const QString& name, const QString& label); + Int3DParam* createInt3DParam(const QString& name, const QString& label); - DoubleParam* createDoubleParam(const std::string& name, const std::string& label); - Double2DParam* createDouble2DParam(const std::string& name, const std::string& label); - Double3DParam* createDouble3DParam(const std::string& name, const std::string& label); + DoubleParam* createDoubleParam(const QString& name, const QString& label); + Double2DParam* createDouble2DParam(const QString& name, const QString& label); + Double3DParam* createDouble3DParam(const QString& name, const QString& label); - BooleanParam* createBooleanParam(const std::string& name, const std::string& label); + BooleanParam* createBooleanParam(const QString& name, const QString& label); - ChoiceParam* createChoiceParam(const std::string& name, const std::string& label); + ChoiceParam* createChoiceParam(const QString& name, const QString& label); - ColorParam* createColorParam(const std::string& name, const std::string& label, bool useAlpha); + ColorParam* createColorParam(const QString& name, const QString& label, bool useAlpha); - StringParam* createStringParam(const std::string& name, const std::string& label); + StringParam* createStringParam(const QString& name, const QString& label); - FileParam* createFileParam(const std::string& name, const std::string& label); + FileParam* createFileParam(const QString& name, const QString& label); - OutputFileParam* createOutputFileParam(const std::string& name, const std::string& label); + OutputFileParam* createOutputFileParam(const QString& name, const QString& label); - PathParam* createPathParam(const std::string& name, const std::string& label); + PathParam* createPathParam(const QString& name, const QString& label); - ButtonParam* createButtonParam(const std::string& name, const std::string& label); + ButtonParam* createButtonParam(const QString& name, const QString& label); - SeparatorParam* createSeparatorParam(const std::string& name, const std::string& label); + SeparatorParam* createSeparatorParam(const QString& name, const QString& label); - GroupParam* createGroupParam(const std::string& name, const std::string& label); + GroupParam* createGroupParam(const QString& name, const QString& label); - PageParam* createPageParam(const std::string& name, const std::string& label); + PageParam* createPageParam(const QString& name, const QString& label); - ParametricParam* createParametricParam(const std::string& name, const std::string& label,int nbCurves); + ParametricParam* createParametricParam(const QString& name, const QString& label,int nbCurves); bool removeParam(Param* param); @@ -257,33 +265,33 @@ class Effect : public Group, public UserParamHolder /** * @brief Returns the name of the Effect as used internally **/ - std::string getScriptName() const; + QString getScriptName() const; /** * @brief Set the internal script name of the effect * @returns False upon failure, True upon success. **/ - bool setScriptName(const std::string& scriptName); + bool setScriptName(const QString& scriptName); /** * @brief Returns the name of the Effect as displayed on the GUI **/ - std::string getLabel() const; + QString getLabel() const; /** * @brief Set the name of the Effect as used on the GUI **/ - void setLabel(const std::string& name); + void setLabel(const QString& name); /** * @brief Returns the ID of the plug-in embedded into the Effect **/ - std::string getPluginID() const; + QString getPluginID() const; /** * @brief Returns the label of the input at the given index **/ - std::string getInputLabel(int inputNumber); + QString getInputLabel(int inputNumber); /** * @brief Returns a list of all parameters for the Effect. These are the parameters located in the settings panel @@ -294,7 +302,7 @@ class Effect : public Group, public UserParamHolder /** * @brief Returns a pointer to the Param named after the given name or NULL if no parameter with the given name could be found. **/ - Param* getParam(const std::string& name) const; + Param* getParam(const QString& name) const; /** * @brief When called, all parameter changes will not call the callback onParamChanged and will not attempt to trigger a new render. @@ -362,7 +370,7 @@ class Effect : public Group, public UserParamHolder void setSubGraphEditable(bool editable); - bool addUserPlane(const std::string& planeName, const std::vector& channels); + bool addUserPlane(const QString& planeName, const QStringList& channels); std::map getAvailableLayers() const; @@ -374,7 +382,7 @@ class Effect : public Group, public UserParamHolder NATRON_NAMESPACE::ImagePremultiplicationEnum getPremult() const; - void setPagesOrder(const std::list& pages); + void setPagesOrder(const QStringList& pages); }; NATRON_PYTHON_NAMESPACE_EXIT; diff --git a/Engine/PyNodeGroup.cpp b/Engine/PyNodeGroup.cpp index 87dfa9b53b..5cc9026764 100644 --- a/Engine/PyNodeGroup.cpp +++ b/Engine/PyNodeGroup.cpp @@ -52,12 +52,12 @@ Group::~Group() } Effect* -Group::getNode(const std::string& fullySpecifiedName) const +Group::getNode(const QString& fullySpecifiedName) const { if (!_collection.lock()) { return 0; } - NodePtr node = _collection.lock()->getNodeByFullySpecifiedName(fullySpecifiedName); + NodePtr node = _collection.lock()->getNodeByFullySpecifiedName(fullySpecifiedName.toStdString()); if (node && node->isActivated()) { return new Effect(node); } else { diff --git a/Engine/PyNodeGroup.h b/Engine/PyNodeGroup.h index bf4f27d607..cd9cc93625 100644 --- a/Engine/PyNodeGroup.h +++ b/Engine/PyNodeGroup.h @@ -60,7 +60,7 @@ class Group * This function is called recursively on subgroups until a match is found. * It is meant to be called only on the project's root. **/ - Effect* getNode(const std::string& fullySpecifiedName) const; + Effect* getNode(const QString& fullySpecifiedName) const; /** * @brief Get all nodes in the project's root. diff --git a/Engine/PyParameter.cpp b/Engine/PyParameter.cpp index 351094407b..762a9777be 100644 --- a/Engine/PyParameter.cpp +++ b/Engine/PyParameter.cpp @@ -63,38 +63,38 @@ Param::getNumDimensions() const return getInternalKnob()->getDimension(); } -std::string +QString Param::getScriptName() const { - return getInternalKnob()->getName(); + return QString::fromUtf8(getInternalKnob()->getName().c_str()); } -std::string +QString Param::getLabel() const { - return getInternalKnob()->getLabel(); + return QString::fromUtf8(getInternalKnob()->getLabel().c_str()); } -std::string +QString Param::getTypeName() const { - return getInternalKnob()->typeName(); + return QString::fromUtf8(getInternalKnob()->typeName().c_str()); } -std::string +QString Param::getHelp() const { - return getInternalKnob()->getHintToolTip(); + return QString::fromUtf8(getInternalKnob()->getHintToolTip().c_str()); } void -Param::setHelp(const std::string& help) +Param::setHelp(const QString& help) { if (!getInternalKnob()->isUserKnob()) { return; } - getInternalKnob()->setHintToolTip(help); + getInternalKnob()->setHintToolTip(help.toStdString()); } bool @@ -416,20 +416,20 @@ Param::_addAsDependencyOf(int fromExprDimension,Param* param,int thisDimension) } bool -AnimatedParam::setExpression(const std::string& expr,bool hasRetVariable,int dimension) +AnimatedParam::setExpression(const QString& expr,bool hasRetVariable,int dimension) { try { - _knob.lock()->setExpression(dimension,expr,hasRetVariable); + _knob.lock()->setExpression(dimension,expr.toStdString(),hasRetVariable, true); } catch (...) { return false; } return true; } -std::string +QString AnimatedParam::getExpression(int dimension,bool* hasRetVariable) const { - std::string ret = _knob.lock()->getExpression(dimension); + QString ret = QString::fromUtf8(_knob.lock()->getExpression(dimension).c_str()); *hasRetVariable = _knob.lock()->isExpressionUsingRetVariable(dimension); return ret; } @@ -1094,9 +1094,9 @@ ChoiceParam::set(int x, double frame) } void -ChoiceParam::set(const std::string& label) +ChoiceParam::set(const QString& label) { - KnobHelper::ValueChangedReturnCodeEnum s = _choiceKnob.lock()->setValueFromLabel(label, 0); + KnobHelper::ValueChangedReturnCodeEnum s = _choiceKnob.lock()->setValueFromLabel(label.toStdString(), 0); Q_UNUSED(s); } @@ -1131,9 +1131,9 @@ ChoiceParam::setDefaultValue(int value) } void -ChoiceParam::setDefaultValue(const std::string& value) +ChoiceParam::setDefaultValue(const QString& value) { - _choiceKnob.lock()->setDefaultValueFromLabel(value); + _choiceKnob.lock()->setDefaultValueFromLabel(value.toStdString()); } int @@ -1149,7 +1149,7 @@ ChoiceParam::restoreDefaultValue() } void -ChoiceParam::addOption(const std::string& option,const std::string& help) +ChoiceParam::addOption(const QString& option,const QString& help) { boost::shared_ptr knob = _choiceKnob.lock(); if (!knob->isUserKnob()) { @@ -1157,16 +1157,12 @@ ChoiceParam::addOption(const std::string& option,const std::string& help) } std::vector entries = knob->getEntries_mt_safe(); std::vector helps = knob->getEntriesHelp_mt_safe(); - entries.push_back(option); - if (!help.empty()) { - helps.push_back(help); - } - knob->populateChoices(entries,helps); + knob->appendChoice(option.toStdString(), help.toStdString()); } void -ChoiceParam::setOptions(const std::list >& options) +ChoiceParam::setOptions(const std::list >& options) { boost::shared_ptr knob = _choiceKnob.lock(); if (!knob->isUserKnob()) { @@ -1174,21 +1170,21 @@ ChoiceParam::setOptions(const std::list >& op } std::vector entries,helps; - for (std::list >::const_iterator it = options.begin(); it != options.end(); ++it) { - entries.push_back(it->first); - helps.push_back(it->second); + for (std::list >::const_iterator it = options.begin(); it != options.end(); ++it) { + entries.push_back(it->first.toStdString()); + helps.push_back(it->second.toStdString()); } knob->populateChoices(entries,helps); } -std::string +QString ChoiceParam::getOption(int index) const { std::vector entries = _choiceKnob.lock()->getEntries_mt_safe(); if (index < 0 || index >= (int)entries.size()) { - return std::string(); + return QString(); } - return entries[index]; + return QString::fromUtf8(entries[index].c_str()); } @@ -1198,10 +1194,15 @@ ChoiceParam::getNumOptions() const return _choiceKnob.lock()->getNumEntries(); } -std::vector +QStringList ChoiceParam::getOptions() const { - return _choiceKnob.lock()->getEntries_mt_safe(); + QStringList ret; + std::vector entries = _choiceKnob.lock()->getEntries_mt_safe(); + for (std::size_t i = 0; i < entries.size(); ++i) { + ret.push_back(QString::fromUtf8(entries[i].c_str())); + } + return ret; } int @@ -1317,65 +1318,65 @@ StringParamBase::~StringParamBase() } -std::string +QString StringParamBase::get() const { - return _stringKnob.lock()->getValue(0); + return QString::fromUtf8(_stringKnob.lock()->getValue(0).c_str()); } -std::string +QString StringParamBase::get(double frame) const { - return _stringKnob.lock()->getValueAtTime(frame,0); + return QString::fromUtf8(_stringKnob.lock()->getValueAtTime(frame,0).c_str()); } void -StringParamBase::set(const std::string& x) +StringParamBase::set(const QString& x) { - _stringKnob.lock()->setValue(x, ViewSpec::current(), 0); + _stringKnob.lock()->setValue(x.toStdString(), ViewSpec::current(), 0); } void -StringParamBase::set(const std::string& x, double frame) +StringParamBase::set(const QString& x, double frame) { - _stringKnob.lock()->setValueAtTime(frame, x, ViewSpec::current(), 0); + _stringKnob.lock()->setValueAtTime(frame, x.toStdString(), ViewSpec::current(), 0); } -std::string +QString StringParamBase::getValue() const { - return _stringKnob.lock()->getValue(0); + return QString::fromUtf8(_stringKnob.lock()->getValue(0).c_str()); } void -StringParamBase::setValue(const std::string& value) +StringParamBase::setValue(const QString& value) { - _stringKnob.lock()->setValue(value, ViewSpec::current(), 0); + _stringKnob.lock()->setValue(value.toStdString(), ViewSpec::current(), 0); } -std::string +QString StringParamBase::getValueAtTime(double time) const { - return _stringKnob.lock()->getValueAtTime(time,0); + return QString::fromUtf8(_stringKnob.lock()->getValueAtTime(time,0).c_str()); } void -StringParamBase::setValueAtTime(const std::string& value,double time) +StringParamBase::setValueAtTime(const QString& value,double time) { - _stringKnob.lock()->setValueAtTime(time, value, ViewSpec::current(), 0); + _stringKnob.lock()->setValueAtTime(time, value.toStdString(), ViewSpec::current(), 0); } void -StringParamBase::setDefaultValue(const std::string& value) +StringParamBase::setDefaultValue(const QString& value) { - _stringKnob.lock()->setDefaultValue(value,0); + _stringKnob.lock()->setDefaultValue(value.toStdString(),0); } -std::string +QString StringParamBase::getDefaultValue() const { - return _stringKnob.lock()->getDefaultValues_mt_safe()[0]; + return QString::fromUtf8( _stringKnob.lock()->getDefaultValues_mt_safe()[0].c_str()); } void @@ -1385,11 +1386,11 @@ StringParamBase::restoreDefaultValue() } -std::string +QString StringParamBase::addAsDependencyOf(int fromExprDimension,Param* param,int thisDimension) { _addAsDependencyOf(fromExprDimension, param,thisDimension); - return _stringKnob.lock()->getValue(); + return QString::fromUtf8(_stringKnob.lock()->getValue().c_str()); } @@ -1539,9 +1540,9 @@ ButtonParam::~ButtonParam() } void -ButtonParam::setIconFilePath(const std::string& icon) +ButtonParam::setIconFilePath(const QString& icon) { - _buttonKnob.lock()->setIconLabel(icon); + _buttonKnob.lock()->setIconLabel(icon.toStdString()); } void diff --git a/Engine/PyParameter.h b/Engine/PyParameter.h index 1f56a24ae6..847771e06e 100644 --- a/Engine/PyParameter.h +++ b/Engine/PyParameter.h @@ -72,24 +72,24 @@ class Param * @brief Returns the name of the Param internally. This is the identifier that allows the Python programmer * to find and identify a specific Param. **/ - std::string getScriptName() const; + QString getScriptName() const; /** * @brief Returns the label of the Param as shown on the GUI. **/ - std::string getLabel() const; + QString getLabel() const; /** * @brief Returns the type of the parameter. The list of known type is: * "Int" "Bool" "Double" "Button" "Choice" "Color" "String" "Group" "Page" "Parametric" "InputFile" "OutputFile" "Path" **/ - std::string getTypeName() const; + QString getTypeName() const; /** * @brief Returns the help that describes the parameter, its effect, etc... **/ - std::string getHelp() const; - void setHelp(const std::string& help); + QString getHelp() const; + void setHelp(const QString& help); /** * @brief Returns true if this parameter is visible in the user interface, false if it is hidden. @@ -259,8 +259,8 @@ class AnimatedParam : public Param /** * @brief Set an expression on the Param. This is a Python script, see documentation for more infos. **/ - bool setExpression(const std::string& expr,bool hasRetVariable,int dimension = 0); - std::string getExpression(int dimension,bool* hasRetVariable) const; + bool setExpression(const QString& expr,bool hasRetVariable,int dimension = 0); + QString getExpression(int dimension,bool* hasRetVariable) const; bool setInterpolationAtTime(double time, NATRON_NAMESPACE::KeyframeTypeEnum interpolation, int dimension = 0); }; @@ -724,7 +724,7 @@ class ChoiceParam : public AnimatedParam * @brief Set the value from label if it exists. * The label will be compared without case sensitivity to existing entries. If it's not found, nothing is done. */ - void set(const std::string& label); + void set(const QString& label); /** * @brief Returns the value held by the parameter. If it is animated, getValueAtTime @@ -758,7 +758,7 @@ class ChoiceParam : public AnimatedParam /** * @brief Set the default value from an existing entry. If it does not match (without case sensitivity) an existing entry, nothing is done. **/ - void setDefaultValue(const std::string& value); + void setDefaultValue(const QString& value); /** * @brief Return the default value for the given dimension @@ -773,17 +773,17 @@ class ChoiceParam : public AnimatedParam /** * @brief Add a new option to the drop-down menu **/ - void addOption(const std::string& option,const std::string& help); + void addOption(const QString& option,const QString& help); /** * @brief Set all options at once **/ - void setOptions(const std::list >& options); + void setOptions(const std::list >& options); /** * @brief Returns the option at the given index **/ - std::string getOption(int index) const; + QString getOption(int index) const; /** * @brief Returns the count of options @@ -793,7 +793,7 @@ class ChoiceParam : public AnimatedParam /** * @brief Returns all options **/ - std::vector getOptions() const; + QStringList getOptions() const; /** * @brief Adds this Param as a dependency of the given Param. This is used mainly by the GUI to notify the user @@ -891,48 +891,48 @@ class StringParamBase : public AnimatedParam /** * @brief Convenience function that calls getValue() for all dimensions and store them in a tuple-like struct. **/ - std::string get() const; - std::string get(double frame) const; + QString get() const; + QString get(double frame) const; /** * @brief Convenience functions for multi-dimensional setting of values **/ - void set(const std::string& x); - void set(const std::string& x, double frame); + void set(const QString& x); + void set(const QString& x, double frame); /** * @brief Returns the value held by the parameter. If it is animated, getValueAtTime * will be called instead at the current's timeline position. **/ - std::string getValue() const; + QString getValue() const; /** * @brief Set the value held by the parameter. If it is animated * this function will either add a new keyframe or modify a keyframe already existing at the current time. **/ - void setValue(const std::string& value); + void setValue(const QString& value); /** * @brief If this parameter is animated for the given dimension, this function returns a value interpolated between the * 2 keyframes surrounding the given time. If time is exactly one keyframe then the value of the keyframe is returned. * If this parameter is not animated for the given dimension, then this function returns the same as getValue(int) **/ - std::string getValueAtTime(double time) const; + QString getValueAtTime(double time) const; /** * @brief Set a new keyframe on the parameter at the given time. If a keyframe already exists, it will modify it. **/ - void setValueAtTime(const std::string& value,double time); + void setValueAtTime(const QString& value,double time); /** * @brief Set the default value for the given dimension **/ - void setDefaultValue(const std::string& value); + void setDefaultValue(const QString& value); /** * @brief Return the default value for the given dimension **/ - std::string getDefaultValue() const; + QString getDefaultValue() const; /** * @brief Restores the default value for the given dimension @@ -944,7 +944,7 @@ class StringParamBase : public AnimatedParam * when a dependency (through expressions) is destroyed (because the holding node has been removed). * You should not call this directly. **/ - std::string addAsDependencyOf(int fromExprDimension,Param* param,int thisDimension); + QString addAsDependencyOf(int fromExprDimension,Param* param,int thisDimension); @@ -1053,7 +1053,7 @@ class ButtonParam : public Param * @brief Set the icon file-path that should be used for the button. * This can only be called right away after the parameter has been created. **/ - void setIconFilePath(const std::string& icon); + void setIconFilePath(const QString& icon); void trigger(); }; diff --git a/Engine/PyRoto.cpp b/Engine/PyRoto.cpp index c98ff38622..b88734c6c2 100644 --- a/Engine/PyRoto.cpp +++ b/Engine/PyRoto.cpp @@ -52,27 +52,27 @@ ItemBase::~ItemBase() } void -ItemBase::setLabel(const std::string & name) +ItemBase::setLabel(const QString & name) { - _item->setLabel(name); + _item->setLabel(name.toStdString()); } -std::string +QString ItemBase::getLabel() const { - return _item->getLabel(); + return QString::fromUtf8(_item->getLabel().c_str()); } bool -ItemBase::setScriptName(const std::string& name) +ItemBase::setScriptName(const QString& name) { - return _item->setScriptName(name); + return _item->setScriptName(name.toStdString()); } -std::string +QString ItemBase::getScriptName() const { - return _item->getScriptName(); + return QString::fromUtf8(_item->getScriptName().c_str()); } void @@ -117,13 +117,13 @@ ItemBase::getParentLayer() const } Param* -ItemBase::getParam(const std::string& name) const +ItemBase::getParam(const QString& name) const { RotoDrawableItem* drawable = dynamic_cast(_item.get()); if (!drawable) { return 0; } - KnobPtr knob = drawable->getKnobByName(name); + KnobPtr knob = drawable->getKnobByName(name.toStdString()); if (!knob) { return 0; } @@ -513,9 +513,9 @@ Roto::getBaseLayer() const } ItemBase* -Roto::getItemByName(const std::string& name) const +Roto::getItemByName(const QString& name) const { - boost::shared_ptr item = _ctx->getItemByName(name); + boost::shared_ptr item = _ctx->getItemByName(name.toStdString()); if (!item) { return 0; } diff --git a/Engine/PyRoto.h b/Engine/PyRoto.h index fed0d299d0..7c4e563b34 100644 --- a/Engine/PyRoto.h +++ b/Engine/PyRoto.h @@ -56,11 +56,11 @@ class ItemBase return _item; } - void setLabel(const std::string & name); - std::string getLabel() const; + void setLabel(const QString & name); + QString getLabel() const; - bool setScriptName(const std::string& name); - std::string getScriptName() const; + bool setScriptName(const QString& name); + QString getScriptName() const; void setLocked(bool locked); bool getLocked() const; @@ -71,7 +71,7 @@ class ItemBase Layer* getParentLayer() const; - Param* getParam(const std::string& name) const; + Param* getParam(const QString& name) const; private: @@ -217,7 +217,7 @@ class Roto Layer* getBaseLayer() const; - ItemBase* getItemByName(const std::string& name) const; + ItemBase* getItemByName(const QString& name) const; Layer* createLayer(); diff --git a/Engine/PyTracker.cpp b/Engine/PyTracker.cpp index 26638ac2db..7af335eea9 100644 --- a/Engine/PyTracker.cpp +++ b/Engine/PyTracker.cpp @@ -44,21 +44,21 @@ Track::~Track() } void -Track::setScriptName(const std::string& scriptName) +Track::setScriptName(const QString& scriptName) { - _marker->setScriptName(scriptName); + _marker->setScriptName(scriptName.toStdString()); } -std::string +QString Track::getScriptName() const { - return _marker->getScriptName_mt_safe(); + return QString::fromUtf8(_marker->getScriptName_mt_safe().c_str()); } Param* -Track::getParam(const std::string& scriptName) const +Track::getParam(const QString& scriptName) const { - KnobPtr knob = _marker->getKnobByName(scriptName); + KnobPtr knob = _marker->getKnobByName(scriptName.toStdString()); if (!knob) { return 0; } @@ -84,9 +84,9 @@ Tracker::~Tracker() } Track* -Tracker::getTrackByName(const std::string& name) const +Tracker::getTrackByName(const QString& name) const { - TrackMarkerPtr t = _ctx->getMarkerByName(name); + TrackMarkerPtr t = _ctx->getMarkerByName(name.toStdString()); if (t) { return new Track(t); } else { diff --git a/Engine/PyTracker.h b/Engine/PyTracker.h index de0995fb73..ca551526b8 100644 --- a/Engine/PyTracker.h +++ b/Engine/PyTracker.h @@ -53,10 +53,10 @@ class Track return _marker; } - void setScriptName(const std::string& scriptName); - std::string getScriptName() const; + void setScriptName(const QString& scriptName); + QString getScriptName() const; - Param* getParam(const std::string& scriptName) const; + Param* getParam(const QString& scriptName) const; void reset(); @@ -73,7 +73,7 @@ class Tracker ~Tracker(); - Track* getTrackByName(const std::string& name) const; + Track* getTrackByName(const QString& name) const; void getAllTracks(std::list* markers) const; diff --git a/Engine/Pyside_Engine_Python.h b/Engine/Pyside_Engine_Python.h index b56352a4dc..c7c735de66 100644 --- a/Engine/Pyside_Engine_Python.h +++ b/Engine/Pyside_Engine_Python.h @@ -34,7 +34,7 @@ #define SBK_RUN #include - +#include //Global #include #include diff --git a/Engine/Settings.cpp b/Engine/Settings.cpp index ebac421c51..77e250bcaa 100644 --- a/Engine/Settings.cpp +++ b/Engine/Settings.cpp @@ -130,7 +130,9 @@ Settings::initializeKnobsGeneral() _natronSettingsExist->setSecretByDefault(true); _generalTab->addKnob(_natronSettingsExist); - + boost::shared_ptr softwareSep = AppManager::createKnob(this, NATRON_APPLICATION_NAME); + _generalTab->addKnob(softwareSep); + _checkForUpdates = AppManager::createKnob(this, "Always check for updates on start-up"); _checkForUpdates->setName("checkForUpdates"); _checkForUpdates->setAnimationEnabled(false); @@ -140,7 +142,7 @@ Settings::initializeKnobsGeneral() _enableCrashReports = AppManager::createKnob(this, "Enable crash reporting"); _enableCrashReports->setName("enableCrashReports"); _enableCrashReports->setAnimationEnabled(false); - _enableCrashReports->setHintToolTip("When checked, if " NATRON_APPLICATION_NAME "crashes a window will pop-up asking you " + _enableCrashReports->setHintToolTip("When checked, if " NATRON_APPLICATION_NAME " crashes a window will pop-up asking you " "whether you want to upload the crash dump to the developers or not. " "This can help them track down the bug.\n" "If you need to turn the crash reporting system off, uncheck this.\n" @@ -156,14 +158,6 @@ Settings::initializeKnobsGeneral() _generalTab->addKnob(_testCrashReportButton); - - _notifyOnFileChange = AppManager::createKnob(this, "Warn when a file changes externally"); - _notifyOnFileChange->setName("warnOnExternalChange"); - _notifyOnFileChange->setAnimationEnabled(false); - _notifyOnFileChange->setHintToolTip("When checked, if a file read from a file parameter changes externally, a warning will be displayed " - "on the viewer. Turning this off will suspend the notification system."); - _generalTab->addKnob(_notifyOnFileChange); - _autoSaveDelay = AppManager::createKnob(this, "Auto-save trigger delay"); _autoSaveDelay->setName("autoSaveDelay"); _autoSaveDelay->setAnimationEnabled(false); @@ -172,10 +166,10 @@ Settings::initializeKnobsGeneral() _autoSaveDelay->setMaximum(60); _autoSaveDelay->setAddNewLine(false); _autoSaveDelay->setHintToolTip("The number of seconds after an event that " NATRON_APPLICATION_NAME " should wait before " - " auto-saving. Note that if a render is in progress, " NATRON_APPLICATION_NAME " will " - " wait until it is done to actually auto-save."); + " auto-saving. Note that if a render is in progress, " NATRON_APPLICATION_NAME " will " + " wait until it is done to actually auto-save."); _generalTab->addKnob(_autoSaveDelay); - + _autoSaveUnSavedProjects = AppManager::createKnob(this, "Enable Auto-save for unsaved projects"); @@ -186,30 +180,123 @@ Settings::initializeKnobsGeneral() "Disabling this will no longer save un-saved project."); _generalTab->addKnob(_autoSaveUnSavedProjects); - _linearPickers = AppManager::createKnob(this, "Linear color pickers"); - _linearPickers->setName("linearPickers"); - _linearPickers->setAnimationEnabled(false); - _linearPickers->setHintToolTip("When activated, all colors picked from the color parameters are linearized " - "before being fetched. Otherwise they are in the same colorspace " - "as the viewer they were picked from."); - _generalTab->addKnob(_linearPickers); - _convertNaNValues = AppManager::createKnob(this, "Convert NaN values"); - _convertNaNValues->setName("convertNaNs"); - _convertNaNValues->setAnimationEnabled(false); - _convertNaNValues->setHintToolTip("When activated, any pixel that is a Not-a-Number will be converted to 1 to avoid potential crashes from " - "downstream nodes. These values can be produced by faulty plug-ins when they use wrong arithmetic such as " - "division by zero. Disabling this option will keep the NaN(s) in the buffers: this may lead to an " - "undefined behavior."); - _generalTab->addKnob(_convertNaNValues); - + _hostName = AppManager::createKnob(this, "Appear to plug-ins as"); + _hostName->setName("pluginHostName"); + _hostName->setHintToolTip(NATRON_APPLICATION_NAME " will appear with the name of the selected application to the OpenFX plug-ins. " + "Changing it to the name of another application can help loading plugins which " + "restrict their usage to specific OpenFX host(s). " + "If a Host is not listed here, use the \"Custom\" entry to enter a custom host name. Changing this requires " + "a restart of the application and requires clearing " + "the OpenFX plugins cache from the Cache menu."); + _knownHostNames.clear(); + std::vector visibleHostEntries,hostEntriesHelp; + assert(_knownHostNames.size() == (int)eKnownHostNameNatron); + _knownHostNames.push_back(NATRON_ORGANIZATION_DOMAIN_TOPLEVEL "." NATRON_ORGANIZATION_DOMAIN_SUB "." NATRON_APPLICATION_NAME); + visibleHostEntries.push_back(NATRON_APPLICATION_NAME); + assert(_knownHostNames.size() == (int)eKnownHostNameNuke); + _knownHostNames.push_back("uk.co.thefoundry.nuke"); + visibleHostEntries.push_back("Nuke"); + assert(_knownHostNames.size() == (int)eKnownHostNameFusion); + _knownHostNames.push_back("com.eyeonline.Fusion"); + visibleHostEntries.push_back("Fusion"); + assert(_knownHostNames.size() == (int)eKnownHostNameCatalyst); + _knownHostNames.push_back("com.sony.Catalyst.Edit"); + visibleHostEntries.push_back("Sony Catalyst Edit"); + assert(_knownHostNames.size() == (int)eKnownHostNameVegas); + _knownHostNames.push_back("com.sonycreativesoftware.vegas"); + visibleHostEntries.push_back("Sony Vegas"); + assert(_knownHostNames.size() == (int)eKnownHostNameToxik); + _knownHostNames.push_back("Autodesk Toxik"); + visibleHostEntries.push_back("Toxik"); + assert(_knownHostNames.size() == (int)eKnownHostNameScratch); + _knownHostNames.push_back("Assimilator"); + visibleHostEntries.push_back("Scratch"); + assert(_knownHostNames.size() == (int)eKnownHostNameDustBuster); + _knownHostNames.push_back("Dustbuster"); + visibleHostEntries.push_back("DustBuster"); + assert(_knownHostNames.size() == (int)eKnownHostNameResolve); + _knownHostNames.push_back("DaVinciResolve"); + visibleHostEntries.push_back("Da Vinci Resolve"); + assert(_knownHostNames.size() == (int)eKnownHostNameResolveLite); + _knownHostNames.push_back("DaVinciResolveLite"); + visibleHostEntries.push_back("Da Vinci Resolve Lite"); + assert(_knownHostNames.size() == (int)eKnownHostNameMistika); + _knownHostNames.push_back("Mistika"); + visibleHostEntries.push_back("SGO Mistika"); + assert(_knownHostNames.size() == (int)eKnownHostNamePablo); + _knownHostNames.push_back("com.quantel.genq"); + visibleHostEntries.push_back("Quantel Pablo Rio"); + assert(_knownHostNames.size() == (int)eKnownHostNameMotionStudio); + _knownHostNames.push_back("com.idtvision.MotionStudio"); + visibleHostEntries.push_back("IDT Motion Studio"); + assert(_knownHostNames.size() == (int)eKnownHostNameShake); + _knownHostNames.push_back("com.apple.shake"); + visibleHostEntries.push_back("Shake"); + assert(_knownHostNames.size() == (int)eKnownHostNameBaselight); + _knownHostNames.push_back("Baselight"); + visibleHostEntries.push_back("Baselight"); + assert(_knownHostNames.size() == (int)eKnownHostNameFrameCycler); + _knownHostNames.push_back("IRIDAS Framecycler"); + visibleHostEntries.push_back("FrameCycler"); + assert(_knownHostNames.size() == (int)eKnownHostNameNucoda); + _knownHostNames.push_back("Nucoda"); + visibleHostEntries.push_back("Nucoda Film Master"); + assert(_knownHostNames.size() == (int)eKnownHostNameAvidDS); + _knownHostNames.push_back("DS OFX HOST"); + visibleHostEntries.push_back("Avid DS"); + assert(_knownHostNames.size() == (int)eKnownHostNameDX); + _knownHostNames.push_back("com.chinadigitalvideo.dx"); + visibleHostEntries.push_back("China Digital Video DX"); + assert(_knownHostNames.size() == (int)eKnownHostNameTitlerPro); + _knownHostNames.push_back("com.newblue.titlerpro"); + visibleHostEntries.push_back("NewBlueFX Titler Pro"); + assert(_knownHostNames.size() == (int)eKnownHostNameNewBlueOFXBridge); + _knownHostNames.push_back("com.newblue.ofxbridge"); + visibleHostEntries.push_back("NewBlueFX OFX Bridge"); + assert(_knownHostNames.size() == (int)eKnownHostNameRamen); + _knownHostNames.push_back("Ramen"); + visibleHostEntries.push_back("Ramen"); + assert(_knownHostNames.size() == (int)eKnownHostNameTuttleOfx); + _knownHostNames.push_back("TuttleOfx"); + visibleHostEntries.push_back("TuttleOFX"); + + + assert(visibleHostEntries.size() == _knownHostNames.size()); + hostEntriesHelp = _knownHostNames; + + visibleHostEntries.push_back(NATRON_CUSTOM_HOST_NAME_ENTRY); + hostEntriesHelp.push_back("Custom host name"); + + _hostName->populateChoices(visibleHostEntries,hostEntriesHelp); + _hostName->setAnimationEnabled(false); + _hostName->setAddNewLine(false); + _generalTab->addKnob(_hostName); + + _customHostName = AppManager::createKnob(this, "Custom Host name"); + _customHostName->setName("customHostName"); + _customHostName->setHintToolTip("This is the name of the OpenFX host (application) as it appears to the OpenFX plugins. " + "Changing it to the name of another application can help loading some plugins which " + "restrict their usage to specific OpenFX hosts. You shoud leave " + "this to its default value, unless a specific plugin refuses to load or run. " + "Changing this takes effect upon the next application launch, and requires clearing " + "the OpenFX plugins cache from the Cache menu. " + "The default host name is: \n" + NATRON_ORGANIZATION_DOMAIN_TOPLEVEL "." NATRON_ORGANIZATION_DOMAIN_SUB "." NATRON_APPLICATION_NAME); + _customHostName->setAnimationEnabled(false); + _customHostName->setSecretByDefault(true); + _generalTab->addKnob(_customHostName); + + boost::shared_ptr sepThreading = AppManager::createKnob(this, "Threading"); + _generalTab->addKnob(sepThreading); + _numberOfThreads = AppManager::createKnob(this, "Number of render threads (0=\"guess\")"); _numberOfThreads->setName("noRenderThreads"); _numberOfThreads->setAnimationEnabled(false); - + QString numberOfThreadsToolTip = QString::fromUtf8("Controls how many threads " NATRON_APPLICATION_NAME " should use to render. \n" - "-1: Disable multithreading totally (useful for debugging) \n" - "0: Guess the thread count from the number of cores. The ideal threads count for this hardware is %1.").arg( QThread::idealThreadCount() ); + "-1: Disable multithreading totally (useful for debugging) \n" + "0: Guess the thread count from the number of cores. The ideal threads count for this hardware is %1.").arg( QThread::idealThreadCount() ); _numberOfThreads->setHintToolTip( numberOfThreadsToolTip.toStdString() ); _numberOfThreads->disableSlider(); _numberOfThreads->setMinimum(-1); @@ -220,10 +307,10 @@ Settings::initializeKnobsGeneral() _numberOfParallelRenders = AppManager::createKnob(this, "Number of parallel renders (0=\"guess\")"); _numberOfParallelRenders->setHintToolTip("Controls the number of parallel frame that will be rendered at the same time by the renderer." "A value of 0 indicate that " NATRON_APPLICATION_NAME " should automatically determine " - "the best number of parallel renders to launch given your CPU activity. " - "Setting a value different than 0 should be done only if you know what you're doing and can lead " - "in some situations to worse performances. Overall to get the best performances you should have your " - "CPU at 100% activity without idle times. "); + "the best number of parallel renders to launch given your CPU activity. " + "Setting a value different than 0 should be done only if you know what you're doing and can lead " + "in some situations to worse performances. Overall to get the best performances you should have your " + "CPU at 100% activity without idle times. "); _numberOfParallelRenders->setName("nParallelRenders"); _numberOfParallelRenders->setMinimum(0); _numberOfParallelRenders->disableSlider(); @@ -243,7 +330,7 @@ Settings::initializeKnobsGeneral() "make sure to uncheck this option first otherwise it will crash " NATRON_APPLICATION_NAME); _useThreadPool->setAnimationEnabled(false); _generalTab->addKnob(_useThreadPool); - + _nThreadsPerEffect = AppManager::createKnob(this, "Max threads usable per effect (0=\"guess\")"); _nThreadsPerEffect->setName("nThreadsPerEffect"); _nThreadsPerEffect->setAnimationEnabled(false); @@ -256,14 +343,14 @@ Settings::initializeKnobsGeneral() _nThreadsPerEffect->setMinimum(0); _nThreadsPerEffect->disableSlider(); _generalTab->addKnob(_nThreadsPerEffect); - + _renderInSeparateProcess = AppManager::createKnob(this, "Render in a separate process"); _renderInSeparateProcess->setName("renderNewProcess"); _renderInSeparateProcess->setAnimationEnabled(false); _renderInSeparateProcess->setHintToolTip("If true, " NATRON_APPLICATION_NAME " will render frames to disk in " - "a separate process so that if the main application crashes, the render goes on."); + "a separate process so that if the main application crashes, the render goes on."); _generalTab->addKnob(_renderInSeparateProcess); - + _queueRenders = AppManager::createKnob(this, "Append new renders to queue"); _queueRenders->setHintToolTip("When checked, renders will be queued in the Progress Panel and will start only when all " "other prior tasks are done."); @@ -271,14 +358,25 @@ Settings::initializeKnobsGeneral() _queueRenders->setName("queueRenders"); _generalTab->addKnob(_queueRenders); - _autoPreviewEnabledForNewProjects = AppManager::createKnob(this, "Auto-preview enabled by default for new projects"); - _autoPreviewEnabledForNewProjects->setName("enableAutoPreviewNewProjects"); - _autoPreviewEnabledForNewProjects->setAnimationEnabled(false); - _autoPreviewEnabledForNewProjects->setHintToolTip("If checked, then when creating a new project, the Auto-preview option" - " is enabled."); - _generalTab->addKnob(_autoPreviewEnabledForNewProjects); + + boost::shared_ptr sepMisc = AppManager::createKnob(this, "Misc."); + _generalTab->addKnob(sepMisc); + _notifyOnFileChange = AppManager::createKnob(this, "Warn when a file changes externally"); + _notifyOnFileChange->setName("warnOnExternalChange"); + _notifyOnFileChange->setAnimationEnabled(false); + _notifyOnFileChange->setHintToolTip("When checked, if a file read from a file parameter changes externally, a warning will be displayed " + "on the viewer. Turning this off will suspend the notification system."); + _generalTab->addKnob(_notifyOnFileChange); + + _filedialogForWriters = AppManager::createKnob(this, "Prompt with file dialog when creating Write node"); + _filedialogForWriters->setName("writeUseDialog"); + _filedialogForWriters->setDefaultValue(true); + _filedialogForWriters->setAnimationEnabled(false); + _filedialogForWriters->setHintToolTip("When checked, opens-up a file dialog when creating a Write node"); + _generalTab->addKnob(_filedialogForWriters); + _firstReadSetProjectFormat = AppManager::createKnob(this, "First image read set project format"); _firstReadSetProjectFormat->setName("autoProjectFormat"); _firstReadSetProjectFormat->setAnimationEnabled(false); @@ -286,6 +384,28 @@ Settings::initializeKnobsGeneral() "image size."); _generalTab->addKnob(_firstReadSetProjectFormat); + + + _convertNaNValues = AppManager::createKnob(this, "Convert NaN values"); + _convertNaNValues->setName("convertNaNs"); + _convertNaNValues->setAnimationEnabled(false); + _convertNaNValues->setHintToolTip("When activated, any pixel that is a Not-a-Number will be converted to 1 to avoid potential crashes from " + "downstream nodes. These values can be produced by faulty plug-ins when they use wrong arithmetic such as " + "division by zero. Disabling this option will keep the NaN(s) in the buffers: this may lead to an " + "undefined behavior."); + _generalTab->addKnob(_convertNaNValues); + + + + _autoPreviewEnabledForNewProjects = AppManager::createKnob(this, "Auto-preview enabled by default for new projects"); + _autoPreviewEnabledForNewProjects->setName("enableAutoPreviewNewProjects"); + _autoPreviewEnabledForNewProjects->setAnimationEnabled(false); + _autoPreviewEnabledForNewProjects->setHintToolTip("If checked, then when creating a new project, the Auto-preview option" + " is enabled."); + _generalTab->addKnob(_autoPreviewEnabledForNewProjects); + + + _fixPathsOnProjectPathChanged = AppManager::createKnob(this, "Auto fix relative file-paths"); _fixPathsOnProjectPathChanged->setAnimationEnabled(false); _fixPathsOnProjectPathChanged->setHintToolTip("If checked, when a project-path changes (either the name or the value pointed to), " @@ -293,6 +413,44 @@ Settings::initializeKnobsGeneral() _fixPathsOnProjectPathChanged->setName("autoFixRelativePaths"); _generalTab->addKnob(_fixPathsOnProjectPathChanged); + _renderOnEditingFinished = AppManager::createKnob(this, "Refresh viewer only when editing is finished"); + _renderOnEditingFinished->setName("renderOnEditingFinished"); + _renderOnEditingFinished->setHintToolTip("When checked, the viewer triggers a new render only when mouse is released when editing parameters, curves " + " or the timeline. This setting doesn't apply to roto splines editing."); + _renderOnEditingFinished->setAnimationEnabled(false); + _generalTab->addKnob(_renderOnEditingFinished); + + _activateRGBSupport = AppManager::createKnob(this, "RGB components support"); + _activateRGBSupport->setHintToolTip("When checked " NATRON_APPLICATION_NAME " is able to process images with only RGB components " + "(support for images with RGBA and Alpha components is always enabled). " + "Un-checking this option may prevent plugins that do not well support RGB components from crashing " NATRON_APPLICATION_NAME ". " + "Changing this option requires a restart of the application."); + _activateRGBSupport->setAnimationEnabled(false); + _activateRGBSupport->setName("rgbSupport"); + _generalTab->addKnob(_activateRGBSupport); + + + _activateTransformConcatenationSupport = AppManager::createKnob(this, "Transforms concatenation support"); + _activateTransformConcatenationSupport->setHintToolTip("When checked " NATRON_APPLICATION_NAME " is able to concatenate transform effects " + "when they are chained in the compositing tree. This yields better results and faster " + "render times because the image is only filtered once instead of as many times as there are " + "transformations."); + _activateTransformConcatenationSupport->setAnimationEnabled(false); + _activateTransformConcatenationSupport->setName("transformCatSupport"); + _generalTab->addKnob(_activateTransformConcatenationSupport); + + + boost::shared_ptr sepUI = AppManager::createKnob(this, "User Interface"); + _generalTab->addKnob(sepUI); + + _linearPickers = AppManager::createKnob(this, "Linear color pickers"); + _linearPickers->setName("linearPickers"); + _linearPickers->setAnimationEnabled(false); + _linearPickers->setHintToolTip("When activated, all colors picked from the color parameters are linearized " + "before being fetched. Otherwise they are in the same colorspace " + "as the viewer they were picked from."); + _generalTab->addKnob(_linearPickers); + _maxPanelsOpened = AppManager::createKnob(this, "Maximum number of open settings panels (0=\"unlimited\")"); _maxPanelsOpened->setName("maxPanels"); _maxPanelsOpened->setHintToolTip("This property holds the maximum number of settings panels that can be " @@ -330,137 +488,9 @@ Settings::initializeKnobsGeneral() _loadProjectsWorkspace->setAnimationEnabled(false); _generalTab->addKnob(_loadProjectsWorkspace); - _renderOnEditingFinished = AppManager::createKnob(this, "Refresh viewer only when editing is finished"); - _renderOnEditingFinished->setName("renderOnEditingFinished"); - _renderOnEditingFinished->setHintToolTip("When checked, the viewer triggers a new render only when mouse is released when editing parameters, curves " - " or the timeline. This setting doesn't apply to roto splines editing."); - _renderOnEditingFinished->setAnimationEnabled(false); - _generalTab->addKnob(_renderOnEditingFinished); - _activateRGBSupport = AppManager::createKnob(this, "RGB components support"); - _activateRGBSupport->setHintToolTip("When checked " NATRON_APPLICATION_NAME " is able to process images with only RGB components " - "(support for images with RGBA and Alpha components is always enabled). " - "Un-checking this option may prevent plugins that do not well support RGB components from crashing " NATRON_APPLICATION_NAME ". " - "Changing this option requires a restart of the application."); - _activateRGBSupport->setAnimationEnabled(false); - _activateRGBSupport->setName("rgbSupport"); - _generalTab->addKnob(_activateRGBSupport); - - - _activateTransformConcatenationSupport = AppManager::createKnob(this, "Transforms concatenation support"); - _activateTransformConcatenationSupport->setHintToolTip("When checked " NATRON_APPLICATION_NAME " is able to concatenate transform effects " - "when they are chained in the compositing tree. This yields better results and faster " - "render times because the image is only filtered once instead of as many times as there are " - "transformations."); - _activateTransformConcatenationSupport->setAnimationEnabled(false); - _activateTransformConcatenationSupport->setName("transformCatSupport"); - _generalTab->addKnob(_activateTransformConcatenationSupport); - _hostName = AppManager::createKnob(this, "Appear to plug-ins as"); - _hostName->setName("pluginHostName"); - _hostName->setHintToolTip(NATRON_APPLICATION_NAME " will appear with the name of the selected application to the OpenFX plug-ins. " - "Changing it to the name of another application can help loading plugins which " - "restrict their usage to specific OpenFX host(s). " - "If a Host is not listed here, use the \"Custom\" entry to enter a custom host name. Changing this requires " - "a restart of the application and requires clearing " - "the OpenFX plugins cache from the Cache menu."); - _knownHostNames.clear(); - std::vector visibleHostEntries,hostEntriesHelp; - assert(_knownHostNames.size() == (int)eKnownHostNameNatron); - _knownHostNames.push_back(NATRON_ORGANIZATION_DOMAIN_TOPLEVEL "." NATRON_ORGANIZATION_DOMAIN_SUB "." NATRON_APPLICATION_NAME); - visibleHostEntries.push_back(NATRON_APPLICATION_NAME); - assert(_knownHostNames.size() == (int)eKnownHostNameNuke); - _knownHostNames.push_back("uk.co.thefoundry.nuke"); - visibleHostEntries.push_back("Nuke"); - assert(_knownHostNames.size() == (int)eKnownHostNameFusion); - _knownHostNames.push_back("com.eyeonline.Fusion"); - visibleHostEntries.push_back("Fusion"); - assert(_knownHostNames.size() == (int)eKnownHostNameCatalyst); - _knownHostNames.push_back("com.sony.Catalyst.Edit"); - visibleHostEntries.push_back("Sony Catalyst Edit"); - assert(_knownHostNames.size() == (int)eKnownHostNameVegas); - _knownHostNames.push_back("com.sonycreativesoftware.vegas"); - visibleHostEntries.push_back("Sony Vegas"); - assert(_knownHostNames.size() == (int)eKnownHostNameToxik); - _knownHostNames.push_back("Autodesk Toxik"); - visibleHostEntries.push_back("Toxik"); - assert(_knownHostNames.size() == (int)eKnownHostNameScratch); - _knownHostNames.push_back("Assimilator"); - visibleHostEntries.push_back("Scratch"); - assert(_knownHostNames.size() == (int)eKnownHostNameDustBuster); - _knownHostNames.push_back("Dustbuster"); - visibleHostEntries.push_back("DustBuster"); - assert(_knownHostNames.size() == (int)eKnownHostNameResolve); - _knownHostNames.push_back("DaVinciResolve"); - visibleHostEntries.push_back("Da Vinci Resolve"); - assert(_knownHostNames.size() == (int)eKnownHostNameResolveLite); - _knownHostNames.push_back("DaVinciResolveLite"); - visibleHostEntries.push_back("Da Vinci Resolve Lite"); - assert(_knownHostNames.size() == (int)eKnownHostNameMistika); - _knownHostNames.push_back("Mistika"); - visibleHostEntries.push_back("SGO Mistika"); - assert(_knownHostNames.size() == (int)eKnownHostNamePablo); - _knownHostNames.push_back("com.quantel.genq"); - visibleHostEntries.push_back("Quantel Pablo Rio"); - assert(_knownHostNames.size() == (int)eKnownHostNameMotionStudio); - _knownHostNames.push_back("com.idtvision.MotionStudio"); - visibleHostEntries.push_back("IDT Motion Studio"); - assert(_knownHostNames.size() == (int)eKnownHostNameShake); - _knownHostNames.push_back("com.apple.shake"); - visibleHostEntries.push_back("Shake"); - assert(_knownHostNames.size() == (int)eKnownHostNameBaselight); - _knownHostNames.push_back("Baselight"); - visibleHostEntries.push_back("Baselight"); - assert(_knownHostNames.size() == (int)eKnownHostNameFrameCycler); - _knownHostNames.push_back("IRIDAS Framecycler"); - visibleHostEntries.push_back("FrameCycler"); - assert(_knownHostNames.size() == (int)eKnownHostNameNucoda); - _knownHostNames.push_back("Nucoda"); - visibleHostEntries.push_back("Nucoda Film Master"); - assert(_knownHostNames.size() == (int)eKnownHostNameAvidDS); - _knownHostNames.push_back("DS OFX HOST"); - visibleHostEntries.push_back("Avid DS"); - assert(_knownHostNames.size() == (int)eKnownHostNameDX); - _knownHostNames.push_back("com.chinadigitalvideo.dx"); - visibleHostEntries.push_back("China Digital Video DX"); - assert(_knownHostNames.size() == (int)eKnownHostNameTitlerPro); - _knownHostNames.push_back("com.newblue.titlerpro"); - visibleHostEntries.push_back("NewBlueFX Titler Pro"); - assert(_knownHostNames.size() == (int)eKnownHostNameNewBlueOFXBridge); - _knownHostNames.push_back("com.newblue.ofxbridge"); - visibleHostEntries.push_back("NewBlueFX OFX Bridge"); - assert(_knownHostNames.size() == (int)eKnownHostNameRamen); - _knownHostNames.push_back("Ramen"); - visibleHostEntries.push_back("Ramen"); - assert(_knownHostNames.size() == (int)eKnownHostNameTuttleOfx); - _knownHostNames.push_back("TuttleOfx"); - visibleHostEntries.push_back("TuttleOFX"); - - assert(visibleHostEntries.size() == _knownHostNames.size()); - hostEntriesHelp = _knownHostNames; - - visibleHostEntries.push_back(NATRON_CUSTOM_HOST_NAME_ENTRY); - hostEntriesHelp.push_back("Custom host name"); - - _hostName->populateChoices(visibleHostEntries,hostEntriesHelp); - _hostName->setAnimationEnabled(false); - _hostName->setAddNewLine(false); - _generalTab->addKnob(_hostName); - - _customHostName = AppManager::createKnob(this, "Custom Host name"); - _customHostName->setName("customHostName"); - _customHostName->setHintToolTip("This is the name of the OpenFX host (application) as it appears to the OpenFX plugins. " - "Changing it to the name of another application can help loading some plugins which " - "restrict their usage to specific OpenFX hosts. You shoud leave " - "this to its default value, unless a specific plugin refuses to load or run. " - "Changing this takes effect upon the next application launch, and requires clearing " - "the OpenFX plugins cache from the Cache menu. " - "The default host name is: \n" - NATRON_ORGANIZATION_DOMAIN_TOPLEVEL "." NATRON_ORGANIZATION_DOMAIN_SUB "." NATRON_APPLICATION_NAME); - _customHostName->setAnimationEnabled(false); - _customHostName->setSecretByDefault(true); - _generalTab->addKnob(_customHostName); } void @@ -672,6 +702,19 @@ Settings::initializeKnobsAppearance() _dopeSheetEditorColors->addKnob(_dopeSheetEditorGridColor); + _scriptEditorFontChoice = AppManager::createKnob(this, "Font"); + _scriptEditorFontChoice->setHintToolTip("List of all fonts available on your system"); + _scriptEditorFontChoice->setName("scriptEditorFont"); + _scriptEditorFontChoice->setAddNewLine(false); + _scriptEditorFontChoice->setAnimationEnabled(false); + _scriptEditorColors->addKnob(_scriptEditorFontChoice); + + _scriptEditorFontSize = AppManager::createKnob(this, "Font Size"); + _scriptEditorFontSize->setHintToolTip("The font size"); + _scriptEditorFontSize->setName("scriptEditorFontSize"); + _scriptEditorFontSize->setAnimationEnabled(false); + _scriptEditorColors->addKnob(_scriptEditorFontSize); + _curLineColor = AppManager::createKnob(this, "Current Line Color", 3); _curLineColor->setName("currentLineColor"); _curLineColor->setAnimationEnabled(false); @@ -1448,7 +1491,7 @@ Settings::setDefaultValues() setCachingLabels(); _autoTurbo->setDefaultValue(false); _usePluginIconsInNodeGraph->setDefaultValue(true); - _useAntiAliasing->setDefaultValue(false); + _useAntiAliasing->setDefaultValue(true); _defaultNodeColor->setDefaultValue(0.7,0); _defaultNodeColor->setDefaultValue(0.7,1); _defaultNodeColor->setDefaultValue(0.7,2); @@ -1645,6 +1688,9 @@ Settings::setDefaultValues() _curLineColor->setDefaultValue(0.35,0); _curLineColor->setDefaultValue(0.35,1); _curLineColor->setDefaultValue(0.35,2); + + _scriptEditorFontChoice->setDefaultValue(0); + _scriptEditorFontSize->setDefaultValue(NATRON_FONT_SIZE_DEFAULT); endChanges(); } // setDefaultValues @@ -2147,6 +2193,8 @@ Settings::onKnobValueChanged(KnobI* k, if (reply == eStandardButtonYes) { crash_application(); } + } else if (k == _scriptEditorFontChoice.get() || k == _scriptEditorFontSize.get()) { + appPTR->reloadScriptEditorFonts(); } if ((k == _hostName.get() || k == _customHostName.get()) && !_restoringSettings) { Dialogs::warningDialog(tr("Host-name change").toStdString(), tr("Changing this requires a restart of " NATRON_APPLICATION_NAME @@ -2574,21 +2622,37 @@ void Settings::populateSystemFonts(const QSettings& settings,const std::vector& fonts) { _systemFontChoice->populateChoices(fonts); - + _scriptEditorFontChoice->populateChoices(fonts); for (U32 i = 0; i < fonts.size(); ++i) { if (fonts[i] == NATRON_FONT) { _systemFontChoice->setDefaultValue(i); - break; + } + if (fonts[i] == NATRON_SCRIPT_FONT) { + _scriptEditorFontChoice->setDefaultValue(i); } } ///Now restore properly the system font choice - QString name = QString::fromUtf8(_systemFontChoice->getName().c_str()); - if (settings.contains(name)) { - std::string value = settings.value(name).toString().toStdString(); - for (U32 i = 0; i < fonts.size(); ++i) { - if (fonts[i] == value) { - _systemFontChoice->setValue(i); - break; + { + QString name = QString::fromUtf8(_systemFontChoice->getName().c_str()); + if (settings.contains(name)) { + std::string value = settings.value(name).toString().toStdString(); + for (U32 i = 0; i < fonts.size(); ++i) { + if (fonts[i] == value) { + _systemFontChoice->setValue(i); + break; + } + } + } + } + { + QString name = QString::fromUtf8(_scriptEditorFontChoice->getName().c_str()); + if (settings.contains(name)) { + std::string value = settings.value(name).toString().toStdString(); + for (U32 i = 0; i < fonts.size(); ++i) { + if (fonts[i] == value) { + _scriptEditorFontChoice->setValue(i); + break; + } } } } @@ -3178,6 +3242,7 @@ void Settings::getPythonGroupsSearchPaths(std::list* templates) const { _templatesPluginPaths->getPaths(templates); + } void @@ -3511,6 +3576,18 @@ Settings::getSECurLineColor(double* r,double* g, double* b) const *b = _curLineColor->getValue(2); } +int +Settings::getSEFontSize() const +{ + return _scriptEditorFontSize->getValue(); +} + +std::string +Settings::getSEFontFamily() const +{ + return _scriptEditorFontChoice->getActiveEntryText_mt_safe(); +} + void Settings::getPluginIconFrameColor(int *r, int *g, int *b) const { @@ -3610,6 +3687,12 @@ Settings::isRenderQueuingEnabled() const return _queueRenders->getValue(); } +bool +Settings::isFileDialogEnabledForNewWriters() const +{ + return _filedialogForWriters->getValue(); +} + NATRON_NAMESPACE_EXIT; NATRON_NAMESPACE_USING; diff --git a/Engine/Settings.h b/Engine/Settings.h index 32f45eb11a..1cbc73d4fa 100644 --- a/Engine/Settings.h +++ b/Engine/Settings.h @@ -275,6 +275,8 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON void setAutoTurboModeEnabled(bool e); + bool isFileDialogEnabledForNewWriters() const; + void setOptionalInputsAutoHidden(bool hidden); bool areOptionalInputsAutoHidden() const; @@ -336,6 +338,9 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON void getSENumbersColor(double* r,double* g, double* b) const; void getSECurLineColor(double* r,double* g, double* b) const; + int getSEFontSize() const; + std::string getSEFontFamily() const; + void getPluginIconFrameColor(int *r, int *g, int *b) const; int getDopeSheetEditorNodeSeparationWith() const; @@ -383,34 +388,42 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON boost::shared_ptr _generalTab; boost::shared_ptr _natronSettingsExist; + + // Natron boost::shared_ptr _checkForUpdates; boost::shared_ptr _enableCrashReports; boost::shared_ptr _testCrashReportButton; - boost::shared_ptr _notifyOnFileChange; boost::shared_ptr _autoSaveUnSavedProjects; boost::shared_ptr _autoSaveDelay; - boost::shared_ptr _linearPickers; - boost::shared_ptr _convertNaNValues; + boost::shared_ptr _hostName; + boost::shared_ptr _customHostName; + + // Threading boost::shared_ptr _numberOfThreads; boost::shared_ptr _numberOfParallelRenders; boost::shared_ptr _useThreadPool; boost::shared_ptr _nThreadsPerEffect; boost::shared_ptr _renderInSeparateProcess; boost::shared_ptr _queueRenders; - boost::shared_ptr _autoPreviewEnabledForNewProjects; + + // Misc + boost::shared_ptr _notifyOnFileChange; + boost::shared_ptr _filedialogForWriters; boost::shared_ptr _firstReadSetProjectFormat; + boost::shared_ptr _convertNaNValues; + boost::shared_ptr _autoPreviewEnabledForNewProjects; boost::shared_ptr _fixPathsOnProjectPathChanged; + boost::shared_ptr _renderOnEditingFinished; + boost::shared_ptr _activateRGBSupport; + boost::shared_ptr _activateTransformConcatenationSupport; + + // User Interface + boost::shared_ptr _linearPickers; boost::shared_ptr _maxPanelsOpened; boost::shared_ptr _useCursorPositionIncrements; boost::shared_ptr _defaultLayoutFile; boost::shared_ptr _loadProjectsWorkspace; - boost::shared_ptr _renderOnEditingFinished; - boost::shared_ptr _activateRGBSupport; - boost::shared_ptr _activateTransformConcatenationSupport; - boost::shared_ptr _hostName; - boost::shared_ptr _customHostName; - - + boost::shared_ptr _ocioConfigKnob; boost::shared_ptr _warnOcioConfigKnobChanged; @@ -548,6 +561,8 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON boost::shared_ptr _commentsColor; boost::shared_ptr _selfColor; boost::shared_ptr _numbersColor; + boost::shared_ptr _scriptEditorFontChoice; + boost::shared_ptr _scriptEditorFontSize; struct PerPluginKnobs diff --git a/Engine/TrackMarker.cpp b/Engine/TrackMarker.cpp index c51764beba..fe0314e31f 100644 --- a/Engine/TrackMarker.cpp +++ b/Engine/TrackMarker.cpp @@ -799,7 +799,7 @@ TrackMarker::getMarkerImage(int time, const RectI& roi) const } void -TrackMarker::onKnobSlaved(KnobI* slave,KnobI* master, +TrackMarker::onKnobSlaved(const KnobPtr& slave,const KnobPtr& master, int dimension, bool isSlave) { diff --git a/Engine/TrackMarker.h b/Engine/TrackMarker.h index 44e6ba2c25..33778c7b2f 100644 --- a/Engine/TrackMarker.h +++ b/Engine/TrackMarker.h @@ -164,7 +164,7 @@ class TrackMarker : public NamedKnobHolder, public boost::enable_shared_from_thi RectI getMarkerImageRoI(int time) const; - virtual void onKnobSlaved(KnobI* slave,KnobI* master, + virtual void onKnobSlaved(const KnobPtr& slave,const KnobPtr& master, int dimension, bool isSlave) OVERRIDE FINAL; diff --git a/Engine/ViewerInstance.cpp b/Engine/ViewerInstance.cpp index 6f2515c3de..ec7524fa25 100644 --- a/Engine/ViewerInstance.cpp +++ b/Engine/ViewerInstance.cpp @@ -2422,7 +2422,26 @@ ViewerInstance::interpolateGammaLut(float value) void ViewerInstance::markAllOnGoingRendersAsAborted() { - _imp->markAllRendersAsAborted(); + + //Do not abort the oldest render while scrubbing timeline or sliders so that the user gets some feedback + bool keepOldest = getApp()->isDraftRenderEnabled(); + + QMutexLocker k(&_imp->renderAgeMutex); + for (int i = 0; i < 2; ++i) { + if (_imp->currentRenderAges[i].empty()) { + continue; + } + + //Do not abort the oldest render, let it finish + OnGoingRenders::iterator it = _imp->currentRenderAges[i].begin(); + if (keepOldest) { + ++it; + } + + for (;it != _imp->currentRenderAges[i].end(); ++it) { + (*it)->aborted = 1; + } + } } template @@ -3198,6 +3217,9 @@ ViewerInstance::refreshActiveInputs(int inputNbChanged) } else { _imp->activeInputs[0] = inputNbChanged; + if (_imp->activeInputs[1] == -1) { + _imp->activeInputs[1] = inputNbChanged; + } } } } diff --git a/Engine/ViewerInstancePrivate.h b/Engine/ViewerInstancePrivate.h index 4a653b6645..1c08354cd6 100644 --- a/Engine/ViewerInstancePrivate.h +++ b/Engine/ViewerInstancePrivate.h @@ -248,25 +248,6 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON } - void - markAllRendersAsAborted() - { - QMutexLocker k(&renderAgeMutex); - for (int i = 0; i < 2; ++i) { - if (currentRenderAges[i].empty()) { - continue; - } - - //Do not abort the oldest render, let it finish - OnGoingRenders::iterator it = currentRenderAges[i].begin(); - ++it; - - for (;it != currentRenderAges[i].end(); ++it) { - (*it)->aborted = 1; - } - } - } - /** * @brief To be called to check if there we are the last requested render (true) or if there were * more recent requests (false). diff --git a/Engine/WriteNode.cpp b/Engine/WriteNode.cpp index d5e61199cc..81fa44d0e8 100644 --- a/Engine/WriteNode.cpp +++ b/Engine/WriteNode.cpp @@ -846,7 +846,10 @@ WriteNode::onEffectCreated(bool mayCreateFileDialog, const std::listsaveImageFileDialog(); + bool useDialogForWriters = appPTR->getCurrentSettings()->isFileDialogEnabledForNewWriters(); + if (useDialogForWriters) { + pattern = getApp()->saveImageFileDialog(); + } //The user selected a file, if it fails to read do not create the node throwErrors = true; diff --git a/Engine/typesystem_engine.xml b/Engine/typesystem_engine.xml index daac358978..71d4132fc3 100644 --- a/Engine/typesystem_engine.xml +++ b/Engine/typesystem_engine.xml @@ -37,8 +37,69 @@ - - + + + + return PyUnicode_FromString(%in.c_str()); + + + + std::string %out; + + if (PyString_Check(%in)) { + char* buf = PyString_AsString(obj); + if (buf) { + %out += std::string(buf); + } + } else if (PyUnicode_Check(%in)) { + /*PyObject * temp_bytes = PyUnicode_AsEncodedString(%in, "ASCII", "strict"); // Owned reference + if (temp_bytes != NULL) { + char* cstr = PyBytes_AS_STRING(temp_bytes); // Borrowed pointer + %out.append(cstr); + Py_DECREF(temp_bytes); + }*/ + PyObject* utf8pyobj = PyUnicode_AsUTF8String(%in); // newRef + if (utf8pyobj) { + char* cstr = PyBytes_AS_STRING(utf8pyobj); // Borrowed pointer + %out.append(cstr); + Py_DECREF(utf8pyobj); + } + } else if (PyBytes_Check(%in)) { + char* cstr = PyBytes_AS_STRING(%in); // Borrowed pointer + %out.append(cstr); + } + return %out; + + + std::string %out; + + if (PyString_Check(%in)) { + char* buf = PyString_AsString(obj); + if (buf) { + %out += std::string(buf); + } + } else if (PyUnicode_Check(%in)) { + /*PyObject * temp_bytes = PyUnicode_AsEncodedString(%in, "ASCII", "strict"); // Owned reference + if (temp_bytes != NULL) { + char* cstr = PyBytes_AS_STRING(temp_bytes); // Borrowed pointer + %out.append(cstr); + Py_DECREF(temp_bytes); + }*/ + PyObject* utf8pyobj = PyUnicode_AsUTF8String(%in); // newRef + if (utf8pyobj) { + char* cstr = PyBytes_AS_STRING(utf8pyobj); // Borrowed pointer + %out.append(cstr); + Py_DECREF(utf8pyobj); + } + } else if (PyBytes_Check(%in)) { + char* cstr = PyBytes_AS_STRING(%in); // Borrowed pointer + %out.append(cstr); + } + return %out; + + + + @@ -313,7 +374,7 @@ :doc:`App` which represents an instance of Natron, or more specifically an opened project. :doc:`Effect` which represents a node in the nodegraph. - + @@ -336,7 +397,7 @@ - + @@ -345,7 +406,7 @@ %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0); - + @@ -354,7 +415,7 @@ %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0); - + @@ -363,7 +424,7 @@ %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0); - + @@ -427,7 +488,7 @@ %CPPSELF.%FUNCTION_NAME(effects,firstFrames,lastFrames, frameSteps); - + @@ -448,92 +509,92 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -560,7 +621,7 @@ - + @@ -584,12 +645,12 @@ %CPPSELF.%FUNCTION_NAME(%1); - + %CPPSELF.%FUNCTION_NAME(%1); - + %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%1); %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0); @@ -660,9 +721,9 @@ - @@ -725,7 +786,7 @@ - + @@ -756,7 +817,7 @@ - + %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%1,%2,%3); %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0); @@ -1057,13 +1118,13 @@ - + %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%1); %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0); - + %CPPSELF.%FUNCTION_NAME(%1); @@ -1139,7 +1200,7 @@ - + @@ -1147,7 +1208,7 @@ - + @@ -1202,7 +1263,7 @@ - + diff --git a/Global/Macros.h b/Global/Macros.h index be84595f7b..8bb1b32df5 100644 --- a/Global/Macros.h +++ b/Global/Macros.h @@ -94,11 +94,6 @@ namespace NATRON_PYTHON_NAMESPACE { } #define NATRON_ENGINE_PYTHON_MODULE_NAME "NatronEngine" #define NATRON_GUI_PYTHON_MODULE_NAME "NatronGui" -#define NATRON_ENV_VAR_NAME_START_TAG "" -#define NATRON_ENV_VAR_NAME_END_TAG "" -#define NATRON_ENV_VAR_VALUE_START_TAG "" -#define NATRON_ENV_VAR_VALUE_END_TAG "" - #define NATRON_PROJECT_ENV_VAR_MAX_RECURSION 100 #define NATRON_MAX_CACHE_FILES_OPENED 20000 #define NATRON_CUSTOM_HTML_TAG_START "<" NATRON_APPLICATION_NAME ">" diff --git a/Gui/AddKnobDialog.cpp b/Gui/AddKnobDialog.cpp index f49e3ce686..6fccb391f7 100644 --- a/Gui/AddKnobDialog.cpp +++ b/Gui/AddKnobDialog.cpp @@ -1809,7 +1809,7 @@ AddKnobDialog::onOkClicked() try { for (std::size_t i = 0 ; i < expressions.size(); ++i) { if (!expressions[i].first.empty()) { - _imp->knob->setExpression(i, expressions[i].first, expressions[i].second); + _imp->knob->setExpression(i, expressions[i].first, expressions[i].second, false); } } } catch (...) { @@ -1933,7 +1933,7 @@ AddKnobDialog::onOkClicked() } else { expr = it->second[i].first; } - it->first->setExpression(i, expr, it->second[i].second); + it->first->setExpression(i, expr, it->second[i].second, false); } catch (...) { } diff --git a/Gui/ComboBox.cpp b/Gui/ComboBox.cpp index faa58fe733..492e35dc2c 100644 --- a/Gui/ComboBox.cpp +++ b/Gui/ComboBox.cpp @@ -86,7 +86,7 @@ ComboBox::ComboBox(QWidget* parent) , _altered(false) , _cascading(false) , _cascadingIndex(0) - , _currentIndex(0) + , _currentIndex(-1) , _currentText() , _separators() , _rootNode(new ComboBoxMenuNode()) @@ -345,7 +345,12 @@ ComboBox::paintEvent(QPaintEvent* /*e*/) int flags = align | Qt::TextForceLeftToRight; ///Draw the text - QPen pen; + QPen pen = p.pen(); + if (_currentIndex == -1) { + QFont f = p.font(); + f.setItalic(true); + p.setFont(f); + } pen.setColor(textColor); p.setPen(pen); @@ -577,6 +582,9 @@ ComboBox::addItem(const QString & item, QKeySequence key, const QString & toolTip) { + if (item.isEmpty()) { + return; + } if (!_cascading) { QAction* action = new QAction(this); @@ -701,7 +709,7 @@ ComboBox::setCurrentText_internal(const QString & text) } int ret = -1; - if ( (_currentIndex != index) && (index != -1) ) { + if (_currentIndex != index) { _currentIndex = index; ret = index; } @@ -773,6 +781,9 @@ static QString getNodeTextRecursive(ComboBoxMenuNode* node,ComboBoxMenuNode* roo QString ComboBox::getCurrentIndexText() const { + if (_currentIndex == -1) { + return _currentText; + } ComboBoxMenuNode* node = getCurrentIndexNode(_currentIndex, _rootNode.get()); if (!node) { return QString(); @@ -931,7 +942,7 @@ ComboBox::clear() _rootNode->isMenu->clear(); _cascadingIndex = 0; _separators.clear(); - _currentIndex = 0; + _currentIndex = -1; updateLabel(); } diff --git a/Gui/ComboBox.h b/Gui/ComboBox.h index 7562001324..399e4fbdcb 100644 --- a/Gui/ComboBox.h +++ b/Gui/ComboBox.h @@ -107,6 +107,11 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON { _cascading = cascading; } + + bool isCascading() const + { + return _cascading; + } /*Insert a new item BEFORE the specified index.*/ void insertItem( int index,const QString &item,QIcon icon = QIcon(),QKeySequence = QKeySequence(),const QString & toolTip = QString() ); diff --git a/Gui/CurveWidget.cpp b/Gui/CurveWidget.cpp index 698634ac18..8a05916c02 100644 --- a/Gui/CurveWidget.cpp +++ b/Gui/CurveWidget.cpp @@ -1756,9 +1756,9 @@ CurveWidget::loopSelectedCurve() throw std::logic_error("CurveWidget::loopSelectedCurve"); } NATRON_PYTHON_NAMESPACE::PyModalDialog dialog(_imp->_gui); - boost::shared_ptr firstFrame(dialog.createIntParam("firstFrame", "First frame")); + boost::shared_ptr firstFrame(dialog.createIntParam(QString::fromUtf8("firstFrame"), QString::fromUtf8("First frame"))); firstFrame->setAnimationEnabled(false); - boost::shared_ptr lastFrame(dialog.createIntParam("lastFrame", "Last frame")); + boost::shared_ptr lastFrame(dialog.createIntParam(QString::fromUtf8("lastFrame"), QString::fromUtf8("Last frame"))); lastFrame->setAnimationEnabled(false); dialog.refreshUserParamsGUI(); if (dialog.exec()) { diff --git a/Gui/DockablePanelPrivate.cpp b/Gui/DockablePanelPrivate.cpp index baf61dd819..45befe2546 100644 --- a/Gui/DockablePanelPrivate.cpp +++ b/Gui/DockablePanelPrivate.cpp @@ -606,7 +606,7 @@ DockablePanelPrivate::findKnobGuiOrCreate(const KnobPtr & knob, ///Create the label if needed KnobClickableLabel* label = 0; - + Label* warningLabel = 0; std::string descriptionLabel; KnobString* isStringKnob = dynamic_cast(knob.get()); bool isLabelKnob = isStringKnob && isStringKnob->isLabel(); @@ -630,17 +630,24 @@ DockablePanelPrivate::findKnobGuiOrCreate(const KnobPtr & knob, } label = new KnobClickableLabel(QString(), ret, page->second.tab); + warningLabel = new Label(page->second.tab); + warningLabel->setVisible(false); + QFontMetrics fm(label->font(),0); + int pixSize = fm.height(); + QPixmap stdErrorPix; + stdErrorPix = getStandardIcon(QMessageBox::Critical, pixSize, label); + warningLabel->setPixmap(stdErrorPix); + bool pixmapSet = false; if (!labelIconFilePath.empty()) { QPixmap pix; - QFontMetrics fm(label->font(),0); - int pixSize = fm.height(); + if (labelIconFilePath == "dialog-warning") { pix = getStandardIcon(QMessageBox::Warning, pixSize, label); } else if (labelIconFilePath == "dialog-question") { pix = getStandardIcon(QMessageBox::Question, pixSize, label); } else if (labelIconFilePath == "dialog-error") { - pix = getStandardIcon(QMessageBox::Critical, pixSize, label); + pix = stdErrorPix; } else if (labelIconFilePath == "dialog-information") { pix = getStandardIcon(QMessageBox::Information, pixSize, label); } else { @@ -666,6 +673,7 @@ DockablePanelPrivate::findKnobGuiOrCreate(const KnobPtr & knob, if (makeNewLine) { + labelLayout->addWidget(warningLabel); labelLayout->addWidget(label); } @@ -725,7 +733,7 @@ DockablePanelPrivate::findKnobGuiOrCreate(const KnobPtr & knob, } ///fill the fieldLayout with the widgets - ret->createGUI(layout,fieldContainer, labelContainer, label,fieldLayout,makeNewLine,knobsOnSameLine); + ret->createGUI(layout,fieldContainer, labelContainer, label, warningLabel, fieldLayout,makeNewLine,knobsOnSameLine); ret->setEnabledSlot(); diff --git a/Gui/EditScriptDialog.cpp b/Gui/EditScriptDialog.cpp index 28a2cfd397..ba43928c18 100644 --- a/Gui/EditScriptDialog.cpp +++ b/Gui/EditScriptDialog.cpp @@ -146,7 +146,6 @@ EditScriptDialog::create(const QString& initialScript,bool makeUseRetButton) { setTitle(); - QFont font(appFont,appFontSize); _imp->mainLayout = new QVBoxLayout(this); QStringList modules; @@ -172,14 +171,11 @@ EditScriptDialog::create(const QString& initialScript,bool makeUseRetButton) } _imp->expressionLabel = new Label(labelHtml,this); - //_imp->expressionLabel->setFont(font); _imp->mainLayout->addWidget(_imp->expressionLabel); _imp->expressionEdit = new InputScriptTextEdit(_imp->gui,this); _imp->expressionEdit->setAcceptDrops(true); _imp->expressionEdit->setMouseTracking(true); - QFontMetrics fm = _imp->expressionEdit->fontMetrics(); - _imp->expressionEdit->setTabStopWidth(4 * fm.width(QLatin1Char(' '))); _imp->mainLayout->addWidget(_imp->expressionEdit); _imp->expressionEdit->setPlainText(initialScript); @@ -214,7 +210,6 @@ EditScriptDialog::create(const QString& initialScript,bool makeUseRetButton) _imp->mainLayout->addWidget(_imp->midButtonsContainer); _imp->resultLabel = new Label(tr("Result:"),this); - //_imp->resultLabel->setFont(font); _imp->mainLayout->addWidget(_imp->resultLabel); _imp->resultEdit = new OutputScriptTextEdit(this); @@ -232,6 +227,16 @@ EditScriptDialog::create(const QString& initialScript,bool makeUseRetButton) } QObject::connect(_imp->expressionEdit, SIGNAL(textChanged()), this, SLOT(onTextEditChanged())); _imp->expressionEdit->setFocus(); + + QString fontFamily = QString::fromUtf8(appPTR->getCurrentSettings()->getSEFontFamily().c_str()); + int fontSize = appPTR->getCurrentSettings()->getSEFontSize(); + QFont font(fontFamily, fontSize); + if (font.exactMatch()) { + _imp->expressionEdit->setFont(font); + _imp->resultEdit->setFont(font); + } + QFontMetrics fm = _imp->expressionEdit->fontMetrics(); + _imp->expressionEdit->setTabStopWidth(4 * fm.width(QLatin1Char(' '))); } diff --git a/Gui/Gui.cpp b/Gui/Gui.cpp index 189dc93f25..3c4961820a 100644 --- a/Gui/Gui.cpp +++ b/Gui/Gui.cpp @@ -101,6 +101,7 @@ Gui::Gui(GuiAppInstance* app, QObject::connect(qApp, SIGNAL(focusChanged(QWidget*,QWidget*)), this, SLOT(onFocusChanged(QWidget*,QWidget*))); + setAcceptDrops(true); } diff --git a/Gui/Gui.h b/Gui/Gui.h index 792d2196bf..ae299e32d7 100644 --- a/Gui/Gui.h +++ b/Gui/Gui.h @@ -36,6 +36,7 @@ CLANG_DIAG_OFF(deprecated) CLANG_DIAG_OFF(uninitialized) #include +#include CLANG_DIAG_ON(deprecated) CLANG_DIAG_ON(uninitialized) @@ -111,7 +112,10 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON void setLastSelectedGraph(NodeGraph* graph); NodeGraph* getLastSelectedGraph() const; - + + void setActiveViewer(ViewerTab* viewer); + ViewerTab* getActiveViewer() const; + boost::shared_ptr getLastSelectedNodeCollection() const; /** @@ -426,6 +430,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON bool progressUpdate(const NodePtr& node,double t); void ensureProgressPanelVisible(); + void ensureScriptEditorVisible(); /*Useful function that saves on disk the image in png format. The name of the image will be the hash key of the image.*/ @@ -566,6 +571,9 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON bool saveProjectAs(const std::string& filename); + static void fileSequencesFromUrls(const QList& urls, std::vector< boost::shared_ptr >* sequences); + + void handleOpenFilesFromUrls(const QList& urls, const QPoint& globalPos); protected: // Reimplemented Protected Functions @@ -741,6 +749,11 @@ public Q_SLOTS: virtual void keyPressEvent(QKeyEvent* e) OVERRIDE FINAL; virtual void keyReleaseEvent(QKeyEvent* e) OVERRIDE FINAL; + virtual void dragEnterEvent(QDragEnterEvent* e) OVERRIDE FINAL; + virtual void dragMoveEvent(QDragMoveEvent* e) OVERRIDE FINAL; + virtual void dragLeaveEvent(QDragLeaveEvent* e) OVERRIDE FINAL; + virtual void dropEvent(QDropEvent* e) OVERRIDE FINAL; + boost::scoped_ptr _imp; }; diff --git a/Gui/Gui.pro b/Gui/Gui.pro index 476db038db..f42c963c72 100644 --- a/Gui/Gui.pro +++ b/Gui/Gui.pro @@ -133,6 +133,7 @@ SOURCES += \ KnobGuiColor.cpp \ KnobGuiString.cpp \ KnobGuiGroup.cpp \ + KnobGuiTable.cpp \ KnobGuiParametric.cpp \ KnobUndoCommand.cpp \ KnobWidgetDnD.cpp \ @@ -285,6 +286,7 @@ HEADERS += \ KnobGuiColor.h \ KnobGuiString.h \ KnobGuiGroup.h \ + KnobGuiTable.h \ KnobGuiParametric.h \ KnobUndoCommand.h \ KnobWidgetDnD.h \ diff --git a/Gui/Gui05.cpp b/Gui/Gui05.cpp index a8be9ee2bd..dbd21a7299 100644 --- a/Gui/Gui05.cpp +++ b/Gui/Gui05.cpp @@ -281,6 +281,20 @@ Gui::getLastSelectedGraph() const return _imp->_lastFocusedGraph; } +void +Gui::setActiveViewer(ViewerTab* viewer) +{ + assert( QThread::currentThread() == qApp->thread() ); + _imp->_activeViewer = viewer; +} + +ViewerTab* +Gui::getActiveViewer() const +{ + assert( QThread::currentThread() == qApp->thread() ); + return _imp->_activeViewer; +} + boost::shared_ptr Gui::getLastSelectedNodeCollection() const { diff --git a/Gui/Gui20.cpp b/Gui/Gui20.cpp index 882da9096f..b4203b9f06 100644 --- a/Gui/Gui20.cpp +++ b/Gui/Gui20.cpp @@ -482,6 +482,10 @@ Gui::removeViewerTab(ViewerTab* tab, assert(tab); unregisterTab(tab); + if (tab == _imp->_activeViewer) { + _imp->_activeViewer = 0; + } + NodeGraph* graph = 0; NodeGroup* isGrp = 0; boost::shared_ptr collection; @@ -1307,25 +1311,40 @@ Gui::createWriter() for (std::map::const_iterator it = writersForFormat.begin(); it != writersForFormat.end(); ++it) { filters.push_back(it->first); } - std::string file = popSaveFileDialog( true, filters, _imp->_lastSaveSequenceOpenedDir.toStdString(), true ); - if ( !file.empty() ) { - + + + std::string file; +#ifdef NATRON_ENABLE_IO_META_NODES + bool useDialogForWriters = appPTR->getCurrentSettings()->isFileDialogEnabledForNewWriters(); +#else + bool useDialogForWriters = true; +#endif + if (useDialogForWriters) { + file = popSaveFileDialog( true, filters, _imp->_lastSaveSequenceOpenedDir.toStdString(), true ); + if (file.empty()) { + return NodePtr(); + } + } + + + if (!file.empty()) { std::string patternCpy = file; std::string path = SequenceParsing::removePath(patternCpy); _imp->_lastSaveSequenceOpenedDir = QString::fromUtf8(path.c_str()); - - NodeGraph* graph = 0; - if (_imp->_lastFocusedGraph) { - graph = _imp->_lastFocusedGraph; - } else { - graph = _imp->_nodeGraphArea; - } - boost::shared_ptr group = graph->getGroup(); - assert(group); - - ret = getApp()->createWriter(file, eCreateNodeReasonUserCreate, group); } + NodeGraph* graph = 0; + if (_imp->_lastFocusedGraph) { + graph = _imp->_lastFocusedGraph; + } else { + graph = _imp->_nodeGraphArea; + } + boost::shared_ptr group = graph->getGroup(); + assert(group); + + ret = getApp()->createWriter(file, eCreateNodeReasonUserCreate, group); + + return ret; } diff --git a/Gui/Gui40.cpp b/Gui/Gui40.cpp index 96db77e8fb..e1d87d3709 100644 --- a/Gui/Gui40.cpp +++ b/Gui/Gui40.cpp @@ -67,6 +67,7 @@ #include "Gui/ProgressPanel.h" #include "Gui/Splitter.h" #include "Gui/TabWidget.h" +#include "Gui/ScriptEditor.h" #include "Gui/ViewerGL.h" #include "Gui/ViewerTab.h" #include "Gui/NodeSettingsPanel.h" @@ -668,6 +669,32 @@ Gui::onRenderRestarted(OutputEffectInstance* writer, _imp->_progressPanel->onTaskRestarted(writer->getNode(), process); } +void +Gui::ensureScriptEditorVisible() +{ + // Ensure that the script editor is visible + TabWidget* pane = _imp->_scriptEditor->getParentPane(); + if (pane != 0) { + pane->setCurrentWidget(_imp->_scriptEditor); + } else { + pane = _imp->_nodeGraphArea->getParentPane(); + if (!pane) { + std::list tabs; + { + QMutexLocker k(&_imp->_panesMutex); + tabs = _imp->_panes; + } + if (tabs.empty()) { + return; + } + pane = tabs.front(); + } + assert(pane); + pane->moveScriptEditorHere(); + } + +} + void Gui::ensureProgressPanelVisible() { diff --git a/Gui/Gui50.cpp b/Gui/Gui50.cpp index 90651063e9..df62c1de92 100644 --- a/Gui/Gui50.cpp +++ b/Gui/Gui50.cpp @@ -29,6 +29,7 @@ #include // min, max #include #include +#include #include #include @@ -46,19 +47,25 @@ GCC_DIAG_UNUSED_PRIVATE_FIELD_ON #include #include #include +#include #include #include #include #include #include +#include #include #include #include +#include "Global/QtCompat.h" + #include "Engine/GroupOutput.h" #include "Engine/Node.h" #include "Engine/NodeGroup.h" // NodesList, NodeCollection #include "Engine/Project.h" +#include "Engine/KnobSerialization.h" +#include "Engine/FileSystemModel.h" #include "Engine/Settings.h" #include "Engine/TimeLine.h" #include "Engine/ViewerInstance.h" @@ -73,6 +80,7 @@ GCC_DIAG_UNUSED_PRIVATE_FIELD_ON #include "Gui/GuiAppInstance.h" #include "Gui/GuiApplicationManager.h" // appPTR #include "Gui/GuiPrivate.h" +#include "Gui/GuiMacros.h" #include "Gui/LogWindow.h" #include "Gui/NodeGraph.h" #include "Gui/NodeGui.h" @@ -87,6 +95,7 @@ GCC_DIAG_UNUSED_PRIVATE_FIELD_ON #include "Gui/TabWidget.h" #include "Gui/ViewerGL.h" #include "Gui/ViewerTab.h" +#include "Gui/SequenceFileDialog.h" #include "Gui/PropertiesBinWrapper.h" #include "Gui/Histogram.h" @@ -403,6 +412,34 @@ Gui::keyPressEvent(QKeyEvent* e) if (panel) { panel->getPanel()->closePanel(); } + } else if (key == Qt::Key_V && modCASIsControl(e)) { + // CTRL +V should have been caught by the Nodegraph if it contained a valid Natron graph. + // We still try to check if it is a readable Python script + QClipboard* clipboard = QApplication::clipboard(); + const QMimeData* mimedata = clipboard->mimeData(); + if (mimedata->hasFormat(QLatin1String("text/plain"))) { + + QByteArray data = mimedata->data(QLatin1String("text/plain")); + QString str = QString::fromUtf8(data); + if (QFile::exists(str)) { + QList urls; + urls.push_back(QUrl::fromLocalFile(str)); + handleOpenFilesFromUrls(urls, QCursor::pos()); + } else { + std::string error, output; + if (!Python::interpretPythonScript(str.toStdString(), &error, &output)) { + _imp->_scriptEditor->appendToScriptEditor(QString::fromUtf8(error.c_str())); + ensureScriptEditorVisible(); + } else if (!output.empty()) { + _imp->_scriptEditor->appendToScriptEditor(QString::fromUtf8(output.c_str())); + } + } + + } else if (mimedata->hasUrls()) { + QList urls = mimedata->urls(); + handleOpenFilesFromUrls(urls, QCursor::pos()); + } + } else if ( isKeybind(kShortcutGroupPlayer, kShortcutIDActionPlayerPrevious, modifiers, key) ) { if ( getNodeGraph()->getLastSelectedViewer() ) { getNodeGraph()->getLastSelectedViewer()->previousFrame(); @@ -977,4 +1014,187 @@ Gui::onFocusChanged(QWidget* /*old*/, QWidget* newFocus) } } +void +Gui::fileSequencesFromUrls(const QList& urls, std::vector< boost::shared_ptr >* sequences) +{ + QStringList filesList; + for (int i = 0; i < urls.size(); ++i) { + const QUrl rl = QtCompat::toLocalFileUrlFixed(urls.at(i)); + QString path = rl.toLocalFile(); + +#ifdef __NATRON_WIN32__ + if ( !path.isEmpty() && ( path.at(0) == QLatin1Char('/') || path.at(0) == QLatin1Char('\\') ) ) { + path = path.remove(0,1); + } + path = FileSystemModel::mapPathWithDriveLetterToPathWithNetworkShareName(path); + +#endif + QDir dir(path); + + //if the path dropped is not a directory append it + if (!dir.exists()) { + filesList << path; + } else { + //otherwise append everything inside the dir recursively + SequenceFileDialog::appendFilesFromDirRecursively(&dir,&filesList); + } + } + + QStringList supportedExtensions; + supportedExtensions.push_back(QString::fromLatin1(NATRON_PROJECT_FILE_EXT)); + supportedExtensions.push_back(QString::fromLatin1("py")); + ///get all the decoders + std::map readersForFormat; + appPTR->getCurrentSettings()->getFileFormatsForReadingAndReader(&readersForFormat); + for (std::map::const_iterator it = readersForFormat.begin(); it != readersForFormat.end(); ++it) { + supportedExtensions.push_back( QString::fromUtf8(it->first.c_str()) ); + } + *sequences = SequenceFileDialog::fileSequencesFromFilesList(filesList,supportedExtensions); + + +} + +void +Gui::dragEnterEvent(QDragEnterEvent* e) +{ + if (!e->mimeData()->hasUrls()) { + return; + } + + QList urls = e->mimeData()->urls(); + + std::vector< boost::shared_ptr > sequences; + fileSequencesFromUrls(urls, &sequences); + + if (!sequences.empty()) { + e->accept(); + } +} + +void +Gui::dragMoveEvent(QDragMoveEvent* e) +{ + if (!e->mimeData()->hasUrls()) { + return; + } + + QList urls = e->mimeData()->urls(); + + std::vector< boost::shared_ptr > sequences; + fileSequencesFromUrls(urls, &sequences); + + if (!sequences.empty()) { + e->accept(); + } +} + +void +Gui::dragLeaveEvent(QDragLeaveEvent* e) +{ + e->accept(); +} + +static NodeGraph* isNodeGraphChild(QWidget* w) { + NodeGraph* n = dynamic_cast(w); + if (n) { + return n; + } else { + QWidget* parent = w->parentWidget(); + if (parent) { + return isNodeGraphChild(parent); + } else { + return 0; + } + } +} + +void +Gui::handleOpenFilesFromUrls(const QList& urls, const QPoint& globalPos) +{ + std::vector< boost::shared_ptr > sequences; + fileSequencesFromUrls(urls, &sequences); + + QWidget* widgetUnderMouse = QApplication::widgetAt(globalPos); + NodeGraph* graph = isNodeGraphChild(widgetUnderMouse); + + if (!graph) { + // No grpah under mouse, use top level one + graph = _imp->_nodeGraphArea; + } + assert(graph); + if (!graph) { + return; + } + + QPointF graphScenePos = graph->mapToScene(graph->mapFromGlobal(globalPos)); + + std::locale local; + for (U32 i = 0; i < sequences.size(); ++i) { + + + boost::shared_ptr & sequence = sequences[i]; + if (sequence->count() < 1) { + continue; + } + + ///find a decoder for this file type + std::string ext = sequence->fileExtension(); + std::string extLower; + for (size_t j = 0; j < ext.size(); ++j) { + extLower.append( 1,std::tolower( ext.at(j),local ) ); + } + if (extLower == NATRON_PROJECT_FILE_EXT) { + const std::map& content = sequence->getFrameIndexes(); + assert(!content.empty()); + (void)openProject(content.begin()->second.absoluteFileName()); + } else if (extLower == "py") { + const std::map& content = sequence->getFrameIndexes(); + assert(!content.empty()); + _imp->_scriptEditor->sourceScript(QString::fromUtf8(content.begin()->second.absoluteFileName().c_str())); + ensureScriptEditorVisible(); + + } else { + + std::map readersForFormat; + appPTR->getCurrentSettings()->getFileFormatsForReadingAndReader(&readersForFormat); + std::map::iterator found = readersForFormat.find(extLower); + if ( found == readersForFormat.end() ) { + Dialogs::errorDialog("Reader", "No plugin capable of decoding " + extLower + " was found."); + } else { + + std::string pattern = sequence->generateValidSequencePattern(); + + CreateNodeArgs args(QString::fromUtf8(found->second.c_str()), eCreateNodeReasonUserCreate, graph->getGroup()); + args.xPosHint = graphScenePos.x(); + args.yPosHint = graphScenePos.y(); + args.paramValues.push_back(createDefaultValueForParam(kOfxImageEffectFileParamName, pattern)); + + NodePtr n = getApp()->createNode(args); + + //And offset scenePos by the Width of the previous node created if several nodes are created + double w,h; + n->getSize(&w, &h); + graphScenePos.rx() += (w + 10); + } + } + } +} + +void +Gui::dropEvent(QDropEvent* e) +{ + if ( !e->mimeData()->hasUrls() ) { + return; + } + + e->accept(); + + QList urls = e->mimeData()->urls(); + + handleOpenFilesFromUrls(urls, mapToGlobal(e->pos())); +} // dropEvent + + + + NATRON_NAMESPACE_EXIT; diff --git a/Gui/GuiAppInstance.cpp b/Gui/GuiAppInstance.cpp index 626fe0012e..32b0df8207 100644 --- a/Gui/GuiAppInstance.cpp +++ b/Gui/GuiAppInstance.cpp @@ -58,6 +58,7 @@ #include "Gui/ProgressPanel.h" #include "Gui/ViewerTab.h" #include "Gui/SplashScreen.h" +#include "Gui/ScriptEditor.h" #include "Gui/ViewerGL.h" NATRON_NAMESPACE_ENTER; @@ -1184,9 +1185,13 @@ GuiAppInstance::isRenderStatsActionChecked() const bool GuiAppInstance::save(const std::string& filename) { - boost::shared_ptr project = getProject(); - if (project->hasProjectBeenSavedByUser()) { - return _imp->_gui->saveProject(); + if (filename.empty()) { + boost::shared_ptr project= getProject(); + if (project->hasProjectBeenSavedByUser()) { + return _imp->_gui->saveProject(); + } else { + return _imp->_gui->saveProjectAs(); + } } else { return _imp->_gui->saveProjectAs(filename); } @@ -1619,6 +1624,12 @@ GuiAppInstance::checkAllReadersModificationDate(bool errorAndWarn) return changed; } +void +GuiAppInstance::reloadScriptEditorFonts() +{ + _imp->_gui->getScriptEditor()->reloadFont(); +} + NATRON_NAMESPACE_EXIT; NATRON_NAMESPACE_USING; diff --git a/Gui/GuiAppInstance.h b/Gui/GuiAppInstance.h index 200cc9cd2c..ec766d40f8 100644 --- a/Gui/GuiAppInstance.h +++ b/Gui/GuiAppInstance.h @@ -273,7 +273,7 @@ public Q_SLOTS: boost::shared_ptr* stroke, bool* isPainting) const OVERRIDE FINAL; - + virtual void reloadScriptEditorFonts() OVERRIDE FINAL; ///////////////// OVERRIDEN FROM TIMELINEKEYFRAMES virtual void removeAllKeyframesIndicators() OVERRIDE FINAL; diff --git a/Gui/GuiApplicationManager.h b/Gui/GuiApplicationManager.h index 3c61b9650d..9cc9d5c307 100644 --- a/Gui/GuiApplicationManager.h +++ b/Gui/GuiApplicationManager.h @@ -182,6 +182,8 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON virtual void reloadStylesheets() OVERRIDE FINAL; + virtual void reloadScriptEditorFonts() OVERRIDE FINAL; + void clearNodeClipBoard(); virtual void addCommand(const QString& grouping,const std::string& pythonFunction, Qt::Key key,const Qt::KeyboardModifiers& modifiers) OVERRIDE; diff --git a/Gui/GuiApplicationManager10.cpp b/Gui/GuiApplicationManager10.cpp index c052b0d09e..8af663e38c 100644 --- a/Gui/GuiApplicationManager10.cpp +++ b/Gui/GuiApplicationManager10.cpp @@ -1227,4 +1227,16 @@ GuiApplicationManager::reloadStylesheets() } } +void +GuiApplicationManager::reloadScriptEditorFonts() +{ + const std::map& instances = getAppInstances(); + for (std::map::const_iterator it = instances.begin(); it != instances.end(); ++it) { + GuiAppInstance* guiApp = dynamic_cast(it->second.app); + if (guiApp) { + guiApp->reloadScriptEditorFonts(); + } + } +} + NATRON_NAMESPACE_EXIT; diff --git a/Gui/GuiDefines.h b/Gui/GuiDefines.h index 96efde6bff..98e98fdd10 100644 --- a/Gui/GuiDefines.h +++ b/Gui/GuiDefines.h @@ -52,6 +52,7 @@ //#define NATRON_FONT_ALT "Times" #define NATRON_FONT "Droid Sans" #define NATRON_FONT_ALT "Droid Sans" +#define NATRON_SCRIPT_FONT "Courier New" #define NATRON_FONT_SIZE_6 6 #define NATRON_FONT_SIZE_8 8 #define NATRON_FONT_SIZE_10 10 diff --git a/Gui/GuiFwd.h b/Gui/GuiFwd.h index 01e1e920eb..9eba8ed66e 100644 --- a/Gui/GuiFwd.h +++ b/Gui/GuiFwd.h @@ -131,6 +131,8 @@ class KnobClickableLabel; class KnobCurveGui; class KnobGui; class KnobGuiFactory; +class KnobGuiTable; +class KnobGuiLayers; class KnobHolder; class KnobWidgetDnD; class LineEdit; diff --git a/Gui/GuiPrivate.cpp b/Gui/GuiPrivate.cpp index 7177febde7..a6b3b3d51d 100644 --- a/Gui/GuiPrivate.cpp +++ b/Gui/GuiPrivate.cpp @@ -209,6 +209,7 @@ GuiPrivate::GuiPrivate(GuiAppInstance* app, , _viewerTabsMutex() , _viewerTabs() , _masterSyncViewer(0) +, _activeViewer(0) , _histogramsMutex() , _histograms() , _nextHistogramIndex(1) diff --git a/Gui/GuiPrivate.h b/Gui/GuiPrivate.h index c15cf27f91..c6a3dd016d 100644 --- a/Gui/GuiPrivate.h +++ b/Gui/GuiPrivate.h @@ -153,6 +153,7 @@ struct GuiPrivate ///Used when all viewers are synchronized to determine which one triggered the sync ViewerTab* _masterSyncViewer; + ViewerTab* _activeViewer; ///a list of ptrs to all histograms mutable QMutex _histogramsMutex; diff --git a/Gui/Histogram.cpp b/Gui/Histogram.cpp index a92bb6c290..36e9714ed2 100644 --- a/Gui/Histogram.cpp +++ b/Gui/Histogram.cpp @@ -478,7 +478,7 @@ boost::shared_ptr HistogramPrivate::getHistogramImage(RectI* imagePortion return boost::shared_ptr(); } else if (index == 1) { //current viewer - viewer = widget->getGui()->getNodeGraph()->getLastSelectedViewer(); + viewer = widget->getGui()->getActiveViewer(); } else { boost::shared_ptr ret; diff --git a/Gui/KnobGui.cpp b/Gui/KnobGui.cpp index b4e37f55ed..25852232d7 100644 --- a/Gui/KnobGui.cpp +++ b/Gui/KnobGui.cpp @@ -176,6 +176,7 @@ KnobGui::createGUI(QGridLayout* containerLayout, QWidget* fieldContainer, QWidget* labelContainer, KnobClickableLabel* label, + Label* warningIndicator, QHBoxLayout* layout, bool isOnNewLine, const std::vector< boost::shared_ptr< KnobI > > & knobsOnSameLine) @@ -191,11 +192,13 @@ KnobGui::createGUI(QGridLayout* containerLayout, _imp->field = fieldContainer; _imp->labelContainer = labelContainer; _imp->descriptionLabel = label; + _imp->warningIndicator = warningIndicator; _imp->isOnNewLine = isOnNewLine; if (!isOnNewLine) { //layout->addStretch(); layout->addSpacing(TO_DPIX(15)); if (label) { + layout->addWidget(_imp->warningIndicator); layout->addWidget(label); } } @@ -219,12 +222,15 @@ KnobGui::createGUI(QGridLayout* containerLayout, _imp->widgetCreated = true; for (int i = 0; i < knob->getDimension(); ++i) { - updateGuiInternal(i); + + onExprChanged(i); + + /*updateGuiInternal(i); std::string exp = knob->getExpression(i); reflectExpressionState(i,!exp.empty()); if (exp.empty()) { onAnimationLevelChanged(ViewSpec::all(), i); - } + }*/ } } diff --git a/Gui/KnobGui.h b/Gui/KnobGui.h index e3bb272e45..cd6dd40130 100644 --- a/Gui/KnobGui.h +++ b/Gui/KnobGui.h @@ -72,6 +72,12 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON public: + enum KnobWarningEnum + { + eKnobWarningExpressionInvalid = 0, + eKnobWarningChoiceMenuOutOfDate + }; + KnobGui(const KnobPtr& knob, DockablePanel* container); @@ -117,6 +123,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON QWidget* fieldContainer, QWidget* labelContainer, KnobClickableLabel* label, + Label* warningIndicator, QHBoxLayout* layout, bool isOnNewLine, const std::vector< boost::shared_ptr< KnobI > > & knobsOnSameLine); @@ -275,6 +282,8 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON virtual bool getAllDimensionsVisible() const OVERRIDE { return true; } + void setWarningValue(KnobWarningEnum warn,const QString& value); + public Q_SLOTS: void onRemoveAliasLinkActionTriggered(); @@ -426,6 +435,8 @@ public Q_SLOTS: private: + void refreshKnobWarningIndicatorVisibility(); + void updateGuiInternal(int dimension); void copyToClipBoard(KnobClipBoardType type, int dimension) const; diff --git a/Gui/KnobGui20.cpp b/Gui/KnobGui20.cpp index 6843a2b68c..e502b30111 100644 --- a/Gui/KnobGui20.cpp +++ b/Gui/KnobGui20.cpp @@ -323,7 +323,7 @@ KnobGui::linkTo(int dimension) thisKnob->beginChanges(); for (int i = 0; i < thisKnob->getDimension(); ++i) { if (i == dimension || dimension == -1) { - thisKnob->setExpression(i, expr.str(), false); + thisKnob->setExpression(i, expr.str(), false, false); } } thisKnob->endChanges(); @@ -706,6 +706,39 @@ KnobGui::onRedrawGuiCurve(int reason, } +void +KnobGui::setWarningValue(KnobWarningEnum warn,const QString& value) +{ + QString& warning = _imp->warningsMapping[warn]; + if (warning != value) { + warning = value; + refreshKnobWarningIndicatorVisibility(); + } +} + +void +KnobGui::refreshKnobWarningIndicatorVisibility() +{ + if (!_imp->warningIndicator) { + return; + } + QString fullTooltip; + bool hasWarning = false; + for (std::map::iterator it = _imp->warningsMapping.begin(); it!=_imp->warningsMapping.end(); ++it) { + if (!it->second.isEmpty()) { + hasWarning = true; + fullTooltip += QString::fromUtf8("

"); + fullTooltip += it->second; + fullTooltip += QString::fromUtf8("

"); + + } + } + if (hasWarning) { + _imp->warningIndicator->setToolTip(fullTooltip); + } + _imp->warningIndicator->setVisible(hasWarning); + +} void KnobGui::onExprChanged(int dimension) @@ -718,14 +751,52 @@ KnobGui::onExprChanged(int dimension) reflectExpressionState(dimension,!exp.empty()); if (exp.empty()) { reflectAnimationLevel(dimension, knob->getAnimationLevel(dimension)); + } else { + + NodeSettingsPanel* isNodeSettings = dynamic_cast(_imp->container); + if (isNodeSettings) { + NodeGuiPtr node = isNodeSettings->getNode(); + if (node) { + node->onKnobExpressionChanged(this); + } + } + + if (_imp->warningIndicator) { + bool invalid = false; + QString fullErrTooltip; + int dims = knob->getDimension(); + for (int i = 0; i < dims; ++i) { + std::string err; + if (!knob->isExpressionValid(i, &err)) { + invalid = true; + } + if (dims > 1 && invalid) { + fullErrTooltip += QString::fromUtf8("

"); + fullErrTooltip += QString::fromUtf8(knob->getDimensionName(i).c_str()); + fullErrTooltip += QString::fromUtf8("

"); + } + if (!err.empty()) { + fullErrTooltip += QString::fromUtf8(err.c_str()); + } + } + if (invalid) { + QString toPrepend; + toPrepend += QString::fromUtf8("

"); + toPrepend += QObject::tr("Invalid expression(s), value returned is the underlying curve:"); + toPrepend += QString::fromUtf8("

"); + fullErrTooltip.prepend(toPrepend); + + setWarningValue(eKnobWarningExpressionInvalid, fullErrTooltip); + } else { + setWarningValue(eKnobWarningExpressionInvalid, QString()); + } + } + onHelpChanged(); + Q_EMIT expressionChanged(); } - - onHelpChanged(); - updateGUI(dimension); - Q_EMIT expressionChanged(); } void diff --git a/Gui/KnobGuiChoice.cpp b/Gui/KnobGuiChoice.cpp index bb630f5c09..04707e4ffc 100644 --- a/Gui/KnobGuiChoice.cpp +++ b/Gui/KnobGuiChoice.cpp @@ -36,7 +36,9 @@ CLANG_DIAG_OFF(uninitialized) #include #include #include +#include #include +#include #include #include #include @@ -239,6 +241,7 @@ KnobGuiChoice::createWidget(QHBoxLayout* layout) void KnobGuiChoice::onCurrentIndexChanged(int i) { + setWarningValue(KnobGui::eKnobWarningChoiceMenuOutOfDate, QString()); pushUndoCommand( new KnobUndoCommand(shared_from_this(),_knob.lock()->getValue(0),i, 0, false, 0) ); } @@ -253,17 +256,41 @@ KnobGuiChoice::onEntryAppended(const QString& entry, const QString& help) _comboBox->addItem(entry, QIcon(), QKeySequence(), help); } int activeIndex = knob->getValue(); - _comboBox->setCurrentIndex_no_emit(activeIndex); + if (activeIndex >= 0) { + _comboBox->setCurrentIndex_no_emit(activeIndex); + } else { + _comboBox->setCurrentText(QString::fromUtf8(knob->getActiveEntryText_mt_safe().c_str())); + } + } void KnobGuiChoice::onEntriesReset() { - _comboBox->clear(); + onEntriesPopulated(); +} + +void +KnobGuiChoice::addRightClickMenuEntries(QMenu* menu) +{ boost::shared_ptr knob = _knob.lock(); - if (knob->getHostCanAddOptions() && - (knob->getName() == kNatronOfxParamOutputChannels || knob->getName() == kOutputChannelsKnobName)) { - _comboBox->addItemNew(); + if (!knob) { + return; + } + + QAction* refreshMenuAction = new QAction(QObject::tr("Refresh Menu"),menu); + QObject::connect(refreshMenuAction,SIGNAL(triggered()),this,SLOT(onRefreshMenuActionTriggered())); + refreshMenuAction->setToolTip(QObject::tr("Synchronize the menu with the actual state of the parameter")); + menu->addAction(refreshMenuAction); + +} + +void +KnobGuiChoice::onRefreshMenuActionTriggered() +{ + boost::shared_ptr knob = _knob.lock(); + if (knob) { + knob->refreshMenu(); } } @@ -271,16 +298,19 @@ void KnobGuiChoice::onEntriesPopulated() { boost::shared_ptr knob = _knob.lock(); - int activeIndex = knob->getValue(); _comboBox->clear(); std::vector entries = knob->getEntries_mt_safe(); const std::vector help = knob->getEntriesHelp_mt_safe(); + + std::string activeEntry = knob->getActiveEntryText_mt_safe(); + for (U32 i = 0; i < entries.size(); ++i) { std::string helpStr; if ( !help.empty() && !help[i].empty() ) { helpStr = help[i]; } + _comboBox->addItem( QString::fromUtf8(entries[i].c_str()), QIcon(), QKeySequence(), QString::fromUtf8( helpStr.c_str() ) ); } // the "New" menu is only added to known parameters (e.g. the choice of output channels) @@ -290,18 +320,36 @@ KnobGuiChoice::onEntriesPopulated() } ///we don't use setCurrentIndex because the signal emitted by combobox will call onCurrentIndexChanged and ///we don't want that to happen because the index actually didn't change. - _comboBox->setCurrentIndex_no_emit(activeIndex); - + if (_comboBox->isCascading() || activeEntry.empty()) { + _comboBox->setCurrentIndex_no_emit(knob->getValue()); + } else { + _comboBox->setCurrentText_no_emit(QString::fromUtf8(activeEntry.c_str())); + } + + + if (!activeEntry.empty()) { + bool activeIndexPresent = knob->isActiveEntryPresentInEntries(); + if (!activeIndexPresent) { + QString error = tr("The value set to this parameter no longer exist in the menu. Right click and press Refresh Menu to update the menu and then pick a new value."); + setWarningValue(KnobGui::eKnobWarningChoiceMenuOutOfDate, GuiUtils::convertFromPlainText(error, Qt::WhiteSpaceNormal)); + } else { + setWarningValue(KnobGui::eKnobWarningChoiceMenuOutOfDate, QString()); + } + + } } + void KnobGuiChoice::onItemNewSelected() { - NewLayerDialog dialog(getGui()); + NewLayerDialog dialog(ImageComponents::getNoneComponents(),getGui()); if (dialog.exec()) { ImageComponents comps = dialog.getComponents(); if (comps == ImageComponents::getNoneComponents()) { - Dialogs::errorDialog(tr("Layer").toStdString(), tr("Invalid layer").toStdString()); + Dialogs::errorDialog(tr("Layer").toStdString(), tr("A layer must contain at least 1 channel and channel names must be " + "Python compliant.").toStdString()); + return; } KnobHolder* holder = _knob.lock()->getHolder(); @@ -341,7 +389,24 @@ KnobGuiChoice::updateGUI(int /*dimension*/) ///change the internal value of the knob again... ///The slot connected to onCurrentIndexChanged is reserved to catch user interaction with the combobox. ///This function is called in response to an internal change. - _comboBox->setCurrentIndex_no_emit( _knob.lock()->getValue(0) ); + boost::shared_ptr knob = _knob.lock(); + + std::string activeEntry = knob->getActiveEntryText_mt_safe(); + if (!activeEntry.empty()) { + bool activeIndexPresent = knob->isActiveEntryPresentInEntries(); + if (!activeIndexPresent) { + QString error = tr("The value set to this parameter no longer exist in the menu. Right click and press Refresh Menu to update the menu and then pick a new value."); + setWarningValue(KnobGui::eKnobWarningChoiceMenuOutOfDate, GuiUtils::convertFromPlainText(error, Qt::WhiteSpaceNormal)); + } else { + setWarningValue(KnobGui::eKnobWarningChoiceMenuOutOfDate, QString()); + } + + } + if (_comboBox->isCascading() || activeEntry.empty()) { + _comboBox->setCurrentIndex_no_emit(knob->getValue()); + } else { + _comboBox->setCurrentText(QString::fromUtf8(activeEntry.c_str())); + } } void diff --git a/Gui/KnobGuiChoice.h b/Gui/KnobGuiChoice.h index f84f11abae..e08ade3564 100644 --- a/Gui/KnobGuiChoice.h +++ b/Gui/KnobGuiChoice.h @@ -120,8 +120,11 @@ public Q_SLOTS: void onItemNewSelected(); + void onRefreshMenuActionTriggered(); + private: - + + virtual void addRightClickMenuEntries(QMenu* menu) OVERRIDE FINAL; virtual void createWidget(QHBoxLayout* layout) OVERRIDE FINAL; virtual void _hide() OVERRIDE FINAL; virtual void _show() OVERRIDE FINAL; diff --git a/Gui/KnobGuiFactory.cpp b/Gui/KnobGuiFactory.cpp index 5fc2828167..02dd5346f0 100644 --- a/Gui/KnobGuiFactory.cpp +++ b/Gui/KnobGuiFactory.cpp @@ -103,7 +103,7 @@ KnobGuiFactory::loadBultinKnobs() _loadedKnobs.insert( knobGuiFactoryEntry() ); _loadedKnobs.insert( knobGuiFactoryEntry() ); _loadedKnobs.insert( knobGuiFactoryEntry() ); - // _loadedKnobs.insert(knobGuiFactoryEntry()); + _loadedKnobs.insert( knobGuiFactoryEntry() ); } KnobGui * diff --git a/Gui/KnobGuiFile.cpp b/Gui/KnobGuiFile.cpp index 18730070c9..36bf8a7605 100644 --- a/Gui/KnobGuiFile.cpp +++ b/Gui/KnobGuiFile.cpp @@ -722,17 +722,10 @@ KnobGuiOutputFile::updateToolTip() //============================PATH_KNOB_GUI==================================== KnobGuiPath::KnobGuiPath(KnobPtr knob, DockablePanel *container) - : KnobGui(knob, container) + : KnobGuiTable(knob, container) , _mainContainer(0) , _lineEdit(0) , _openFileButton(0) - , _table(0) - , _model(0) - , _addPathButton(0) - , _removePathButton(0) - , _editPathButton(0) - , _isInsertingItem(false) - , _dragAndDropping(false) { _knob = boost::dynamic_pointer_cast(knob); assert(_knob.lock()); @@ -744,165 +737,24 @@ KnobGuiPath::~KnobGuiPath() void KnobGuiPath::removeSpecificGui() { - _mainContainer->deleteLater(); - _mainContainer = 0; -} - -////////////// TableView delegate - -class PathKnobTableItemDelegate -: public QStyledItemDelegate -{ - TableView* _view; - bool _isStringList; -public: - - explicit PathKnobTableItemDelegate(TableView* view, bool isStringList); - -private: - - virtual void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const OVERRIDE FINAL; -}; - -PathKnobTableItemDelegate::PathKnobTableItemDelegate(TableView* view,bool isStringList) -: QStyledItemDelegate(view) -, _view(view) -, _isStringList(isStringList) -{ -} - -void -PathKnobTableItemDelegate::paint(QPainter * painter, - const QStyleOptionViewItem & option, - const QModelIndex & index) const -{ - - if (!index.isValid() || option.state & QStyle::State_Selected) { - QStyledItemDelegate::paint(painter,option,index); - - return; - } - TableModel* model = dynamic_cast( _view->model() ); - assert(model); - if (!model) { - // coverity[dead_error_begin] - QStyledItemDelegate::paint(painter, option, index); - return; - } - TableItem* item = model->item(index); - if (!item) { - QStyledItemDelegate::paint(painter, option, index); - return; - } - QPen pen; - - if (!item->flags().testFlag(Qt::ItemIsEnabled)) { - pen.setColor(Qt::black); - } else { - pen.setColor( QColor(200,200,200) ); - + if (_mainContainer) { + _mainContainer->deleteLater(); + _mainContainer = 0; } - painter->setPen(pen); - - // get the proper subrect from the style - QStyle *style = QApplication::style(); - QRect geom = style->subElementRect(QStyle::SE_ItemViewItemText, &option); - - ///Draw the item name column - if (option.state & QStyle::State_Selected) { - painter->fillRect( geom, option.palette.highlight() ); - } - QRect r; - QString str = item->data(Qt::DisplayRole).toString(); - if (!_isStringList && index.column() == 0) { - ///Env vars are used between brackets - str.prepend(QLatin1Char('[')); - str.append(QLatin1Char(']')); - } - painter->drawText(geom,Qt::TextSingleLine,str,&r); + KnobGuiTable::removeSpecificGui(); } void KnobGuiPath::createWidget(QHBoxLayout* layout) { - _mainContainer = new QWidget(layout->parentWidget()); boost::shared_ptr knob = _knob.lock(); if (knob->isMultiPath()) { - QVBoxLayout* mainLayout = new QVBoxLayout(_mainContainer); - mainLayout->setContentsMargins(0, 0, 0, 0); - - _table = new TableView( _mainContainer ); - QObject::connect( _table,SIGNAL(aboutToDrop()),this,SLOT(onItemAboutToDrop()) ); - QObject::connect( _table,SIGNAL(itemDropped()),this,SLOT(onItemDropped()) ); - layout->parentWidget()->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - // QObject::connect( _table, SIGNAL(editingFinished()), this, SLOT(onReturnPressed()) ); - - _table->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - _table->setAttribute(Qt::WA_MacShowFocusRect,0); - -#if QT_VERSION < 0x050000 - _table->header()->setResizeMode(QHeaderView::ResizeToContents); -#else - _table->header()->setSectionResizeMode(QHeaderView::ResizeToContents); -#endif - _table->setDragDropMode(QAbstractItemView::InternalMove); - _table->header()->setStretchLastSection(true); - _table->setUniformRowHeights(true); - _table->setItemDelegate(new PathKnobTableItemDelegate(_table, knob->getIsStringList())); - - _model = new TableModel(0,0,_table); - QObject::connect( _model,SIGNAL(s_itemChanged(TableItem*)),this,SLOT(onItemDataChanged(TableItem*)) ); - - - _table->setTableModel(_model); - _table->setColumnCount(2); - if (knob->getIsStringList()) { - _table->setColumnHidden(1, true); - _table->header()->hide(); - } - QStringList headers; - headers << tr("Variable name") << tr("Value"); - _table->setHorizontalHeaderLabels(headers); - - ///set the copy/link actions in the right click menu - enableRightClickMenu(_table, 0); - - QWidget* buttonsContainer = new QWidget(_mainContainer); - QHBoxLayout* buttonsLayout = new QHBoxLayout(buttonsContainer); - buttonsLayout->setContentsMargins(0, 0, 0, 0); - - _addPathButton = new Button( tr("Add..."),buttonsContainer ); - if (!knob->getIsStringList()) { - _addPathButton->setToolTip(GuiUtils::convertFromPlainText(tr("Click to add a new project path."), Qt::WhiteSpaceNormal)); - } - QObject::connect( _addPathButton, SIGNAL(clicked()), this, SLOT(onAddButtonClicked()) ); - - _removePathButton = new Button( tr("Remove"),buttonsContainer); - QObject::connect( _removePathButton, SIGNAL(clicked()), this, SLOT(onRemoveButtonClicked()) ); - if (!knob->getIsStringList()) { - _removePathButton->setToolTip(GuiUtils::convertFromPlainText(tr("Click to remove selected project path."), Qt::WhiteSpaceNormal)); - } - - _editPathButton = new Button( tr("Edit..."), buttonsContainer); - QObject::connect( _editPathButton, SIGNAL(clicked()), this, SLOT(onEditButtonClicked()) ); - _editPathButton->setToolTip(GuiUtils::convertFromPlainText(tr("Click to change the path of the selected project path."), Qt::WhiteSpaceNormal)); - - - buttonsLayout->addWidget(_addPathButton); - buttonsLayout->addWidget(_removePathButton); - buttonsLayout->addWidget(_editPathButton); - buttonsLayout->addStretch(); - - mainLayout->addWidget(_table); - mainLayout->addWidget(buttonsContainer); - - if (knob->getIsStringList()) { - _editPathButton->hide(); - } + KnobGuiTable::createWidget(layout); } else { // _knob->isMultiPath() + _mainContainer = new QWidget(layout->parentWidget()); QHBoxLayout* mainLayout = new QHBoxLayout(_mainContainer); mainLayout->setContentsMargins(0, 0, 0, 0); _lineEdit = new LineEdit(_mainContainer); @@ -920,152 +772,123 @@ KnobGuiPath::createWidget(QHBoxLayout* layout) mainLayout->addWidget(_lineEdit); mainLayout->addWidget(_openFileButton); - + layout->addWidget(_mainContainer); + } - layout->addWidget(_mainContainer); } void -KnobGuiPath::onAddButtonClicked() +KnobGuiPath::onOpenFileButtonClicked() { - boost::shared_ptr knob = _knob.lock(); - if (knob->getIsStringList()) { - QStringList existingEntries; - for (Variables::iterator it = _items.begin(); it!=_items.end(); ++it) { - existingEntries.push_back(it->second.varName->text()); - } - - QString newItemName = QString::fromUtf8("Placeholder"); - int i = 1; - while (existingEntries.contains(newItemName)) { - newItemName = QString::fromUtf8("Placeholder") + QString::number(i); - ++i; - } + std::vector filters; + SequenceFileDialog dialog( _mainContainer, filters, false, SequenceFileDialog::eFileDialogModeDir, _lastOpened.toStdString(),getGui(),true ); + + if ( dialog.exec() ) { + std::string dirPath = dialog.selectedDirectory(); + updateLastOpened(QString::fromUtf8(dirPath.c_str())); - std::string oldValue = knob->getValue(); - int rowCount = (int)_items.size(); - createItem(rowCount, QString(), newItemName); - std::string newPath = rebuildPath(); - pushUndoCommand( new KnobUndoCommand( shared_from_this(),oldValue,newPath)); - } else { - std::vector filters; - SequenceFileDialog dialog( _mainContainer, filters, false, SequenceFileDialog::eFileDialogModeDir, _lastOpened.toStdString(),getGui(),true); + std::string oldValue = _knob.lock()->getValue(); - if (dialog.exec()) { - std::string dirPath = dialog.selectedDirectory(); - if (!dirPath.empty() && dirPath[dirPath.size() - 1] == '/') { - dirPath.erase(dirPath.size() - 1, 1); - } - updateLastOpened(QString::fromUtf8(dirPath.c_str())); - - - std::string oldValue = knob->getValue(); - - int rowCount = (int)_items.size(); - - QString varName = QString(tr("Path") + QString::fromUtf8("%1")).arg(rowCount); - - createItem(rowCount, QString::fromUtf8(dirPath.c_str()), varName); - - std::string newPath = rebuildPath(); - - pushUndoCommand( new KnobUndoCommand( shared_from_this(),oldValue,newPath ) ); - } + pushUndoCommand( new KnobUndoCommand( shared_from_this(),oldValue,dirPath ) ); } + } -void -KnobGuiPath::onEditButtonClicked() +bool +KnobGuiPath::addNewUserEntry(QStringList& row) { - std::string oldValue = _knob.lock()->getValue(); - QModelIndexList selection = _table->selectionModel()->selectedRows(); - - if (selection.size() != 1) { - return; - } + std::vector filters; + SequenceFileDialog dialog( getGui(), filters, false, SequenceFileDialog::eFileDialogModeDir, _lastOpened.toStdString(),getGui(),true); - Variables::iterator found = _items.find(selection[0].row()); - if (found != _items.end()) { - std::vector filters; - - SequenceFileDialog dialog( _mainContainer, filters, false, SequenceFileDialog::eFileDialogModeDir, found->second.value->text().toStdString(),getGui(),true ); - if (dialog.exec()) { - - std::string dirPath = dialog.selectedDirectory(); - if (!dirPath.empty() && dirPath[dirPath.size() - 1] == '/') { - dirPath.erase(dirPath.size() - 1, 1); - } - updateLastOpened(QString::fromUtf8(dirPath.c_str())); - - found->second.value->setText(QString::fromUtf8(dirPath.c_str())); - std::string newPath = rebuildPath(); - - pushUndoCommand( new KnobUndoCommand( shared_from_this(),oldValue,newPath ) ); + if (dialog.exec()) { + std::string dirPath = dialog.selectedDirectory(); + if (!dirPath.empty() && dirPath[dirPath.size() - 1] == '/') { + dirPath.erase(dirPath.size() - 1, 1); } + QString path = QString::fromUtf8(dirPath.c_str()); + updateLastOpened(path); + + int rc = rowCount(); + QString varName = QString(tr("Path") + QString::fromUtf8("%1")).arg(rc); + row.push_back(path); + return true; } - - - + return false; } -void -KnobGuiPath::onOpenFileButtonClicked() +bool +KnobGuiPath::editUserEntry(QStringList& row) { std::vector filters; - SequenceFileDialog dialog( _mainContainer, filters, false, SequenceFileDialog::eFileDialogModeDir, _lastOpened.toStdString(),getGui(),true ); - if ( dialog.exec() ) { + SequenceFileDialog dialog(getGui(), filters, false, SequenceFileDialog::eFileDialogModeDir, row[1].toStdString(),getGui(),true ); + if (dialog.exec()) { std::string dirPath = dialog.selectedDirectory(); - updateLastOpened(QString::fromUtf8(dirPath.c_str())); - - std::string oldValue = _knob.lock()->getValue(); - - pushUndoCommand( new KnobUndoCommand( shared_from_this(),oldValue,dirPath ) ); + if (!dirPath.empty() && dirPath[dirPath.size() - 1] == '/') { + dirPath.erase(dirPath.size() - 1, 1); + } + QString path = QString::fromUtf8(dirPath.c_str()); + updateLastOpened(path); + row[1] = path; + return true; } - + return false; } void -KnobGuiPath::onRemoveButtonClicked() +KnobGuiPath::entryRemoved(const QStringList& row) { boost::shared_ptr knob = _knob.lock(); - std::string oldValue = knob->getValue(); - QModelIndexList selection = _table->selectionModel()->selectedRows(); - - if (selection.isEmpty()) { - return; - } - - std::list removeVars; - for (int i = 0; i < selection.size(); ++i) { - Variables::iterator found = _items.find(selection[i].row()); - if (found != _items.end()) { - removeVars.push_back(found->second.varName->text().toStdString()); - _items.erase(found); - } + ///Fix all variables if needed + if (knob && knob->getHolder() && knob->getHolder() == getGui()->getApp()->getProject().get() && + appPTR->getCurrentSettings()->isAutoFixRelativeFilePathEnabled()) { + getGui()->getApp()->getProject()->fixRelativeFilePaths(row[0].toStdString(), std::string(),false); } - - _model->removeRows(selection.front().row(),selection.size()); +} +void +KnobGuiPath::tableChanged(int row, int col,std::string* newEncodedValue) +{ + boost::shared_ptr knob = boost::dynamic_pointer_cast(getKnob()); + assert(knob); - ///Fix all variables if needed - if (knob->getHolder() && knob->getHolder() == getGui()->getApp()->getProject().get() && + if (knob->getHolder() && knob->getHolder()->isProject() && appPTR->getCurrentSettings()->isAutoFixRelativeFilePathEnabled()) { - for (std::list::iterator it = removeVars.begin(); it != removeVars.end(); ++it) { - getGui()->getApp()->getProject()->fixRelativeFilePaths(*it, "",false); - } + if (col == 0) { + + std::list > oldTable,newTable; + knob->decodeFromKnobTableFormat(knob->getValue(), &oldTable); + knob->decodeFromKnobTableFormat(*newEncodedValue, &newTable); + + + ///Compare the 2 maps to find-out if a path has changed or just a name + if (oldTable.size() == newTable.size() && row < (int)oldTable.size()) { + std::list >::iterator itOld = oldTable.begin(); + std::list >::iterator itNew = newTable.begin(); + std::advance(itOld, row); + std::advance(itNew, row); + + + if ((*itOld)[0] != (*itNew)[0]) { + ///a name has changed + getGui()->getApp()->getProject()->fixPathName((*itOld)[0], (*itNew)[0]); + } else if ((*itOld)[1] != (*itNew)[1]) { + getGui()->getApp()->getProject()->fixRelativeFilePaths((*itOld)[0], (*itNew)[1],false); + } + + } + } + } - std::string newPath = rebuildPath(); - pushUndoCommand( new KnobUndoCommand( shared_from_this(),oldValue,newPath ) ); + } - void KnobGuiPath::onTextEdited() { @@ -1075,13 +898,6 @@ KnobGuiPath::onTextEdited() } updateLastOpened(QString::fromUtf8(dirPath.c_str())); - - -// if (allowSimplification && _knob->getHolder() && _knob->getHolder()->getApp()) { -// std::map envvar; -// _knob->getHolder()->getApp()->getProject()->getEnvironmentVariables(envvar); -// Project::findReplaceVariable(envvar,dirPath); -// } std::string oldValue = _knob.lock()->getValue(); @@ -1099,91 +915,46 @@ KnobGuiPath::updateLastOpened(const QString &str) } void -KnobGuiPath::updateGUI(int /*dimension*/) +KnobGuiPath::updateGUI(int dimension) { - boost::shared_ptr knob = _knob.lock(); - std::string value = _knob.lock()->getValue(); - - if (_knob.lock()->isMultiPath()) { - std::vector > variables; - Project::makeEnvMapUnordered(value, variables); - + + boost::shared_ptr knob = _knob.lock(); + if (!knob->isMultiPath()) { - _model->clear(); - _items.clear(); - int i = 0; - - for (std::vector >::const_iterator it = variables.begin(); it != variables.end(); ++it, ++i) { - createItem(i, QString::fromUtf8(it->second.c_str()), QString::fromUtf8(it->first.c_str())); - } - } else { + std::string value = knob->getValue(); _lineEdit->setText(QString::fromUtf8(value.c_str())); + } else { + KnobGuiTable::updateGUI(dimension); } } -void -KnobGuiPath::createItem(int row,const QString& value,const QString& varName) -{ - - - Qt::ItemFlags flags; - - boost::shared_ptr knob = _knob.lock(); - - ///Project env var is disabled and uneditable and set automatically by the project - if (varName != QString::fromUtf8(NATRON_PROJECT_ENV_VAR_NAME) && varName != QString::fromUtf8(NATRON_OCIO_ENV_VAR_NAME)) { - flags = Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable; - if (knob->getIsStringList()) { - flags |= Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsUserCheckable; - } - } - TableItem* cell0 = new TableItem; - cell0->setText(varName); - cell0->setFlags(flags); - - TableItem* cell1 = new TableItem; - cell1->setText(value); - cell1->setFlags(flags); - - Row r; - r.varName = cell0; - r.value = cell1; - - _items.insert(std::make_pair(row, r)); - int modelRowCount = _model->rowCount(); - if (row >= modelRowCount) { - _model->insertRow(row); - } - _isInsertingItem = true; - _table->setItem(row, 0, cell0); - _table->setItem(row, 1, cell1); - _isInsertingItem = false; - _table->resizeColumnToContents(0); - _table->resizeColumnToContents(1); -} - void KnobGuiPath::_hide() { - _mainContainer->hide(); + if (_mainContainer) { + _mainContainer->hide(); + } + KnobGuiTable::_hide(); } void KnobGuiPath::_show() { - _mainContainer->show(); + if (_mainContainer) { + _mainContainer->show(); + } + KnobGuiTable::_show(); } void KnobGuiPath::setEnabled() { - bool enabled = getKnob()->isEnabled(0); + if (_knob.lock()->isMultiPath()) { - _table->setEnabled(enabled); - _addPathButton->setEnabled(enabled); - _removePathButton->setEnabled(enabled); + KnobGuiTable::setEnabled(); } else { + bool enabled = getKnob()->isEnabled(0); _lineEdit->setReadOnly_NoFocusRect(!enabled); _openFileButton->setEnabled(enabled); } @@ -1191,12 +962,10 @@ KnobGuiPath::setEnabled() void KnobGuiPath::setReadOnly(bool readOnly, - int /*dimension*/) + int dimension) { if (_knob.lock()->isMultiPath()) { - _table->setEnabled(!readOnly); - _addPathButton->setEnabled(!readOnly); - _removePathButton->setEnabled(!readOnly); + KnobGuiTable::setReadOnly(readOnly, dimension); } else { _lineEdit->setReadOnly_NoFocusRect(readOnly); _openFileButton->setEnabled(!readOnly); @@ -1206,7 +975,7 @@ KnobGuiPath::setReadOnly(bool readOnly, void KnobGuiPath::setDirty(bool /*dirty*/) { - + } KnobPtr KnobGuiPath::getKnob() const @@ -1214,108 +983,6 @@ KnobPtr KnobGuiPath::getKnob() const return _knob.lock(); } -void -KnobGuiPath::onItemAboutToDrop() -{ - _dragAndDropping = true; -} - -void -KnobGuiPath::onItemDropped() -{ - _items.clear(); - - ///Rebuild the mapping - int rowCount = _table->rowCount(); - int colCount = _table->columnCount(); - assert(colCount == 2); - for (int i = 0; i < rowCount; ++i) { - Row& r = _items[i]; - r.varName = _table->item(i, 0); - r.value = _table->item(i, 1); - } - _dragAndDropping = false; - - //Now refresh the knob balue - onItemDataChanged(0); -} - -void -KnobGuiPath::onItemDataChanged(TableItem* /*item*/) -{ - if (_isInsertingItem || _dragAndDropping) { - return; - } - boost::shared_ptr knob = _knob.lock(); - std::string newPath = rebuildPath(); - std::string oldPath = knob->getValue(); - - if (oldPath != newPath) { - - if (knob->getHolder() && knob->getHolder()->isProject() && - appPTR->getCurrentSettings()->isAutoFixRelativeFilePathEnabled()) { - std::map oldEnv,newEnv; - - Project::makeEnvMap(oldPath,oldEnv); - Project::makeEnvMap(newPath, newEnv); - - ///Compare the 2 maps to find-out if a path has changed or just a name - if (oldEnv.size() == newEnv.size()) { - std::map::iterator itOld = oldEnv.begin(); - for (std::map::iterator itNew = newEnv.begin(); itNew != newEnv.end(); ++itNew, ++itOld) { - - if (itOld->first != itNew->first) { - ///a name has changed - getGui()->getApp()->getProject()->fixPathName(itOld->first, itNew->first); - break; - } else if (itOld->second != itOld->second) { - getGui()->getApp()->getProject()->fixRelativeFilePaths(itOld->first, itNew->second,false); - break; - } - } - } - } - - pushUndoCommand( new KnobUndoCommand( shared_from_this(),oldPath,newPath ) ); - } -} - -/** - * @brief A Path knob could also be called Environment_variable_Knob. - * The string is encoded the following way: - * [VariableName1]:[Value1];[VariableName2]:[Value2] etc... - * Split all the ';' characters to get all different variables - * then for each variable split the ':' to get the name and the value of the variable. - **/ -std::string -KnobGuiPath::rebuildPath() const -{ - std::string path; - - Variables::const_iterator next = _items.begin(); - if (next != _items.end()) { - ++next; - } - for (Variables::const_iterator it = _items.begin(); it != _items.end(); ++it) { - // In order to use XML tags, the text inside the tags has to be escaped. - path += NATRON_ENV_VAR_NAME_START_TAG; - path += Project::escapeXML(it->second.varName->text().toStdString()); - path += NATRON_ENV_VAR_NAME_END_TAG; - path += NATRON_ENV_VAR_VALUE_START_TAG; - std::string value = it->second.value->text().toStdString(); - std::string escaped = Project::escapeXML(value); - assert(value == Project::unescapeXML(escaped)); - path += escaped; - path += NATRON_ENV_VAR_VALUE_END_TAG; - - // increment for next iteration - if (next != _items.end()) { - ++next; - } - } // for(it) - return path; -} - void @@ -1409,7 +1076,7 @@ KnobGuiPath::updateToolTip() if (!_knob.lock()->isMultiPath()) { _lineEdit->setToolTip(tt); } else { - _table->setToolTip(tt); + KnobGuiTable::updateToolTip(); } } } diff --git a/Gui/KnobGuiFile.h b/Gui/KnobGuiFile.h index 3b27293c70..eaebf8ee83 100644 --- a/Gui/KnobGuiFile.h +++ b/Gui/KnobGuiFile.h @@ -38,7 +38,7 @@ CLANG_DIAG_ON(uninitialized) #include "Global/GlobalDefines.h" -#include "Gui/KnobGui.h" +#include "Gui/KnobGuiTable.h" #include "Gui/GuiFwd.h" NATRON_NAMESPACE_ENTER; @@ -188,7 +188,7 @@ public Q_SLOTS: //================================ class KnobGuiPath - : public KnobGui + : public KnobGuiTable { GCC_DIAG_SUGGEST_OVERRIDE_OFF Q_OBJECT @@ -212,19 +212,9 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON virtual KnobPtr getKnob() const OVERRIDE FINAL; public Q_SLOTS: - - - - void onAddButtonClicked(); - - void onRemoveButtonClicked(); - - void onEditButtonClicked(); - + void onOpenFileButtonClicked(); - void onItemDataChanged(TableItem* item); - void onTextEdited(); void onMakeAbsoluteTriggered(); @@ -232,13 +222,10 @@ public Q_SLOTS: void onMakeRelativeTriggered(); void onSimplifyTriggered(); - - void onItemAboutToDrop(); - void onItemDropped(); + private: virtual void addRightClickMenuEntries(QMenu* menu) OVERRIDE FINAL; - virtual bool shouldAddStretch() const OVERRIDE FINAL { return false; } virtual void createWidget(QHBoxLayout *layout) OVERRIDE FINAL; virtual void _hide() OVERRIDE FINAL; virtual void _show() OVERRIDE FINAL; @@ -251,41 +238,20 @@ public Q_SLOTS: virtual void updateToolTip() OVERRIDE FINAL; void updateLastOpened(const QString &str); - /** - * @brief A Path knob could also be called Environment_variable_Knob. - * The string is encoded the following way: - * [VariableName1]:[Value1];[VariableName2]:[Value2] etc... - * Split all the ';' characters to get all different variables - * then for each variable split the ':' to get the name and the value of the variable. - **/ - std::string rebuildPath() const; - - void createItem(int row,const QString& value,const QString& varName); - - struct Row - { - TableItem* varName; - TableItem* value; - }; - typedef std::map Variables; - + virtual bool addNewUserEntry(QStringList& row) OVERRIDE FINAL; + // row has been set-up with old value + virtual bool editUserEntry(QStringList& row) OVERRIDE FINAL; + virtual void entryRemoved(const QStringList& row) OVERRIDE FINAL; + virtual void tableChanged(int row, int col,std::string* newEncodedValue) OVERRIDE FINAL; QWidget* _mainContainer; LineEdit* _lineEdit; Button* _openFileButton; - - TableView *_table; - TableModel* _model; - Button *_addPathButton; - Button* _removePathButton; - Button* _editPathButton; + QString _lastOpened; boost::weak_ptr _knob; - bool _isInsertingItem; - Variables _items; - bool _dragAndDropping; }; NATRON_NAMESPACE_EXIT; diff --git a/Gui/KnobGuiPrivate.cpp b/Gui/KnobGuiPrivate.cpp index 24ff48ce85..4cab13404d 100644 --- a/Gui/KnobGuiPrivate.cpp +++ b/Gui/KnobGuiPrivate.cpp @@ -41,6 +41,7 @@ KnobGuiPrivate::KnobGuiPrivate(DockablePanel* container) , field(NULL) , labelContainer(NULL) , descriptionLabel(NULL) +, warningIndicator(NULL) , isOnNewLine(false) , customInteract(NULL) , guiCurves() diff --git a/Gui/KnobGuiPrivate.h b/Gui/KnobGuiPrivate.h index 40dde44ea0..0cef664418 100644 --- a/Gui/KnobGuiPrivate.h +++ b/Gui/KnobGuiPrivate.h @@ -33,7 +33,7 @@ #include #include #include - +#include #include @@ -102,6 +102,7 @@ GCC_DIAG_UNUSED_PRIVATE_FIELD_ON NATRON_NAMESPACE_ENTER; + struct KnobGuiPrivate { bool triggerNewLine; @@ -117,6 +118,8 @@ struct KnobGuiPrivate QWidget* field; QWidget* labelContainer; KnobClickableLabel* descriptionLabel; + Label* warningIndicator; + std::map warningsMapping; bool isOnNewLine; CustomParamInteract* customInteract; diff --git a/Gui/KnobGuiTable.cpp b/Gui/KnobGuiTable.cpp new file mode 100644 index 0000000000..25d763b19a --- /dev/null +++ b/Gui/KnobGuiTable.cpp @@ -0,0 +1,759 @@ +#include "KnobGuiTable.h" + +#include +#include +#include +#include +#include +#include +#include +#include + + +#include "Engine/KnobTypes.h" +#include "Engine/Project.h" + +#include "Gui/Button.h" +#include "Gui/KnobUndoCommand.h" +#include "Gui/NewLayerDialog.h" +#include "Gui/TableModelView.h" +#include "Gui/Utils.h" + +NATRON_NAMESPACE_ENTER; + +namespace { +struct Row +{ + std::vector items; +}; +typedef std::vector Variables; +} + + +struct KnobGuiTablePrivate +{ + + std::string encodeTable(const boost::shared_ptr& knob) const; + + void createItem(const boost::shared_ptr& knob, int row,const QStringList& values); + + QWidget* mainContainer; + + TableView *table; + TableModel* model; + Button *addPathButton; + Button* removePathButton; + Button* editPathButton; + bool isInsertingItem; + Variables items; + bool dragAndDropping; + + KnobGuiTablePrivate() + : mainContainer(0) + , table(0) + , model(0) + , addPathButton(0) + , removePathButton(0) + , editPathButton(0) + , isInsertingItem(false) + , items() + , dragAndDropping(false) + { + + } +}; + +KnobGuiTable::KnobGuiTable(KnobPtr knob, + DockablePanel *container) +: KnobGui(knob, container) +, _imp(new KnobGuiTablePrivate()) +{ + +} + +KnobGuiTable::~KnobGuiTable() +{ + +} + +void KnobGuiTable::removeSpecificGui() +{ + if (_imp->mainContainer) { + _imp->mainContainer->deleteLater(); + _imp->mainContainer = 0; + } +} + +int +KnobGuiTable::rowCount() const +{ + return _imp->model->rowCount(); +} + +////////////// TableView delegate + +class KnobTableItemDelegate +: public QStyledItemDelegate +{ + TableView* _view; + boost::weak_ptr _knob; + +public: + + explicit KnobTableItemDelegate(const boost::shared_ptr& knob, TableView* view); + +private: + + virtual void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const OVERRIDE FINAL; +}; + +KnobTableItemDelegate::KnobTableItemDelegate(const boost::shared_ptr& knob, TableView* view) +: QStyledItemDelegate(view) +, _view(view) +, _knob(knob) +{ +} + +void +KnobTableItemDelegate::paint(QPainter * painter, + const QStyleOptionViewItem & option, + const QModelIndex & index) const +{ + + if (!index.isValid() || option.state & QStyle::State_Selected) { + QStyledItemDelegate::paint(painter,option,index); + + return; + } + + boost::shared_ptr knob = _knob.lock(); + if (!knob) { + return; + } + + + TableModel* model = dynamic_cast( _view->model() ); + assert(model); + if (!model) { + // coverity[dead_error_begin] + QStyledItemDelegate::paint(painter, option, index); + return; + } + TableItem* item = model->item(index); + if (!item) { + QStyledItemDelegate::paint(painter, option, index); + return; + } + QPen pen; + + if (!item->flags().testFlag(Qt::ItemIsEnabled)) { + pen.setColor(Qt::black); + } else { + pen.setColor( QColor(200,200,200) ); + + } + painter->setPen(pen); + + // get the proper subrect from the style + QStyle *style = QApplication::style(); + QRect geom = style->subElementRect(QStyle::SE_ItemViewItemText, &option); + + ///Draw the item name column + if (option.state & QStyle::State_Selected) { + painter->fillRect( geom, option.palette.highlight() ); + } + QRect r; + QString str = item->data(Qt::DisplayRole).toString(); + + bool decorateWithBrackets = knob->isCellBracketDecorated(index.row(), index.column()); + + if (decorateWithBrackets) { + ///Env vars are used between brackets + str.prepend(QLatin1Char('[')); + str.append(QLatin1Char(']')); + } + painter->drawText(geom,Qt::TextSingleLine,str,&r); +} + + +void +KnobGuiTable::createWidget(QHBoxLayout* layout) +{ + + + boost::shared_ptr knob = boost::dynamic_pointer_cast(getKnob()); + assert(knob); + + _imp->mainContainer = new QWidget(layout->parentWidget()); + QVBoxLayout* mainLayout = new QVBoxLayout(_imp->mainContainer); + mainLayout->setContentsMargins(0, 0, 0, 0); + + _imp->table = new TableView(_imp->mainContainer); + QObject::connect(_imp->table,SIGNAL(aboutToDrop()),this,SLOT(onItemAboutToDrop())); + QObject::connect(_imp->table,SIGNAL(itemDropped()),this,SLOT(onItemDropped())); + QObject::connect(_imp->table,SIGNAL(itemDoubleClicked(TableItem*)),this,SLOT(onItemDoubleClicked(TableItem*))); + + layout->parentWidget()->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + + _imp->table->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + _imp->table->setAttribute(Qt::WA_MacShowFocusRect,0); + +#if QT_VERSION < 0x050000 + _imp->table->header()->setResizeMode(QHeaderView::ResizeToContents); +#else + _imp->table->header()->setSectionResizeMode(QHeaderView::ResizeToContents); +#endif + _imp->table->setDragDropMode(QAbstractItemView::InternalMove); + _imp->table->header()->setStretchLastSection(true); + _imp->table->setUniformRowHeights(true); + _imp->table->setItemDelegate(new KnobTableItemDelegate(knob, _imp->table)); + + _imp->model = new TableModel(0,0,_imp->table); + QObject::connect(_imp->model,SIGNAL(s_itemChanged(TableItem*)),this,SLOT(onItemDataChanged(TableItem*))); + + + + _imp->table->setTableModel(_imp->model); + const int numCols = knob->getColumnsCount(); + _imp->table->setColumnCount(numCols); + if (numCols == 1) { + _imp->table->header()->hide(); + } + QStringList headers; + for (int i = 0; i < numCols; ++i) { + headers.push_back(QString::fromUtf8(knob->getColumnLabel(i).c_str())); + } + _imp->table->setHorizontalHeaderLabels(headers); + + ///set the copy/link actions in the right click menu + enableRightClickMenu(_imp->table, 0); + + QWidget* buttonsContainer = new QWidget(_imp->mainContainer); + QHBoxLayout* buttonsLayout = new QHBoxLayout(buttonsContainer); + buttonsLayout->setContentsMargins(0, 0, 0, 0); + + _imp->addPathButton = new Button( tr("Add..."),buttonsContainer ); + _imp->addPathButton->setToolTip(GuiUtils::convertFromPlainText(tr("Add a new value"), Qt::WhiteSpaceNormal)); + + QObject::connect( _imp->addPathButton, SIGNAL(clicked()), this, SLOT(onAddButtonClicked()) ); + + _imp->removePathButton = new Button( tr("Remove"),buttonsContainer); + QObject::connect(_imp->removePathButton, SIGNAL(clicked()), this, SLOT(onRemoveButtonClicked())); + _imp->removePathButton->setToolTip(GuiUtils::convertFromPlainText(tr("Remove selected values"), Qt::WhiteSpaceNormal)); + + _imp->editPathButton = new Button( tr("Edit..."), buttonsContainer); + QObject::connect(_imp->editPathButton, SIGNAL(clicked()), this, SLOT(onEditButtonClicked()) ); + _imp->editPathButton->setToolTip(GuiUtils::convertFromPlainText(tr("Click to edit seleted value."), Qt::WhiteSpaceNormal)); + + + buttonsLayout->addWidget(_imp->addPathButton); + buttonsLayout->addWidget(_imp->removePathButton); + buttonsLayout->addWidget(_imp->editPathButton); + buttonsLayout->addStretch(); + + mainLayout->addWidget(_imp->table); + mainLayout->addWidget(buttonsContainer); + + if (!knob->useEditButton()) { + _imp->editPathButton->hide(); + } + + layout->addWidget(_imp->mainContainer); +} + +std::string +KnobGuiTablePrivate::encodeTable(const boost::shared_ptr& knob) const +{ + std::stringstream ss; + + for (Variables::const_iterator it = items.begin(); it != items.end(); ++it) { + // In order to use XML tags, the text inside the tags has to be escaped. + for (std::size_t c = 0; c < it->items.size(); ++c) { + std::string label = knob->getColumnLabel(c); + ss << "<" << label << ">"; + ss << Project::escapeXML(it->items[c]->text().toStdString()); + ss << ""; + } + } + return ss.str(); + +} + +void +KnobGuiTablePrivate::createItem(const boost::shared_ptr& knob, int row,const QStringList& values) +{ + + + assert(values.size() == knob->getColumnsCount()); + int col = 0; + + Row r; + + for (QStringList::const_iterator it = values.begin(); it!= values.end(); ++it, ++col) { + + Qt::ItemFlags flags; + if (knob->isCellEnabled(row, col, values)) { + + flags = Qt::ItemIsEnabled | Qt::ItemIsSelectable; + if (knob->isColumnEditable(col)) { + flags |= Qt::ItemIsEditable; + } + + if (values.size() == 1) { + flags |= Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsUserCheckable; + } + } + + TableItem* cell = new TableItem; + cell->setText(*it); + cell->setFlags(flags); + r.items.push_back(cell); + } + + if (row >= (int)items.size()) { + items.push_back(r); + } else { + std::vector::iterator it = items.begin(); + std::advance(it, row); + items.insert(it, r); + } + int modelRowCount = model->rowCount(); + if (row >= modelRowCount) { + model->insertRow(row); + } + isInsertingItem = true; + for (std::size_t i = 0; i < r.items.size(); ++i) { + table->setItem(row, i, r.items[i]); + table->resizeColumnToContents(i); + } + isInsertingItem = false; +} + +void +KnobGuiTable::onAddButtonClicked() +{ + boost::shared_ptr knob = boost::dynamic_pointer_cast(getKnob()); + assert(knob); + + const int numCols = knob->getColumnsCount(); + + std::string oldTable = knob->getValue(); + QStringList row; + + if (numCols == 1) { + QStringList existingEntries; + for (Variables::iterator it = _imp->items.begin(); it!= _imp->items.end(); ++it) { + existingEntries.push_back(it->items[0]->text()); + } + + QString newItemName = QString::fromUtf8("Placeholder"); + int i = 1; + while (existingEntries.contains(newItemName)) { + newItemName = QString::fromUtf8("Placeholder") + QString::number(i); + ++i; + } + row.push_back(newItemName); + + } else { + + if (!addNewUserEntry(row)) { + return; + } + + } + + int rowCount = (int)_imp->items.size(); + + _imp->createItem(knob, rowCount, row); + std::string newTable = _imp->encodeTable(knob); + pushUndoCommand( new KnobUndoCommand( shared_from_this(),oldTable,newTable)); +} + +void +KnobGuiTable::onEditButtonClicked() +{ + boost::shared_ptr knob = boost::dynamic_pointer_cast(getKnob()); + assert(knob); + std::string oldTable = knob->getValue(); + + QModelIndexList selection = _imp->table->selectionModel()->selectedRows(); + + if (selection.size() != 1) { + return; + } + + if (selection[0].row() >= 0 && selection[0].row() < (int)_imp->items.size()) { + Row& r = _imp->items[selection[0].row()]; + QStringList row; + for (std::size_t i = 0; i < r.items.size(); ++i) { + row.push_back(r.items[i]->text()); + } + if (!editUserEntry(row)) { + return; + } + + for (std::size_t i = 0; i < r.items.size(); ++i) { + r.items[i]->setText(row[i]); + } + + std::string newTable = _imp->encodeTable(knob); + pushUndoCommand( new KnobUndoCommand( shared_from_this(),oldTable,newTable)); + + } + +} + +void +KnobGuiTable::onRemoveButtonClicked() +{ + boost::shared_ptr knob = boost::dynamic_pointer_cast(getKnob()); + assert(knob); + QModelIndexList selection = _imp->table->selectionModel()->selectedRows(); + + if (selection.size() < 1) { + return; + } + + + + for (int i = 0; i < selection.size(); ++i) { + + QStringList removedRow; + if (selection[0].row() >= 0 && selection[0].row() < (int)_imp->items.size()) { + Row& r = _imp->items[selection[0].row()]; + for (std::size_t i = 0; i < r.items.size(); ++i) { + removedRow.push_back(r.items[i]->text()); + } + _imp->items.erase(_imp->items.begin() + selection[0].row()); + } + + entryRemoved(removedRow); + + } + + _imp->model->removeRows(selection.front().row(),selection.size()); + + + std::string oldTable = knob->getValue(); + std::string newTable = _imp->encodeTable(knob); + pushUndoCommand( new KnobUndoCommand( shared_from_this(),oldTable,newTable)); +} + +void +KnobGuiTable::updateGUI(int /*dimension*/) +{ + boost::shared_ptr knob = boost::dynamic_pointer_cast(getKnob()); + assert(knob); + + std::list > table; + knob->getTable(&table); + + _imp->model->clear(); + _imp->items.clear(); + int i = 0; + for (std::list >::const_iterator it = table.begin(); it != table.end(); ++it, ++i) { + + QStringList row; + for (std::size_t i = 0; i < it->size(); ++i) { + row.push_back(QString::fromUtf8((*it)[i].c_str())); + } + _imp->createItem(knob, i, row); + } + +} + + +void +KnobGuiTable::_hide() +{ + if (_imp->mainContainer) { + _imp->mainContainer->hide(); + } +} + +void +KnobGuiTable::_show() +{ + if (_imp->mainContainer) { + _imp->mainContainer->show(); + } +} + +void +KnobGuiTable::setEnabled() +{ + bool enabled = getKnob()->isEnabled(0); + if (_imp->table) { + _imp->table->setEnabled(enabled); + _imp->addPathButton->setEnabled(enabled); + _imp->removePathButton->setEnabled(enabled); + } + +} + +void +KnobGuiTable::setReadOnly(bool readOnly, + int /*dimension*/) +{ + if (_imp->table) { + _imp->table->setEnabled(!readOnly); + _imp->addPathButton->setEnabled(!readOnly); + _imp->removePathButton->setEnabled(!readOnly); + } +} + + +void +KnobGuiTable::onItemAboutToDrop() +{ + _imp->dragAndDropping = true; +} + + +void +KnobGuiTable::onItemDropped() +{ + _imp->items.clear(); + + ///Rebuild the mapping + int rowCount = _imp->table->rowCount(); + int colCount = _imp->table->columnCount(); + for (int i = 0; i < rowCount; ++i) { + Row& r = _imp->items[i]; + r.items.resize(colCount); + for (int j = 0; j < colCount; ++j) { + r.items[j] = _imp->table->item(i, j); + } + } + _imp->dragAndDropping = false; + + //Now refresh the knob balue + onItemDataChanged(0); +} + +void +KnobGuiTable::onItemDoubleClicked(TableItem* item) +{ + int row = -1; + int col = -1; + for (std::size_t i = 0; i < _imp->items.size(); ++i) { + for (std::size_t j = 0; j < _imp->items[i].items.size(); ++j) { + if (_imp->items[i].items[j] == item) { + row = i; + col = j; + break; + } + } + if (row != -1) { + break; + } + } + boost::shared_ptr knob = boost::dynamic_pointer_cast(getKnob()); + assert(knob); + + + Row& r = _imp->items[row]; + QStringList values; + for (std::size_t i = 0; i < r.items.size(); ++i) { + values.push_back(r.items[i]->text()); + } + + // Not enabled + if (!knob->isCellEnabled(row,col,values)) { + return; + } + + // Let the standard editor + if (knob->isColumnEditable(col)) { + return; + } + if (!editUserEntry(values)) { + return; + } + + for (std::size_t i = 0; i < r.items.size(); ++i) { + r.items[i]->setText(values[i]); + } + + std::string oldTable = knob->getValue(); + std::string newTable = _imp->encodeTable(knob); + pushUndoCommand( new KnobUndoCommand( shared_from_this(),oldTable,newTable)); + + + +} + +void +KnobGuiTable::onItemDataChanged(TableItem* item) +{ + if (_imp->isInsertingItem || _imp->dragAndDropping) { + return; + } + + int row = -1; + int col = -1; + for (std::size_t i = 0; i < _imp->items.size(); ++i) { + for (std::size_t j = 0; j < _imp->items[i].items.size(); ++j) { + if (_imp->items[i].items[j] == item) { + row = i; + col = j; + break; + } + } + if (row != -1) { + break; + } + } + + if (row != -1) { + boost::shared_ptr knob = boost::dynamic_pointer_cast(getKnob()); + assert(knob); + + std::string oldValue = knob->getValue(); + std::string newValue = _imp->encodeTable(knob); + if (oldValue != newValue) { + + tableChanged(row, col, &newValue); + pushUndoCommand( new KnobUndoCommand( shared_from_this(),oldValue,newValue)); + } + } +} + + +void +KnobGuiTable::updateToolTip() +{ + if (hasToolTip()) { + QString tt = toolTip(); + _imp->table->setToolTip(tt); + } +} + +KnobGuiLayers::KnobGuiLayers(KnobPtr knob, + DockablePanel *container) +: KnobGuiTable(knob,container) +{ + _knob = boost::dynamic_pointer_cast(knob); +} + +KnobGuiLayers::~KnobGuiLayers() +{ + +} + +bool +KnobGuiLayers::addNewUserEntry(QStringList& row) +{ + NewLayerDialog dialog(ImageComponents::getNoneComponents(),getGui()); + if (dialog.exec()) { + ImageComponents comps = dialog.getComponents(); + if (comps == ImageComponents::getNoneComponents()) { + Dialogs::errorDialog(tr("Layer").toStdString(), tr("A layer must contain at least 1 channel and channel names must be " + "Python compliant.").toStdString()); + return false; + } + row.push_back(QString::fromUtf8(comps.getLayerName().c_str())); + + std::list > table; + _knob.lock()->getTable(&table); + for (std::list >::iterator it = table.begin(); it!=table.end(); ++it) { + if ((*it)[0] == comps.getLayerName()) { + Dialogs::errorDialog(tr("Layer").toStdString(), tr("A Layer with the same name already exists").toStdString()); + return false; + } + } + + std::string channelsStr; + const std::vector& channels = comps.getComponentsNames(); + for (std::size_t i = 0; i < channels.size(); ++i) { + channelsStr += channels[i]; + if (i < (channels.size() - 1)) { + channelsStr += ' '; + } + } + row.push_back(QString::fromUtf8(channelsStr.c_str())); + return true; + } + return false; +} + +bool +KnobGuiLayers::editUserEntry(QStringList& row) +{ + std::vector channels; + QStringList splits = row[1].split(QLatin1Char(' ')); + for (int i = 0; i < splits.size(); ++i) { + channels.push_back(splits[i].toStdString()); + } + ImageComponents original(row[0].toStdString(),std::string(),channels);; + + NewLayerDialog dialog(original,getGui()); + if (dialog.exec()) { + ImageComponents comps = dialog.getComponents(); + if (comps == ImageComponents::getNoneComponents()) { + Dialogs::errorDialog(tr("Layer").toStdString(), tr("A layer must contain at least 1 channel and channel names must be " + "Python compliant.").toStdString()); + return false; + } + + std::string oldLayerName = row[0].toStdString(); + row[0] = (QString::fromUtf8(comps.getLayerName().c_str())); + + std::list > table; + _knob.lock()->getTable(&table); + for (std::list >::iterator it = table.begin(); it!=table.end(); ++it) { + if ((*it)[0] == comps.getLayerName() && (*it)[0] != oldLayerName) { + Dialogs::errorDialog(tr("Layer").toStdString(), tr("A Layer with the same name already exists").toStdString()); + return false; + } + } + + std::string channelsStr; + const std::vector& channels = comps.getComponentsNames(); + for (std::size_t i = 0; i < channels.size(); ++i) { + channelsStr += channels[i]; + if (i < (channels.size() - 1)) { + channelsStr += ' '; + } + } + row[1] = (QString::fromUtf8(channelsStr.c_str())); + return true; + } + return false; +} + +void +KnobGuiLayers::tableChanged(int row, int col, std::string* newEncodedValue) +{ + if (col != 0) { + return; + } + boost::shared_ptr knob = boost::dynamic_pointer_cast(getKnob()); + assert(knob); + std::list > table; + knob->decodeFromKnobTableFormat(*newEncodedValue, &table); + + if (row < (int)table.size()) { + + std::list >::iterator it = table.begin(); + std::advance(it, row); + std::string copy = Python::makeNameScriptFriendlyWithDots((*it)[0]); + if (copy != (*it)[0]) { + (*it)[0] = copy; + *newEncodedValue = knob->encodeToKnobTableFormat(table); + } + + } + +} + +KnobPtr +KnobGuiLayers::getKnob() const +{ + return _knob.lock(); +} + +NATRON_NAMESPACE_EXIT; + +NATRON_NAMESPACE_USING; +#include "moc_KnobGuiTable.cpp" \ No newline at end of file diff --git a/Gui/KnobGuiTable.h b/Gui/KnobGuiTable.h new file mode 100644 index 0000000000..b5404aa58f --- /dev/null +++ b/Gui/KnobGuiTable.h @@ -0,0 +1,152 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * This file is part of Natron , + * Copyright (C) 2016 INRIA and Alexandre Gauthier-Foichat + * + * Natron is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Natron is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Natron. If not, see + * ***** END LICENSE BLOCK ***** */ + +#ifndef Gui_KnobGuiLayer_h +#define Gui_KnobGuiLayer_h + +// ***** BEGIN PYTHON BLOCK ***** +// from : +// "Since Python may define some pre-processor definitions which affect the standard headers on some systems, you must include Python.h before any standard headers are included." +#include +// ***** END PYTHON BLOCK ***** + +#include "Global/Macros.h" +#include "Gui/GuiFwd.h" +#include "Gui/KnobGui.h" + +NATRON_NAMESPACE_ENTER; + +struct KnobGuiTablePrivate; +class KnobGuiTable : public KnobGui +{ + GCC_DIAG_SUGGEST_OVERRIDE_OFF + Q_OBJECT + GCC_DIAG_SUGGEST_OVERRIDE_ON + +public: + + KnobGuiTable(KnobPtr knob, + DockablePanel *container); + + virtual ~KnobGuiTable() OVERRIDE; + + virtual void removeSpecificGui() OVERRIDE; + + int rowCount() const; + +public Q_SLOTS: + + + void onAddButtonClicked(); + + void onRemoveButtonClicked(); + + void onEditButtonClicked(); + + void onItemDataChanged(TableItem* item); + + void onItemAboutToDrop(); + + void onItemDropped(); + + void onItemDoubleClicked(TableItem* item); + +protected: + + virtual void setDirty(bool /*dirty*/) OVERRIDE + { + + } + + virtual void createWidget(QHBoxLayout *layout) OVERRIDE; + virtual void _hide() OVERRIDE; + virtual void _show() OVERRIDE; + virtual void setEnabled() OVERRIDE; + virtual void setReadOnly(bool readOnly,int dimension) OVERRIDE; + virtual void updateGUI(int dimension) OVERRIDE; + virtual void reflectAnimationLevel(int /*dimension*/,AnimationLevelEnum /*level*/) OVERRIDE + { + + } + virtual void reflectExpressionState(int /*dimension*/,bool /*hasExpr*/) OVERRIDE + { + + } + virtual void updateToolTip() OVERRIDE; + + virtual bool addNewUserEntry(QStringList& row) = 0; + + // row has been set-up with old value + virtual bool editUserEntry(QStringList& row) = 0; + + virtual void entryRemoved(const QStringList& /*row*/) {} + + virtual void tableChanged(int /*row*/, int /*col*/, std::string* /*newEncodedValue*/) + { + + } + +private: + + virtual bool shouldAddStretch() const OVERRIDE FINAL { return false; } + + boost::scoped_ptr _imp; + +}; + +class KnobGuiLayers +: public KnobGuiTable +{ + +public: + + static KnobGui * BuildKnobGui(KnobPtr knob, + DockablePanel *container) + { + return new KnobGuiLayers(knob, container); + } + + KnobGuiLayers(KnobPtr knob, + DockablePanel *container); + + virtual ~KnobGuiLayers() OVERRIDE; + + + virtual KnobPtr getKnob() const OVERRIDE FINAL; + + +private: + + + virtual bool addNewUserEntry(QStringList& row) OVERRIDE FINAL WARN_UNUSED_RETURN; + + // row has been set-up with old value + virtual bool editUserEntry(QStringList& row) OVERRIDE FINAL WARN_UNUSED_RETURN; + + virtual void entryRemoved(const QStringList& /*row*/) OVERRIDE {} + + virtual void tableChanged(int row, int col, std::string* newEncodedValue) OVERRIDE FINAL; + + + boost::weak_ptr _knob; + +}; + +NATRON_NAMESPACE_EXIT; + +#endif // Gui_KnobGuiLayer_h diff --git a/Gui/KnobUndoCommand.cpp b/Gui/KnobUndoCommand.cpp index f8f2fda1a3..221d94824b 100644 --- a/Gui/KnobUndoCommand.cpp +++ b/Gui/KnobUndoCommand.cpp @@ -683,7 +683,7 @@ SetExpressionCommand::undo() { for (int i = 0; i < _knob->getDimension(); ++i) { try { - _knob->setExpression(i, _oldExprs[i], _hadRetVar[i]); + _knob->setExpression(i, _oldExprs[i], _hadRetVar[i], false); } catch (...) { Dialogs::errorDialog(QObject::tr("Expression").toStdString(), QObject::tr("The expression is invalid").toStdString()); break; @@ -700,7 +700,7 @@ SetExpressionCommand::redo() if (_dimension == -1) { for (int i = 0; i < _knob->getDimension(); ++i) { try { - _knob->setExpression(i, _newExpr, _hasRetVar); + _knob->setExpression(i, _newExpr, _hasRetVar, false); } catch (...) { Dialogs::errorDialog(QObject::tr("Expression").toStdString(), QObject::tr("The expression is invalid").toStdString()); break; @@ -708,7 +708,7 @@ SetExpressionCommand::redo() } } else { try { - _knob->setExpression(_dimension, _newExpr, _hasRetVar); + _knob->setExpression(_dimension, _newExpr, _hasRetVar, false); } catch (...) { Dialogs::errorDialog(QObject::tr("Expression").toStdString(), QObject::tr("The expression is invalid").toStdString()); } diff --git a/Gui/KnobWidgetDnD.cpp b/Gui/KnobWidgetDnD.cpp index 123424c355..c6f2945fa9 100644 --- a/Gui/KnobWidgetDnD.cpp +++ b/Gui/KnobWidgetDnD.cpp @@ -26,6 +26,7 @@ #include "Global/Macros.h" + CLANG_DIAG_OFF(deprecated) CLANG_DIAG_OFF(uninitialized) #include @@ -451,4 +452,4 @@ KnobWidgetDnD::focusOut() _imp->userInputSinceFocusIn = false; } -NATRON_NAMESPACE_EXIT; \ No newline at end of file +NATRON_NAMESPACE_EXIT; diff --git a/Gui/MultiInstancePanel.cpp b/Gui/MultiInstancePanel.cpp index 5cc1ba87f9..cc40c7c10c 100644 --- a/Gui/MultiInstancePanel.cpp +++ b/Gui/MultiInstancePanel.cpp @@ -2355,8 +2355,8 @@ TrackerPanelPrivateV1::createCornerPinFromSelection(const std::list & sel std::stringstream ss; ss << "thisGroup." << effect->getNode()->getFullyQualifiedName() << "." << centers[i]->getName() << ".get()[dimension]"; std::string expr = ss.str(); - dynamic_cast(toPoints[i].get())->setExpression(0, expr, false); - dynamic_cast(toPoints[i].get())->setExpression(1, expr, false); + dynamic_cast(toPoints[i].get())->setExpression(0, expr, false, false); + dynamic_cast(toPoints[i].get())->setExpression(1, expr, false, false); } } } diff --git a/Gui/NatronGui/guiapp_wrapper.cpp b/Gui/NatronGui/guiapp_wrapper.cpp index ae336abbc2..b34f8c84d0 100644 --- a/Gui/NatronGui/guiapp_wrapper.cpp +++ b/Gui/NatronGui/guiapp_wrapper.cpp @@ -26,7 +26,6 @@ NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING #include #include #include -#include // Native --------------------------------------------------------- @@ -184,6 +183,64 @@ static PyObject* Sbk_GuiAppFunc_deselectNode(PyObject* self, PyObject* pyArg) return 0; } +static PyObject* Sbk_GuiAppFunc_getActiveTabWidget(PyObject* self) +{ + ::GuiApp* cppSelf = 0; + SBK_UNUSED(cppSelf) + if (!Shiboken::Object::isValid(self)) + return 0; + cppSelf = ((::GuiApp*)Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], (SbkObject*)self)); + PyObject* pyResult = 0; + + // Call function/method + { + + if (!PyErr_Occurred()) { + // getActiveTabWidget()const + PyTabWidget * cppResult = const_cast(cppSelf)->getActiveTabWidget(); + pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX], cppResult); + + // Ownership transferences. + Shiboken::Object::getOwnership(pyResult); + } + } + + if (PyErr_Occurred() || !pyResult) { + Py_XDECREF(pyResult); + return 0; + } + return pyResult; +} + +static PyObject* Sbk_GuiAppFunc_getActiveViewer(PyObject* self) +{ + ::GuiApp* cppSelf = 0; + SBK_UNUSED(cppSelf) + if (!Shiboken::Object::isValid(self)) + return 0; + cppSelf = ((::GuiApp*)Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], (SbkObject*)self)); + PyObject* pyResult = 0; + + // Call function/method + { + + if (!PyErr_Occurred()) { + // getActiveViewer()const + PyViewer * cppResult = const_cast(cppSelf)->getActiveViewer(); + pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronGuiTypes[SBK_PYVIEWER_IDX], cppResult); + + // Ownership transferences. + Shiboken::Object::getOwnership(pyResult); + } + } + + if (PyErr_Occurred() || !pyResult) { + Py_XDECREF(pyResult); + return 0; + } + return pyResult; +} + static PyObject* Sbk_GuiAppFunc_getDirectoryDialog(PyObject* self, PyObject* args, PyObject* kwds) { ::GuiApp* cppSelf = 0; @@ -210,11 +267,11 @@ static PyObject* Sbk_GuiAppFunc_getDirectoryDialog(PyObject* self, PyObject* arg // Overloaded function decisor - // 0: getDirectoryDialog(std::string)const + // 0: getDirectoryDialog(QString)const if (numArgs == 0) { - overloadId = 0; // getDirectoryDialog(std::string)const - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // getDirectoryDialog(std::string)const + overloadId = 0; // getDirectoryDialog(QString)const + } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0])))) { + overloadId = 0; // getDirectoryDialog(QString)const } // Function signature not found. @@ -229,17 +286,17 @@ static PyObject* Sbk_GuiAppFunc_getDirectoryDialog(PyObject* self, PyObject* arg return 0; } else if (value) { pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) + if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0])))) goto Sbk_GuiAppFunc_getDirectoryDialog_TypeError; } } - ::std::string cppArg0 = std::string(); + ::QString cppArg0 = QString(); if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); if (!PyErr_Occurred()) { - // getDirectoryDialog(std::string)const - std::string cppResult = const_cast(cppSelf)->getDirectoryDialog(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + // getDirectoryDialog(QString)const + QString cppResult = const_cast(cppSelf)->getDirectoryDialog(cppArg0); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -250,7 +307,7 @@ static PyObject* Sbk_GuiAppFunc_getDirectoryDialog(PyObject* self, PyObject* arg return pyResult; Sbk_GuiAppFunc_getDirectoryDialog_TypeError: - const char* overloads[] = {"std::string = std.string()", 0}; + const char* overloads[] = {"unicode = QString()", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronGui.GuiApp.getDirectoryDialog", overloads); return 0; } @@ -284,12 +341,12 @@ static PyObject* Sbk_GuiAppFunc_getFilenameDialog(PyObject* self, PyObject* args // Overloaded function decisor - // 0: getFilenameDialog(std::vector,std::string)const - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_VECTOR_STD_STRING_IDX], (pyArgs[0])))) { + // 0: getFilenameDialog(QStringList,QString)const + if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], (pyArgs[0])))) { if (numArgs == 1) { - overloadId = 0; // getFilenameDialog(std::vector,std::string)const - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // getFilenameDialog(std::vector,std::string)const + overloadId = 0; // getFilenameDialog(QStringList,QString)const + } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // getFilenameDialog(QStringList,QString)const } } @@ -305,19 +362,19 @@ static PyObject* Sbk_GuiAppFunc_getFilenameDialog(PyObject* self, PyObject* args return 0; } else if (value) { pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) + if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) goto Sbk_GuiAppFunc_getFilenameDialog_TypeError; } } - ::std::vector cppArg0; + ::QStringList cppArg0 = ::QStringList(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1 = std::string(); + ::QString cppArg1 = QString(); if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // getFilenameDialog(std::vector,std::string)const - std::string cppResult = const_cast(cppSelf)->getFilenameDialog(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + // getFilenameDialog(QStringList,QString)const + QString cppResult = const_cast(cppSelf)->getFilenameDialog(cppArg0, cppArg1); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -328,7 +385,7 @@ static PyObject* Sbk_GuiAppFunc_getFilenameDialog(PyObject* self, PyObject* args return pyResult; Sbk_GuiAppFunc_getFilenameDialog_TypeError: - const char* overloads[] = {"list, std::string = std.string()", 0}; + const char* overloads[] = {"QStringList, unicode = QString()", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronGui.GuiApp.getFilenameDialog", overloads); return 0; } @@ -475,12 +532,12 @@ static PyObject* Sbk_GuiAppFunc_getSequenceDialog(PyObject* self, PyObject* args // Overloaded function decisor - // 0: getSequenceDialog(std::vector,std::string)const - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_VECTOR_STD_STRING_IDX], (pyArgs[0])))) { + // 0: getSequenceDialog(QStringList,QString)const + if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], (pyArgs[0])))) { if (numArgs == 1) { - overloadId = 0; // getSequenceDialog(std::vector,std::string)const - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // getSequenceDialog(std::vector,std::string)const + overloadId = 0; // getSequenceDialog(QStringList,QString)const + } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // getSequenceDialog(QStringList,QString)const } } @@ -496,19 +553,19 @@ static PyObject* Sbk_GuiAppFunc_getSequenceDialog(PyObject* self, PyObject* args return 0; } else if (value) { pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) + if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) goto Sbk_GuiAppFunc_getSequenceDialog_TypeError; } } - ::std::vector cppArg0; + ::QStringList cppArg0 = ::QStringList(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1 = std::string(); + ::QString cppArg1 = QString(); if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // getSequenceDialog(std::vector,std::string)const - std::string cppResult = const_cast(cppSelf)->getSequenceDialog(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + // getSequenceDialog(QStringList,QString)const + QString cppResult = const_cast(cppSelf)->getSequenceDialog(cppArg0, cppArg1); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -519,7 +576,7 @@ static PyObject* Sbk_GuiAppFunc_getSequenceDialog(PyObject* self, PyObject* args return pyResult; Sbk_GuiAppFunc_getSequenceDialog_TypeError: - const char* overloads[] = {"list, std::string = std.string()", 0}; + const char* overloads[] = {"QStringList, unicode = QString()", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronGui.GuiApp.getSequenceDialog", overloads); return 0; } @@ -537,9 +594,9 @@ static PyObject* Sbk_GuiAppFunc_getTabWidget(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: getTabWidget(std::string)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getTabWidget(std::string)const + // 0: getTabWidget(QString)const + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // getTabWidget(QString)const } // Function signature not found. @@ -547,11 +604,11 @@ static PyObject* Sbk_GuiAppFunc_getTabWidget(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // getTabWidget(std::string)const + // getTabWidget(QString)const PyTabWidget * cppResult = const_cast(cppSelf)->getTabWidget(cppArg0); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX], cppResult); @@ -567,7 +624,7 @@ static PyObject* Sbk_GuiAppFunc_getTabWidget(PyObject* self, PyObject* pyArg) return pyResult; Sbk_GuiAppFunc_getTabWidget_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.GuiApp.getTabWidget", overloads); return 0; } @@ -585,9 +642,9 @@ static PyObject* Sbk_GuiAppFunc_getUserPanel(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: getUserPanel(std::string)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getUserPanel(std::string)const + // 0: getUserPanel(QString)const + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // getUserPanel(QString)const } // Function signature not found. @@ -595,11 +652,11 @@ static PyObject* Sbk_GuiAppFunc_getUserPanel(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // getUserPanel(std::string)const + // getUserPanel(QString)const PyPanel * cppResult = const_cast(cppSelf)->getUserPanel(cppArg0); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronGuiTypes[SBK_PYPANEL_IDX], cppResult); } @@ -612,7 +669,7 @@ static PyObject* Sbk_GuiAppFunc_getUserPanel(PyObject* self, PyObject* pyArg) return pyResult; Sbk_GuiAppFunc_getUserPanel_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.GuiApp.getUserPanel", overloads); return 0; } @@ -630,9 +687,9 @@ static PyObject* Sbk_GuiAppFunc_getViewer(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: getViewer(std::string)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getViewer(std::string)const + // 0: getViewer(QString)const + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // getViewer(QString)const } // Function signature not found. @@ -640,11 +697,11 @@ static PyObject* Sbk_GuiAppFunc_getViewer(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // getViewer(std::string)const + // getViewer(QString)const PyViewer * cppResult = const_cast(cppSelf)->getViewer(cppArg0); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronGuiTypes[SBK_PYVIEWER_IDX], cppResult); @@ -660,7 +717,7 @@ static PyObject* Sbk_GuiAppFunc_getViewer(PyObject* self, PyObject* pyArg) return pyResult; Sbk_GuiAppFunc_getViewer_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.GuiApp.getViewer", overloads); return 0; } @@ -687,11 +744,11 @@ static PyObject* Sbk_GuiAppFunc_moveTab(PyObject* self, PyObject* args) // Overloaded function decisor - // 0: moveTab(std::string,PyTabWidget*) + // 0: moveTab(QString,PyTabWidget*) if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppPointerConvertible((SbkObjectType*)SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX], (pyArgs[1])))) { - overloadId = 0; // moveTab(std::string,PyTabWidget*) + overloadId = 0; // moveTab(QString,PyTabWidget*) } // Function signature not found. @@ -699,7 +756,7 @@ static PyObject* Sbk_GuiAppFunc_moveTab(PyObject* self, PyObject* args) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); if (!Shiboken::Object::isValid(pyArgs[1])) return 0; @@ -707,7 +764,7 @@ static PyObject* Sbk_GuiAppFunc_moveTab(PyObject* self, PyObject* args) pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // moveTab(std::string,PyTabWidget*) + // moveTab(QString,PyTabWidget*) bool cppResult = cppSelf->moveTab(cppArg0, cppArg1); pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); } @@ -720,7 +777,7 @@ static PyObject* Sbk_GuiAppFunc_moveTab(PyObject* self, PyObject* args) return pyResult; Sbk_GuiAppFunc_moveTab_TypeError: - const char* overloads[] = {"std::string, NatronGui.PyTabWidget", 0}; + const char* overloads[] = {"unicode, NatronGui.PyTabWidget", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronGui.GuiApp.moveTab", overloads); return 0; } @@ -746,11 +803,11 @@ static PyObject* Sbk_GuiAppFunc_registerPythonPanel(PyObject* self, PyObject* ar // Overloaded function decisor - // 0: registerPythonPanel(PyPanel*,std::string) + // 0: registerPythonPanel(PyPanel*,QString) if (numArgs == 2 && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppPointerConvertible((SbkObjectType*)SbkNatronGuiTypes[SBK_PYPANEL_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // registerPythonPanel(PyPanel*,std::string) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // registerPythonPanel(PyPanel*,QString) } // Function signature not found. @@ -762,11 +819,11 @@ static PyObject* Sbk_GuiAppFunc_registerPythonPanel(PyObject* self, PyObject* ar return 0; ::PyPanel* cppArg0; pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // registerPythonPanel(PyPanel*,std::string) + // registerPythonPanel(PyPanel*,QString) cppSelf->registerPythonPanel(cppArg0, cppArg1); } } @@ -777,7 +834,7 @@ static PyObject* Sbk_GuiAppFunc_registerPythonPanel(PyObject* self, PyObject* ar Py_RETURN_NONE; Sbk_GuiAppFunc_registerPythonPanel_TypeError: - const char* overloads[] = {"NatronGui.PyPanel, std::string", 0}; + const char* overloads[] = {"NatronGui.PyPanel, unicode", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronGui.GuiApp.registerPythonPanel", overloads); return 0; } @@ -962,12 +1019,12 @@ static PyObject* Sbk_GuiAppFunc_saveFilenameDialog(PyObject* self, PyObject* arg // Overloaded function decisor - // 0: saveFilenameDialog(std::vector,std::string)const - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_VECTOR_STD_STRING_IDX], (pyArgs[0])))) { + // 0: saveFilenameDialog(QStringList,QString)const + if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], (pyArgs[0])))) { if (numArgs == 1) { - overloadId = 0; // saveFilenameDialog(std::vector,std::string)const - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // saveFilenameDialog(std::vector,std::string)const + overloadId = 0; // saveFilenameDialog(QStringList,QString)const + } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // saveFilenameDialog(QStringList,QString)const } } @@ -983,19 +1040,19 @@ static PyObject* Sbk_GuiAppFunc_saveFilenameDialog(PyObject* self, PyObject* arg return 0; } else if (value) { pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) + if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) goto Sbk_GuiAppFunc_saveFilenameDialog_TypeError; } } - ::std::vector cppArg0; + ::QStringList cppArg0 = ::QStringList(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1 = std::string(); + ::QString cppArg1 = QString(); if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // saveFilenameDialog(std::vector,std::string)const - std::string cppResult = const_cast(cppSelf)->saveFilenameDialog(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + // saveFilenameDialog(QStringList,QString)const + QString cppResult = const_cast(cppSelf)->saveFilenameDialog(cppArg0, cppArg1); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -1006,7 +1063,7 @@ static PyObject* Sbk_GuiAppFunc_saveFilenameDialog(PyObject* self, PyObject* arg return pyResult; Sbk_GuiAppFunc_saveFilenameDialog_TypeError: - const char* overloads[] = {"list, std::string = std.string()", 0}; + const char* overloads[] = {"QStringList, unicode = QString()", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronGui.GuiApp.saveFilenameDialog", overloads); return 0; } @@ -1040,12 +1097,12 @@ static PyObject* Sbk_GuiAppFunc_saveSequenceDialog(PyObject* self, PyObject* arg // Overloaded function decisor - // 0: saveSequenceDialog(std::vector,std::string)const - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_VECTOR_STD_STRING_IDX], (pyArgs[0])))) { + // 0: saveSequenceDialog(QStringList,QString)const + if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], (pyArgs[0])))) { if (numArgs == 1) { - overloadId = 0; // saveSequenceDialog(std::vector,std::string)const - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // saveSequenceDialog(std::vector,std::string)const + overloadId = 0; // saveSequenceDialog(QStringList,QString)const + } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // saveSequenceDialog(QStringList,QString)const } } @@ -1061,19 +1118,19 @@ static PyObject* Sbk_GuiAppFunc_saveSequenceDialog(PyObject* self, PyObject* arg return 0; } else if (value) { pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) + if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) goto Sbk_GuiAppFunc_saveSequenceDialog_TypeError; } } - ::std::vector cppArg0; + ::QStringList cppArg0 = ::QStringList(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1 = std::string(); + ::QString cppArg1 = QString(); if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // saveSequenceDialog(std::vector,std::string)const - std::string cppResult = const_cast(cppSelf)->saveSequenceDialog(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + // saveSequenceDialog(QStringList,QString)const + QString cppResult = const_cast(cppSelf)->saveSequenceDialog(cppArg0, cppArg1); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -1084,7 +1141,7 @@ static PyObject* Sbk_GuiAppFunc_saveSequenceDialog(PyObject* self, PyObject* arg return pyResult; Sbk_GuiAppFunc_saveSequenceDialog_TypeError: - const char* overloads[] = {"list, std::string = std.string()", 0}; + const char* overloads[] = {"QStringList, unicode = QString()", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronGui.GuiApp.saveSequenceDialog", overloads); return 0; } @@ -1306,6 +1363,8 @@ static PyMethodDef Sbk_GuiApp_methods[] = { {"clearSelection", (PyCFunction)Sbk_GuiAppFunc_clearSelection, METH_VARARGS|METH_KEYWORDS}, {"createModalDialog", (PyCFunction)Sbk_GuiAppFunc_createModalDialog, METH_NOARGS}, {"deselectNode", (PyCFunction)Sbk_GuiAppFunc_deselectNode, METH_O}, + {"getActiveTabWidget", (PyCFunction)Sbk_GuiAppFunc_getActiveTabWidget, METH_NOARGS}, + {"getActiveViewer", (PyCFunction)Sbk_GuiAppFunc_getActiveViewer, METH_NOARGS}, {"getDirectoryDialog", (PyCFunction)Sbk_GuiAppFunc_getDirectoryDialog, METH_VARARGS|METH_KEYWORDS}, {"getFilenameDialog", (PyCFunction)Sbk_GuiAppFunc_getFilenameDialog, METH_VARARGS|METH_KEYWORDS}, {"getRGBColorDialog", (PyCFunction)Sbk_GuiAppFunc_getRGBColorDialog, METH_NOARGS}, diff --git a/Gui/NatronGui/natrongui_module_wrapper.cpp b/Gui/NatronGui/natrongui_module_wrapper.cpp index 53fff6d5d1..f0b0dcaeef 100644 --- a/Gui/NatronGui/natrongui_module_wrapper.cpp +++ b/Gui/NatronGui/natrongui_module_wrapper.cpp @@ -35,10 +35,10 @@ static PyMethodDef NatronGui_methods[] = { }; // Classes initialization functions ------------------------------------------------------------ -void init_PyViewer(PyObject* module); -void init_PyTabWidget(PyObject* module); void init_PyGuiApplication(PyObject* module); void init_GuiApp(PyObject* module); +void init_PyViewer(PyObject* module); +void init_PyTabWidget(PyObject* module); void init_PyModalDialog(PyObject* module); void init_PyPanel(PyObject* module); @@ -83,73 +83,37 @@ static PythonToCppFunc is__std_list_EffectPTR__PythonToCpp__std_list_EffectPTR__ return 0; } -// C++ to Python conversion for type 'const std::vector &'. -static PyObject* _conststd_vector_std_string_REF_CppToPython__conststd_vector_std_string_REF(const void* cppIn) { - ::std::vector& cppInRef = *((::std::vector*)cppIn); - - // TEMPLATE - stdVectorToPyList - START - ::std::vector::size_type vectorSize = cppInRef.size(); - PyObject* pyOut = PyList_New((int) vectorSize); - for (::std::vector::size_type idx = 0; idx < vectorSize; ++idx) { - ::std::string cppItem(cppInRef[idx]); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppItem)); - } - return pyOut; - // TEMPLATE - stdVectorToPyList - END - -} -static void _conststd_vector_std_string_REF_PythonToCpp__conststd_vector_std_string_REF(PyObject* pyIn, void* cppOut) { - ::std::vector& cppOutRef = *((::std::vector*)cppOut); - - // TEMPLATE - pySeqToStdVector - START - int vectorSize = PySequence_Size(pyIn); - cppOutRef.reserve(vectorSize); - for (int idx = 0; idx < vectorSize; ++idx) { - Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, idx)); - ::std::string cppItem; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), pyItem, &(cppItem)); - cppOutRef.push_back(cppItem); - } - // TEMPLATE - pySeqToStdVector - END - -} -static PythonToCppFunc is__conststd_vector_std_string_REF_PythonToCpp__conststd_vector_std_string_REF_Convertible(PyObject* pyIn) { - if (Shiboken::Conversions::convertibleSequenceTypes(Shiboken::Conversions::PrimitiveTypeConverter(), pyIn)) - return _conststd_vector_std_string_REF_PythonToCpp__conststd_vector_std_string_REF; - return 0; -} - -// C++ to Python conversion for type 'std::list'. -static PyObject* _std_list_std_string__CppToPython__std_list_std_string_(const void* cppIn) { - ::std::list& cppInRef = *((::std::list*)cppIn); +// C++ to Python conversion for type 'std::list'. +static PyObject* _std_list_QString__CppToPython__std_list_QString_(const void* cppIn) { + ::std::list& cppInRef = *((::std::list*)cppIn); // TEMPLATE - stdListToPyList - START PyObject* pyOut = PyList_New((int) cppInRef.size()); - ::std::list::const_iterator it = cppInRef.begin(); + ::std::list::const_iterator it = cppInRef.begin(); for (int idx = 0; it != cppInRef.end(); ++it, ++idx) { - ::std::string cppItem(*it); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppItem)); + ::QString cppItem(*it); + PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppItem)); } return pyOut; // TEMPLATE - stdListToPyList - END } -static void _std_list_std_string__PythonToCpp__std_list_std_string_(PyObject* pyIn, void* cppOut) { - ::std::list& cppOutRef = *((::std::list*)cppOut); +static void _std_list_QString__PythonToCpp__std_list_QString_(PyObject* pyIn, void* cppOut) { + ::std::list& cppOutRef = *((::std::list*)cppOut); // TEMPLATE - pyListToStdList - START for (int i = 0; i < PySequence_Size(pyIn); i++) { Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, i)); - ::std::string cppItem; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), pyItem, &(cppItem)); + ::QString cppItem = ::QString(); + Shiboken::Conversions::pythonToCppCopy(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], pyItem, &(cppItem)); cppOutRef.push_back(cppItem); } // TEMPLATE - pyListToStdList - END } -static PythonToCppFunc is__std_list_std_string__PythonToCpp__std_list_std_string__Convertible(PyObject* pyIn) { - if (Shiboken::Conversions::convertibleSequenceTypes(Shiboken::Conversions::PrimitiveTypeConverter(), pyIn)) - return _std_list_std_string__PythonToCpp__std_list_std_string_; +static PythonToCppFunc is__std_list_QString__PythonToCpp__std_list_QString__Convertible(PyObject* pyIn) { + if (Shiboken::Conversions::convertibleSequenceTypes(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], pyIn)) + return _std_list_QString__PythonToCpp__std_list_QString_; return 0; } @@ -497,10 +461,10 @@ SBK_MODULE_INIT_FUNCTION_BEGIN(NatronGui) #endif // Initialize classes in the type system - init_PyViewer(module); - init_PyTabWidget(module); init_PyGuiApplication(module); init_GuiApp(module); + init_PyViewer(module); + init_PyTabWidget(module); init_PyModalDialog(module); init_PyPanel(module); @@ -511,20 +475,12 @@ SBK_MODULE_INIT_FUNCTION_BEGIN(NatronGui) _std_list_EffectPTR__PythonToCpp__std_list_EffectPTR_, is__std_list_EffectPTR__PythonToCpp__std_list_EffectPTR__Convertible); - // Register converter for type 'const std::vector&'. - SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_VECTOR_STD_STRING_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, _conststd_vector_std_string_REF_CppToPython__conststd_vector_std_string_REF); - Shiboken::Conversions::registerConverterName(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_VECTOR_STD_STRING_IDX], "const std::vector&"); - Shiboken::Conversions::registerConverterName(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_VECTOR_STD_STRING_IDX], "std::vector"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_VECTOR_STD_STRING_IDX], - _conststd_vector_std_string_REF_PythonToCpp__conststd_vector_std_string_REF, - is__conststd_vector_std_string_REF_PythonToCpp__conststd_vector_std_string_REF_Convertible); - - // Register converter for type 'std::list'. - SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_LIST_STD_STRING_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, _std_list_std_string__CppToPython__std_list_std_string_); - Shiboken::Conversions::registerConverterName(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_LIST_STD_STRING_IDX], "std::list"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_LIST_STD_STRING_IDX], - _std_list_std_string__PythonToCpp__std_list_std_string_, - is__std_list_std_string__PythonToCpp__std_list_std_string__Convertible); + // Register converter for type 'std::list'. + SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_LIST_QSTRING_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, _std_list_QString__CppToPython__std_list_QString_); + Shiboken::Conversions::registerConverterName(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_LIST_QSTRING_IDX], "std::list"); + Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_LIST_QSTRING_IDX], + _std_list_QString__PythonToCpp__std_list_QString_, + is__std_list_QString__PythonToCpp__std_list_QString__Convertible); // Register converter for type 'const std::list&'. SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_LIST_INT_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, _conststd_list_int_REF_CppToPython__conststd_list_int_REF); diff --git a/Gui/NatronGui/natrongui_python.h b/Gui/NatronGui/natrongui_python.h index e247946d5e..8a6023c500 100644 --- a/Gui/NatronGui/natrongui_python.h +++ b/Gui/NatronGui/natrongui_python.h @@ -56,8 +56,8 @@ CLANG_DIAG_ON(uninitialized) // Type indices #define SBK_PYTABWIDGET_IDX 4 -#define SBK_GUIAPP_IDX 0 #define SBK_PYVIEWER_IDX 5 +#define SBK_GUIAPP_IDX 0 #define SBK_PYGUIAPPLICATION_IDX 1 #define SBK_PYPANEL_IDX 3 #define SBK_PYMODALDIALOG_IDX 2 @@ -71,17 +71,16 @@ extern SbkConverter** SbkNatronGuiTypeConverters; // Converter indices #define SBK_NATRONGUI_STD_LIST_EFFECTPTR_IDX 0 // std::list -#define SBK_NATRONGUI_STD_VECTOR_STD_STRING_IDX 1 // const std::vector & -#define SBK_NATRONGUI_STD_LIST_STD_STRING_IDX 2 // std::list -#define SBK_NATRONGUI_STD_LIST_INT_IDX 3 // const std::list & -#define SBK_NATRONGUI_QLIST_QACTIONPTR_IDX 4 // QList -#define SBK_NATRONGUI_QLIST_QOBJECTPTR_IDX 5 // const QList & -#define SBK_NATRONGUI_QLIST_QBYTEARRAY_IDX 6 // QList -#define SBK_NATRONGUI_STD_LIST_PARAMPTR_IDX 7 // std::list -#define SBK_NATRONGUI_QLIST_QVARIANT_IDX 8 // QList -#define SBK_NATRONGUI_QLIST_QSTRING_IDX 9 // QList -#define SBK_NATRONGUI_QMAP_QSTRING_QVARIANT_IDX 10 // QMap -#define SBK_NatronGui_CONVERTERS_IDX_COUNT 11 +#define SBK_NATRONGUI_STD_LIST_QSTRING_IDX 1 // std::list +#define SBK_NATRONGUI_STD_LIST_INT_IDX 2 // const std::list & +#define SBK_NATRONGUI_QLIST_QACTIONPTR_IDX 3 // QList +#define SBK_NATRONGUI_QLIST_QOBJECTPTR_IDX 4 // const QList & +#define SBK_NATRONGUI_QLIST_QBYTEARRAY_IDX 5 // QList +#define SBK_NATRONGUI_STD_LIST_PARAMPTR_IDX 6 // std::list +#define SBK_NATRONGUI_QLIST_QVARIANT_IDX 7 // QList +#define SBK_NATRONGUI_QLIST_QSTRING_IDX 8 // QList +#define SBK_NATRONGUI_QMAP_QSTRING_QVARIANT_IDX 9 // QMap +#define SBK_NatronGui_CONVERTERS_IDX_COUNT 10 // Macros for type check @@ -90,8 +89,8 @@ namespace Shiboken // PyType functions, to get the PyObjectType for a type T template<> inline PyTypeObject* SbkType() { return reinterpret_cast(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX]); } -template<> inline PyTypeObject* SbkType() { return reinterpret_cast(SbkNatronGuiTypes[SBK_GUIAPP_IDX]); } template<> inline PyTypeObject* SbkType() { return reinterpret_cast(SbkNatronGuiTypes[SBK_PYVIEWER_IDX]); } +template<> inline PyTypeObject* SbkType() { return reinterpret_cast(SbkNatronGuiTypes[SBK_GUIAPP_IDX]); } template<> inline PyTypeObject* SbkType() { return reinterpret_cast(SbkNatronGuiTypes[SBK_PYGUIAPPLICATION_IDX]); } template<> inline PyTypeObject* SbkType() { return reinterpret_cast(SbkNatronGuiTypes[SBK_PYPANEL_IDX]); } template<> inline PyTypeObject* SbkType() { return reinterpret_cast(SbkNatronGuiTypes[SBK_PYMODALDIALOG_IDX]); } diff --git a/Gui/NatronGui/pyguiapplication_wrapper.cpp b/Gui/NatronGui/pyguiapplication_wrapper.cpp index bc6e1db631..f5334d793a 100644 --- a/Gui/NatronGui/pyguiapplication_wrapper.cpp +++ b/Gui/NatronGui/pyguiapplication_wrapper.cpp @@ -21,7 +21,6 @@ GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING #include #include -#include // Native --------------------------------------------------------- @@ -95,17 +94,17 @@ static PyObject* Sbk_PyGuiApplicationFunc_addMenuCommand(PyObject* self, PyObjec // Overloaded function decisor - // 0: addMenuCommand(std::string,std::string) - // 1: addMenuCommand(std::string,std::string,Qt::Key,QFlags) + // 0: addMenuCommand(QString,QString) + // 1: addMenuCommand(QString,QString,Qt::Key,QFlags) if (numArgs >= 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { if (numArgs == 2) { - overloadId = 0; // addMenuCommand(std::string,std::string) + overloadId = 0; // addMenuCommand(QString,QString) } else if (numArgs == 4 && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(SBK_CONVERTER(SbkPySide_QtCoreTypes[SBK_QT_KEY_IDX]), (pyArgs[2]))) && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(SBK_CONVERTER(SbkPySide_QtCoreTypes[SBK_QFLAGS_QT_KEYBOARDMODIFIER__IDX]), (pyArgs[3])))) { - overloadId = 1; // addMenuCommand(std::string,std::string,Qt::Key,QFlags) + overloadId = 1; // addMenuCommand(QString,QString,Qt::Key,QFlags) } } @@ -114,24 +113,24 @@ static PyObject* Sbk_PyGuiApplicationFunc_addMenuCommand(PyObject* self, PyObjec // Call function/method switch (overloadId) { - case 0: // addMenuCommand(const std::string & grouping, const std::string & pythonFunctionName) + case 0: // addMenuCommand(const QString & grouping, const QString & pythonFunctionName) { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // addMenuCommand(std::string,std::string) + // addMenuCommand(QString,QString) cppSelf->addMenuCommand(cppArg0, cppArg1); } break; } - case 1: // addMenuCommand(const std::string & grouping, const std::string & pythonFunctionName, Qt::Key key, const QFlags & modifiers) + case 1: // addMenuCommand(const QString & grouping, const QString & pythonFunctionName, Qt::Key key, const QFlags & modifiers) { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); ::Qt::Key cppArg2 = ((::Qt::Key)0); pythonToCpp[2](pyArgs[2], &cppArg2); @@ -139,7 +138,7 @@ static PyObject* Sbk_PyGuiApplicationFunc_addMenuCommand(PyObject* self, PyObjec pythonToCpp[3](pyArgs[3], &cppArg3); if (!PyErr_Occurred()) { - // addMenuCommand(std::string,std::string,Qt::Key,QFlags) + // addMenuCommand(QString,QString,Qt::Key,QFlags) cppSelf->addMenuCommand(cppArg0, cppArg1, cppArg2, cppArg3); } break; @@ -152,7 +151,7 @@ static PyObject* Sbk_PyGuiApplicationFunc_addMenuCommand(PyObject* self, PyObjec Py_RETURN_NONE; Sbk_PyGuiApplicationFunc_addMenuCommand_TypeError: - const char* overloads[] = {"std::string, std::string", "std::string, std::string, PySide.QtCore.Qt.Key, PySide.QtCore.Qt.KeyboardModifiers", 0}; + const char* overloads[] = {"unicode, unicode", "unicode, unicode, PySide.QtCore.Qt.Key, PySide.QtCore.Qt.KeyboardModifiers", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronGui.PyGuiApplication.addMenuCommand", overloads); return 0; } @@ -178,11 +177,11 @@ static PyObject* Sbk_PyGuiApplicationFunc_errorDialog(PyObject* self, PyObject* // Overloaded function decisor - // 0: errorDialog(std::string,std::string) + // 0: errorDialog(QString,QString) if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // errorDialog(std::string,std::string) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // errorDialog(QString,QString) } // Function signature not found. @@ -190,13 +189,13 @@ static PyObject* Sbk_PyGuiApplicationFunc_errorDialog(PyObject* self, PyObject* // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // errorDialog(std::string,std::string) + // errorDialog(QString,QString) cppSelf->errorDialog(cppArg0, cppArg1); } } @@ -207,7 +206,7 @@ static PyObject* Sbk_PyGuiApplicationFunc_errorDialog(PyObject* self, PyObject* Py_RETURN_NONE; Sbk_PyGuiApplicationFunc_errorDialog_TypeError: - const char* overloads[] = {"std::string, std::string", 0}; + const char* overloads[] = {"unicode, unicode", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronGui.PyGuiApplication.errorDialog", overloads); return 0; } @@ -281,11 +280,11 @@ static PyObject* Sbk_PyGuiApplicationFunc_informationDialog(PyObject* self, PyOb // Overloaded function decisor - // 0: informationDialog(std::string,std::string) + // 0: informationDialog(QString,QString) if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // informationDialog(std::string,std::string) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // informationDialog(QString,QString) } // Function signature not found. @@ -293,13 +292,13 @@ static PyObject* Sbk_PyGuiApplicationFunc_informationDialog(PyObject* self, PyOb // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // informationDialog(std::string,std::string) + // informationDialog(QString,QString) cppSelf->informationDialog(cppArg0, cppArg1); } } @@ -310,7 +309,7 @@ static PyObject* Sbk_PyGuiApplicationFunc_informationDialog(PyObject* self, PyOb Py_RETURN_NONE; Sbk_PyGuiApplicationFunc_informationDialog_TypeError: - const char* overloads[] = {"std::string, std::string", 0}; + const char* overloads[] = {"unicode, unicode", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronGui.PyGuiApplication.informationDialog", overloads); return 0; } @@ -336,11 +335,11 @@ static PyObject* Sbk_PyGuiApplicationFunc_warningDialog(PyObject* self, PyObject // Overloaded function decisor - // 0: warningDialog(std::string,std::string) + // 0: warningDialog(QString,QString) if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // warningDialog(std::string,std::string) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { + overloadId = 0; // warningDialog(QString,QString) } // Function signature not found. @@ -348,13 +347,13 @@ static PyObject* Sbk_PyGuiApplicationFunc_warningDialog(PyObject* self, PyObject // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); if (!PyErr_Occurred()) { - // warningDialog(std::string,std::string) + // warningDialog(QString,QString) cppSelf->warningDialog(cppArg0, cppArg1); } } @@ -365,7 +364,7 @@ static PyObject* Sbk_PyGuiApplicationFunc_warningDialog(PyObject* self, PyObject Py_RETURN_NONE; Sbk_PyGuiApplicationFunc_warningDialog_TypeError: - const char* overloads[] = {"std::string, std::string", 0}; + const char* overloads[] = {"unicode, unicode", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronGui.PyGuiApplication.warningDialog", overloads); return 0; } diff --git a/Gui/NatronGui/pymodaldialog_wrapper.cpp b/Gui/NatronGui/pymodaldialog_wrapper.cpp index 23bee0b44c..a143f29ec1 100644 --- a/Gui/NatronGui/pymodaldialog_wrapper.cpp +++ b/Gui/NatronGui/pymodaldialog_wrapper.cpp @@ -1382,9 +1382,9 @@ static PyObject* Sbk_PyModalDialogFunc_getParam(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: getParam(std::string)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getParam(std::string)const + // 0: getParam(QString)const + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // getParam(QString)const } // Function signature not found. @@ -1392,11 +1392,11 @@ static PyObject* Sbk_PyModalDialogFunc_getParam(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // getParam(std::string)const + // getParam(QString)const Param * cppResult = const_cast(cppSelf)->getParam(cppArg0); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_PARAM_IDX], cppResult); @@ -1412,7 +1412,7 @@ static PyObject* Sbk_PyModalDialogFunc_getParam(PyObject* self, PyObject* pyArg) return pyResult; Sbk_PyModalDialogFunc_getParam_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyModalDialog.getParam", overloads); return 0; } @@ -1486,9 +1486,9 @@ static PyObject* Sbk_PyModalDialogFunc_setParamChangedCallback(PyObject* self, P SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: setParamChangedCallback(std::string) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setParamChangedCallback(std::string) + // 0: setParamChangedCallback(QString) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // setParamChangedCallback(QString) } // Function signature not found. @@ -1496,11 +1496,11 @@ static PyObject* Sbk_PyModalDialogFunc_setParamChangedCallback(PyObject* self, P // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // setParamChangedCallback(std::string) + // setParamChangedCallback(QString) cppSelf->setParamChangedCallback(cppArg0); } } @@ -1511,7 +1511,7 @@ static PyObject* Sbk_PyModalDialogFunc_setParamChangedCallback(PyObject* self, P Py_RETURN_NONE; Sbk_PyModalDialogFunc_setParamChangedCallback_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyModalDialog.setParamChangedCallback", overloads); return 0; } diff --git a/Gui/NatronGui/pypanel_wrapper.cpp b/Gui/NatronGui/pypanel_wrapper.cpp index eba5469bdb..35b4a649ab 100644 --- a/Gui/NatronGui/pypanel_wrapper.cpp +++ b/Gui/NatronGui/pypanel_wrapper.cpp @@ -65,7 +65,7 @@ void PyPanelWrapper::pysideInitQtMetaTypes() { } -PyPanelWrapper::PyPanelWrapper(const std::string & scriptName, const std::string & label, bool useUserParameters, GuiApp * app) : PyPanel(scriptName, label, useUserParameters, app) { +PyPanelWrapper::PyPanelWrapper(const QString & scriptName, const QString & label, bool useUserParameters, GuiApp * app) : PyPanel(scriptName, label, useUserParameters, app) { // ... middle } @@ -1075,7 +1075,7 @@ void PyPanelWrapper::resizeEvent(QResizeEvent * event) Shiboken::Object::invalidate(PyTuple_GET_ITEM(pyArgs, 0)); } -void PyPanelWrapper::restore(const std::string & arg__1) +void PyPanelWrapper::restore(const QString & arg__1) { Shiboken::GilState gil; if (PyErr_Occurred()) @@ -1087,7 +1087,7 @@ void PyPanelWrapper::restore(const std::string & arg__1) } Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)", - Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &arg__1) + Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &arg__1) )); Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, NULL)); @@ -1098,11 +1098,11 @@ void PyPanelWrapper::restore(const std::string & arg__1) } } -std::string PyPanelWrapper::save() +QString PyPanelWrapper::save() { Shiboken::GilState gil; if (PyErr_Occurred()) - return ::std::string(); + return ::QString(); Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, "save")); if (pyOverride.isNull()) { gil.release(); @@ -1115,15 +1115,15 @@ std::string PyPanelWrapper::save() // An error happened in python code! if (pyResult.isNull()) { PyErr_Print(); - return ::std::string(); + return ::QString(); } // Check return type - PythonToCppFunc pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), pyResult); + PythonToCppFunc pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], pyResult); if (!pythonToCpp) { - Shiboken::warning(PyExc_RuntimeWarning, 2, "Invalid return value in function %s, expected %s, got %s.", "PyPanel.save", "string", pyResult->ob_type->tp_name); - return ::std::string(); + Shiboken::warning(PyExc_RuntimeWarning, 2, "Invalid return value in function %s, expected %s, got %s.", "PyPanel.save", "QString", pyResult->ob_type->tp_name); + return ::QString(); } - ::std::string cppResult; + ::QString cppResult = ::QString(); pythonToCpp(pyResult, &cppResult); return cppResult; } @@ -1350,13 +1350,13 @@ Sbk_PyPanel_Init(PyObject* self, PyObject* args, PyObject* kwds) // Overloaded function decisor - // 0: PyPanel(std::string,std::string,bool,GuiApp*) + // 0: PyPanel(QString,QString,bool,GuiApp*) if (numArgs == 4 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) + && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) + && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1]))) && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppPointerConvertible((SbkObjectType*)SbkNatronGuiTypes[SBK_GUIAPP_IDX], (pyArgs[3])))) { - overloadId = 0; // PyPanel(std::string,std::string,bool,GuiApp*) + overloadId = 0; // PyPanel(QString,QString,bool,GuiApp*) } // Function signature not found. @@ -1364,9 +1364,9 @@ Sbk_PyPanel_Init(PyObject* self, PyObject* args, PyObject* kwds) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp[0](pyArgs[0], &cppArg0); - ::std::string cppArg1; + ::QString cppArg1 = ::QString(); pythonToCpp[1](pyArgs[1], &cppArg1); bool cppArg2; pythonToCpp[2](pyArgs[2], &cppArg2); @@ -1376,7 +1376,7 @@ Sbk_PyPanel_Init(PyObject* self, PyObject* args, PyObject* kwds) pythonToCpp[3](pyArgs[3], &cppArg3); if (!PyErr_Occurred()) { - // PyPanel(std::string,std::string,bool,GuiApp*) + // PyPanel(QString,QString,bool,GuiApp*) void* addr = PySide::nextQObjectMemoryAddr(); if (addr) { cptr = new (addr) ::PyPanelWrapper(cppArg0, cppArg1, cppArg2, cppArg3); @@ -1408,7 +1408,7 @@ Sbk_PyPanel_Init(PyObject* self, PyObject* args, PyObject* kwds) return 1; Sbk_PyPanel_Init_TypeError: - const char* overloads[] = {"std::string, std::string, bool, NatronGui.GuiApp", 0}; + const char* overloads[] = {"unicode, unicode, bool, NatronGui.GuiApp", 0}; Shiboken::setErrorAboutWrongArguments(args, "NatronGui.PyPanel", overloads); return -1; } @@ -1471,8 +1471,8 @@ static PyObject* Sbk_PyPanelFunc_getPanelLabel(PyObject* self) if (!PyErr_Occurred()) { // getPanelLabel()const - std::string cppResult = const_cast(cppSelf)->getPanelLabel(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = const_cast(cppSelf)->getPanelLabel(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -1497,8 +1497,8 @@ static PyObject* Sbk_PyPanelFunc_getPanelScriptName(PyObject* self) if (!PyErr_Occurred()) { // getPanelScriptName()const - std::string cppResult = const_cast(cppSelf)->getPanelScriptName(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = const_cast(cppSelf)->getPanelScriptName(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -1522,9 +1522,9 @@ static PyObject* Sbk_PyPanelFunc_getParam(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: getParam(std::string)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getParam(std::string)const + // 0: getParam(QString)const + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // getParam(QString)const } // Function signature not found. @@ -1532,11 +1532,11 @@ static PyObject* Sbk_PyPanelFunc_getParam(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // getParam(std::string)const + // getParam(QString)const Param * cppResult = const_cast(cppSelf)->getParam(cppArg0); pyResult = Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_PARAM_IDX], cppResult); @@ -1552,7 +1552,7 @@ static PyObject* Sbk_PyPanelFunc_getParam(PyObject* self, PyObject* pyArg) return pyResult; Sbk_PyPanelFunc_getParam_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyPanel.getParam", overloads); return 0; } @@ -1689,9 +1689,9 @@ static PyObject* Sbk_PyPanelFunc_restore(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: restore(std::string) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // restore(std::string) + // 0: restore(QString) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // restore(QString) } // Function signature not found. @@ -1699,11 +1699,11 @@ static PyObject* Sbk_PyPanelFunc_restore(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // restore(std::string) + // restore(QString) Shiboken::Object::hasCppWrapper(reinterpret_cast(self)) ? cppSelf->::PyPanel::restore(cppArg0) : cppSelf->restore(cppArg0); } } @@ -1714,7 +1714,7 @@ static PyObject* Sbk_PyPanelFunc_restore(PyObject* self, PyObject* pyArg) Py_RETURN_NONE; Sbk_PyPanelFunc_restore_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyPanel.restore", overloads); return 0; } @@ -1733,8 +1733,8 @@ static PyObject* Sbk_PyPanelFunc_save(PyObject* self) if (!PyErr_Occurred()) { // save() - std::string cppResult = ((::PyPanelWrapper*) cppSelf)->PyPanelWrapper::save_protected(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = ((::PyPanelWrapper*) cppSelf)->PyPanelWrapper::save_protected(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -1757,9 +1757,9 @@ static PyObject* Sbk_PyPanelFunc_setPanelLabel(PyObject* self, PyObject* pyArg) SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: setPanelLabel(std::string) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setPanelLabel(std::string) + // 0: setPanelLabel(QString) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // setPanelLabel(QString) } // Function signature not found. @@ -1767,11 +1767,11 @@ static PyObject* Sbk_PyPanelFunc_setPanelLabel(PyObject* self, PyObject* pyArg) // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // setPanelLabel(std::string) + // setPanelLabel(QString) cppSelf->setPanelLabel(cppArg0); } } @@ -1782,7 +1782,7 @@ static PyObject* Sbk_PyPanelFunc_setPanelLabel(PyObject* self, PyObject* pyArg) Py_RETURN_NONE; Sbk_PyPanelFunc_setPanelLabel_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyPanel.setPanelLabel", overloads); return 0; } @@ -1799,9 +1799,9 @@ static PyObject* Sbk_PyPanelFunc_setParamChangedCallback(PyObject* self, PyObjec SBK_UNUSED(pythonToCpp) // Overloaded function decisor - // 0: setParamChangedCallback(std::string) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setParamChangedCallback(std::string) + // 0: setParamChangedCallback(QString) + if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { + overloadId = 0; // setParamChangedCallback(QString) } // Function signature not found. @@ -1809,11 +1809,11 @@ static PyObject* Sbk_PyPanelFunc_setParamChangedCallback(PyObject* self, PyObjec // Call function/method { - ::std::string cppArg0; + ::QString cppArg0 = ::QString(); pythonToCpp(pyArg, &cppArg0); if (!PyErr_Occurred()) { - // setParamChangedCallback(std::string) + // setParamChangedCallback(QString) cppSelf->setParamChangedCallback(cppArg0); } } @@ -1824,7 +1824,7 @@ static PyObject* Sbk_PyPanelFunc_setParamChangedCallback(PyObject* self, PyObjec Py_RETURN_NONE; Sbk_PyPanelFunc_setParamChangedCallback_TypeError: - const char* overloads[] = {"std::string", 0}; + const char* overloads[] = {"unicode", 0}; Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyPanel.setParamChangedCallback", overloads); return 0; } diff --git a/Gui/NatronGui/pypanel_wrapper.h b/Gui/NatronGui/pypanel_wrapper.h index 4e5f624f1d..c4fee3c8e0 100644 --- a/Gui/NatronGui/pypanel_wrapper.h +++ b/Gui/NatronGui/pypanel_wrapper.h @@ -11,7 +11,7 @@ NATRON_NAMESPACE_ENTER; NATRON_PYTHON_NAMESPACE_ENTER; class PyPanelWrapper : public PyPanel { public: - PyPanelWrapper(const std::string & scriptName, const std::string & label, bool useUserParameters, GuiApp * app); + PyPanelWrapper(const QString & scriptName, const QString & label, bool useUserParameters, GuiApp * app); inline void actionEvent_protected(QActionEvent * event) { PyPanel::actionEvent(event); } virtual void actionEvent(QActionEvent * event); inline void changeEvent_protected(QEvent * event) { PyPanel::changeEvent(event); } @@ -87,9 +87,9 @@ class PyPanelWrapper : public PyPanel inline void resetInputContext_protected() { PyPanel::resetInputContext(); } inline void resizeEvent_protected(QResizeEvent * event) { PyPanel::resizeEvent(event); } virtual void resizeEvent(QResizeEvent * event); - virtual void restore(const std::string & arg__1); - inline std::string save_protected() { return PyPanel::save(); } - virtual std::string save(); + virtual void restore(const QString & arg__1); + inline QString save_protected() { return PyPanel::save(); } + virtual QString save(); inline QObject * sender_protected() const { return PyPanel::sender(); } inline int senderSignalIndex_protected() const { return PyPanel::senderSignalIndex(); } virtual void setVisible(bool visible); diff --git a/Gui/NatronGui/pytabwidget_wrapper.cpp b/Gui/NatronGui/pytabwidget_wrapper.cpp index a634083de8..f1cd87a7ef 100644 --- a/Gui/NatronGui/pytabwidget_wrapper.cpp +++ b/Gui/NatronGui/pytabwidget_wrapper.cpp @@ -306,8 +306,8 @@ static PyObject* Sbk_PyTabWidgetFunc_getScriptName(PyObject* self) if (!PyErr_Occurred()) { // getScriptName()const - std::string cppResult = const_cast(cppSelf)->getScriptName(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = const_cast(cppSelf)->getScriptName(); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } @@ -346,8 +346,8 @@ static PyObject* Sbk_PyTabWidgetFunc_getTabLabel(PyObject* self, PyObject* pyArg if (!PyErr_Occurred()) { // getTabLabel(int)const - std::string cppResult = const_cast(cppSelf)->getTabLabel(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); + QString cppResult = const_cast(cppSelf)->getTabLabel(cppArg0); + pyResult = Shiboken::Conversions::copyToPython(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); } } diff --git a/Gui/NewLayerDialog.cpp b/Gui/NewLayerDialog.cpp index 8c32e57e3a..c1fe40e6b3 100644 --- a/Gui/NewLayerDialog.cpp +++ b/Gui/NewLayerDialog.cpp @@ -122,10 +122,11 @@ struct NewLayerDialogPrivate } }; -NewLayerDialog::NewLayerDialog(QWidget* parent) +NewLayerDialog::NewLayerDialog(const ImageComponents& original, QWidget* parent) : QDialog(parent) , _imp(new NewLayerDialogPrivate()) { + _imp->mainLayout = new QGridLayout(this); _imp->layerLabel = new Label(tr("Layer Name"),this); _imp->layerEdit = new LineEdit(this); @@ -178,7 +179,22 @@ NewLayerDialog::NewLayerDialog(QWidget* parent) _imp->mainLayout->addWidget(_imp->buttons, 7, 0, 1, 2); - + if (original.getNumComponents() != 0) { + _imp->layerEdit->setText(QString::fromUtf8(original.getLayerName().c_str())); + + LineEdit* edits[4] = {_imp->rEdit, _imp->gEdit, _imp->bEdit, _imp->aEdit}; + Label* labels[4] = {_imp->rLabel, _imp->gLabel, _imp->bLabel, _imp->aLabel}; + const std::vector& channels = original.getComponentsNames(); + for (int i = 0; i < 4; ++i) { + if (i >= (int)channels.size() ) { + edits[i]->setVisible(false); + labels[i]->setVisible(false); + } else { + edits[i]->setText(QString::fromUtf8(channels[i].c_str())); + } + } + _imp->numCompsBox->setValue((double)channels.size()); + } } @@ -238,7 +254,14 @@ NewLayerDialog::getComponents() const QString g = _imp->gEdit->text(); QString b = _imp->bEdit->text(); QString a = _imp->aEdit->text(); - std::string layerFixed = NATRON_PYTHON_NAMESPACE::makeNameScriptFriendly(layer.toStdString()); + + std::string layerFixed = NATRON_PYTHON_NAMESPACE::makeNameScriptFriendlyWithDots(layer.toStdString()); + + std::string rFixed = NATRON_PYTHON_NAMESPACE::makeNameScriptFriendlyWithDots(r.toStdString()); + std::string gFixed = NATRON_PYTHON_NAMESPACE::makeNameScriptFriendlyWithDots(g.toStdString()); + std::string bFixed = NATRON_PYTHON_NAMESPACE::makeNameScriptFriendlyWithDots(b.toStdString()); + std::string aFixed = NATRON_PYTHON_NAMESPACE::makeNameScriptFriendlyWithDots(a.toStdString()); + if (layerFixed.empty()) { return ImageComponents::getNoneComponents(); } @@ -249,47 +272,47 @@ NewLayerDialog::getComponents() const } std::vector comps; std::string compsGlobal; - comps.push_back(a.toStdString()); - compsGlobal.append(a.toStdString()); + comps.push_back(aFixed); + compsGlobal.append(aFixed); return ImageComponents(layerFixed,compsGlobal,comps); } else if (nComps == 2) { - if (r.isEmpty() || g.isEmpty()) { + if (rFixed.empty() || gFixed.empty()) { return ImageComponents::getNoneComponents(); } std::vector comps; std::string compsGlobal; - comps.push_back(r.toStdString()); - compsGlobal.append(r.toStdString()); - comps.push_back(g.toStdString()); - compsGlobal.append(g.toStdString()); + comps.push_back(rFixed); + compsGlobal.append(rFixed); + comps.push_back(gFixed); + compsGlobal.append(gFixed); return ImageComponents(layerFixed,compsGlobal,comps); } else if (nComps == 3) { - if (r.isEmpty() || g.isEmpty() || b.isEmpty()) { + if (rFixed.empty() || gFixed.empty() || bFixed.empty()) { return ImageComponents::getNoneComponents(); } std::vector comps; std::string compsGlobal; - comps.push_back(r.toStdString()); - compsGlobal.append(r.toStdString()); - comps.push_back(g.toStdString()); - compsGlobal.append(g.toStdString()); - comps.push_back(b.toStdString()); - compsGlobal.append(b.toStdString()); + comps.push_back(rFixed); + compsGlobal.append(rFixed); + comps.push_back(gFixed); + compsGlobal.append(gFixed); + comps.push_back(bFixed); + compsGlobal.append(bFixed); return ImageComponents(layerFixed,compsGlobal,comps); } else if (nComps == 4) { - if (r.isEmpty() || g.isEmpty() || b.isEmpty() | a.isEmpty()) { + if (rFixed.empty() || gFixed.empty() || bFixed.empty() || aFixed.empty()) { return ImageComponents::getNoneComponents(); } std::vector comps; std::string compsGlobal; - comps.push_back(r.toStdString()); - compsGlobal.append(r.toStdString()); - comps.push_back(g.toStdString()); - compsGlobal.append(g.toStdString()); - comps.push_back(b.toStdString()); - compsGlobal.append(b.toStdString()); - comps.push_back(a.toStdString()); - compsGlobal.append(a.toStdString()); + comps.push_back(rFixed); + compsGlobal.append(rFixed); + comps.push_back(gFixed); + compsGlobal.append(gFixed); + comps.push_back(bFixed); + compsGlobal.append(bFixed); + comps.push_back(aFixed); + compsGlobal.append(aFixed); return ImageComponents(layerFixed,compsGlobal,comps); } return ImageComponents::getNoneComponents(); diff --git a/Gui/NewLayerDialog.h b/Gui/NewLayerDialog.h index 05bba15448..ceebb98c75 100644 --- a/Gui/NewLayerDialog.h +++ b/Gui/NewLayerDialog.h @@ -47,7 +47,7 @@ class NewLayerDialog : public QDialog Q_OBJECT public: - NewLayerDialog(QWidget* parent); + NewLayerDialog(const ImageComponents& original, QWidget* parent); virtual ~NewLayerDialog(); diff --git a/Gui/NodeGraph.cpp b/Gui/NodeGraph.cpp index db602641ac..fbcce08edc 100644 --- a/Gui/NodeGraph.cpp +++ b/Gui/NodeGraph.cpp @@ -84,7 +84,6 @@ NodeGraph::NodeGraph(Gui* gui, group->setNodeGraphPointer(this); - setAcceptDrops(true); setAttribute(Qt::WA_MacShowFocusRect,0); NodeGroup* isGrp = dynamic_cast(group.get()); @@ -175,6 +174,8 @@ NodeGraph::NodeGraph(Gui* gui, setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + + setAcceptDrops(false); _imp->_menu = new Menu(this); @@ -415,9 +416,9 @@ NodeGraph::createNodeGUI(const NodePtr & node, _imp->_nodes.push_back(node_ui); } - NodeGroup* parentIsGroup = dynamic_cast(node->getGroup().get());; + //NodeGroup* parentIsGroup = dynamic_cast(node->getGroup().get());; - if (args.reason != eCreateNodeReasonProjectLoad && (!getGui()->getApp()->isCreatingPythonGroup() || node->isEffectGroup()) && !parentIsGroup) { + if (args.reason != eCreateNodeReasonProjectLoad && args.reason != eCreateNodeReasonCopyPaste && ((!getGui()->getApp()->isCreatingPythonGroup()) || isGrp) ) { node_ui->ensurePanelCreated(); } diff --git a/Gui/NodeGraph.h b/Gui/NodeGraph.h index 876517ef20..40abc3e764 100644 --- a/Gui/NodeGraph.h +++ b/Gui/NodeGraph.h @@ -25,6 +25,11 @@ #include // ***** END PYTHON BLOCK ***** +#include +#include +#include +#include + #include "Global/Macros.h" #if !defined(Q_MOC_RUN) && !defined(SBK_RUN) @@ -163,7 +168,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON void pasteCliboard(const NodeClipBoard& clipboard,std::list >* newNodes); void duplicateSelectedNodes(const QPointF& pos); - void pasteNodeClipBoards(const QPointF& pos); + bool pasteNodeClipBoards(const QPointF& pos); void cloneSelectedNodes(const QPointF& pos); QPointF getRootPos() const; @@ -206,7 +211,7 @@ public Q_SLOTS: void copySelectedNodes(); void cutSelectedNodes(); - void pasteNodeClipBoards(); + bool pasteNodeClipBoards(); void duplicateSelectedNodes(); void cloneSelectedNodes(); void decloneSelectedNodes(); @@ -264,16 +269,29 @@ public Q_SLOTS: virtual void resizeEvent(QResizeEvent* e) OVERRIDE FINAL; virtual void paintEvent(QPaintEvent* e) OVERRIDE FINAL; virtual void wheelEvent(QWheelEvent* e) OVERRIDE FINAL; - virtual void dropEvent(QDropEvent* e) OVERRIDE FINAL; - virtual void dragEnterEvent(QDragEnterEvent* e) OVERRIDE FINAL; - virtual void dragMoveEvent(QDragMoveEvent* e) OVERRIDE FINAL; - virtual void dragLeaveEvent(QDragLeaveEvent* e) OVERRIDE FINAL; virtual void focusInEvent(QFocusEvent* e) OVERRIDE FINAL; virtual void focusOutEvent(QFocusEvent* e) OVERRIDE FINAL; virtual QUndoStack* getUndoStack() const OVERRIDE FINAL WARN_UNUSED_RETURN; private: + enum NearbyItemEnum + { + eNearbyItemNone = 0, + eNearbyItemNode, + eNearbyItemBackdropResizeHandle, + eNearbyItemBackdropFrame, + eNearbyItemNodeEdge, + eNearbyItemEdgeBendPoint, + + }; + + void getNodesWithinViewportRect(const QRect& rect, std::set* nodes) const; + + NearbyItemEnum hasItemNearbyMouse(const QPoint& mousePosViewport, + NodeGui** node, + Edge** edge); + void moveRootInternal(double dx, double dy); void wheelEventInternal(bool ctrlDown,double delta); diff --git a/Gui/NodeGraph10.cpp b/Gui/NodeGraph10.cpp index 96059c27da..97cdea6a0c 100644 --- a/Gui/NodeGraph10.cpp +++ b/Gui/NodeGraph10.cpp @@ -44,6 +44,7 @@ GCC_DIAG_UNUSED_PRIVATE_FIELD_ON #include "Gui/Edge.h" #include "Gui/Gui.h" #include "Gui/GuiAppInstance.h" +#include "Gui/GuiApplicationManager.h" #include "Gui/GuiMacros.h" #include "Gui/NodeGui.h" #include "Gui/NodeSettingsPanel.h" @@ -52,6 +53,107 @@ GCC_DIAG_UNUSED_PRIVATE_FIELD_ON NATRON_NAMESPACE_ENTER; +static NodeGui* isNodeGuiChild(QGraphicsItem* item) +{ + NodeGui* n = dynamic_cast(item); + if (n) { + return n; + } + QGraphicsItem* parent = item->parentItem(); + if (parent) { + return isNodeGuiChild(parent); + } else { + return 0; + } +} + +static Edge* isEdgeChild(QGraphicsItem* item) +{ + Edge* n = dynamic_cast(item); + if (n) { + return n; + } + QGraphicsItem* parent = item->parentItem(); + if (parent) { + return isEdgeChild(parent); + } else { + return 0; + } +} + +void +NodeGraph::getNodesWithinViewportRect(const QRect& rect, std::set* nodes) const +{ + QList selectedItems = items(rect, Qt::IntersectsItemShape); + for (QList::Iterator it = selectedItems.begin(); it!=selectedItems.end(); ++it) { + NodeGui* n = isNodeGuiChild(*it); + if (n) { + nodes->insert(n); + } + } +} + +NodeGraph::NearbyItemEnum +NodeGraph::hasItemNearbyMouse(const QPoint& mousePosViewport, + NodeGui** node, + Edge** edge) +{ + assert(node && edge); + *node = 0; + *edge = 0; + double tolerance = TO_DPIX(10.); + QRect toleranceRect(mousePosViewport.x() - tolerance / 2., + mousePosViewport.y() - tolerance / 2., + tolerance, + tolerance); + QList selectedItems = items(toleranceRect, Qt::IntersectsItemShape); + std::set edges; + std::set nodes; + for (QList::Iterator it = selectedItems.begin(); it!=selectedItems.end(); ++it) { + Edge* isEdge = isEdgeChild(*it); + if (isEdge) { + edges.insert(isEdge); + } + NodeGui* n = isNodeGuiChild(*it); + if (n) { + nodes.insert(n); + } + } + + for (std::set::iterator it = nodes.begin(); it!=nodes.end(); ++it) { + if ( (*it)->isVisible() && (*it)->isActive() ) { + + QPointF localPoint = (*it)->mapFromScene(mapToScene(mousePosViewport)); + BackdropGui* isBd = dynamic_cast(*it); + if (isBd) { + if (isBd->isNearbyNameFrame(localPoint)) { + *node = *it; + return eNearbyItemBackdropFrame; + } else if (isBd->isNearbyResizeHandle(localPoint)) { + *node = *it; + return eNearbyItemBackdropResizeHandle; + } + } else { + *node = *it; + return eNearbyItemNode; + } + + } + + } + if (!edges.empty()) { + *edge = *edges.begin(); + + QPointF scenePos = mapToScene(mousePosViewport); + if ((*edge)->hasSource() && (*edge)->isBendPointVisible() && (*edge)->isNearbyBendPoint(scenePos)) { + return eNearbyItemEdgeBendPoint; + } else { + return eNearbyItemNodeEdge; + } + return eNearbyItemNodeEdge; + } + return eNearbyItemNone; +} void NodeGraph::mousePressEvent(QMouseEvent* e) @@ -92,6 +194,7 @@ NodeGraph::mousePressEvent(QMouseEvent* e) groupEdited = isGroup->getNode()->hasPyPlugBeenEdited(); } + if (!groupEdited) { if (isGroupEditable) { @@ -120,74 +223,35 @@ NodeGraph::mousePressEvent(QMouseEvent* e) } } - - NodeGuiPtr selected; - Edge* selectedEdge = 0; - Edge* selectedBendPoint = 0; - { - - QMutexLocker l(&_imp->_nodesMutex); - - ///Find matches, sorted by depth - std::map matches; - for (NodesGuiList::reverse_iterator it = _imp->_nodes.rbegin(); it != _imp->_nodes.rend(); ++it) { - QPointF evpt = (*it)->mapFromScene(lastMousePosScene); - if ( (*it)->isVisible() && (*it)->isActive() ) { - - BackdropGui* isBd = dynamic_cast(it->get()); - if (isBd) { - if (isBd->isNearbyNameFrame(evpt)) { - matches.insert(std::make_pair((*it)->zValue(),*it)); - } else if (isBd->isNearbyResizeHandle(evpt) && groupEdited) { - selected = *it; - _imp->_backdropResized = *it; - _imp->_evtState = eEventStateResizingBackdrop; - break; - } - } else { - if ((*it)->contains(evpt)) { - matches.insert(std::make_pair((*it)->zValue(),*it)); - } - } - - } - } - if (!matches.empty() && _imp->_evtState != eEventStateResizingBackdrop) { - selected = matches.rbegin()->second; - } - if (!selected) { - ///try to find a selected edge - for (NodesGuiList::reverse_iterator it = _imp->_nodes.rbegin(); it != _imp->_nodes.rend(); ++it) { - Edge* bendPointEdge = (*it)->hasBendPointNearbyPoint(lastMousePosScene); - - if (bendPointEdge) { - selectedBendPoint = bendPointEdge; - break; - } - Edge* edge = (*it)->hasEdgeNearbyPoint(lastMousePosScene); - if (edge) { - selectedEdge = edge; - } - - } - } + NodeGui* nearbyNode; + Edge* nearbyEdge; + NearbyItemEnum nearbyItemCode = hasItemNearbyMouse(e->pos(), &nearbyNode, &nearbyEdge); + if (nearbyItemCode == eNearbyItemBackdropResizeHandle) { + assert(nearbyNode); + didSomething = true; + _imp->_backdropResized = nearbyNode->shared_from_this(); + _imp->_evtState = eEventStateResizingBackdrop; } - if (selected) { + if ((nearbyItemCode == eNearbyItemNode || nearbyItemCode == eNearbyItemBackdropFrame) && groupEdited) { + assert(nearbyNode); + + NodeGuiPtr selectedNode = nearbyNode->shared_from_this(); + didSomething = true; - if ( buttonDownIsLeft(e) ) { + if (buttonDownIsLeft(e)) { - BackdropGui* isBd = dynamic_cast(selected.get()); + BackdropGui* isBd = dynamic_cast(selectedNode.get()); if (!isBd) { - _imp->_magnifiedNode = selected; + _imp->_magnifiedNode = selectedNode; } - if ( !selected->getIsSelected() ) { - selectNode( selected, modCASIsShift(e) ); + if (!selectedNode->getIsSelected()) { + selectNode(selectedNode, modCASIsShift(e)); } else if ( modCASIsShift(e) ) { NodesGuiList::iterator it = std::find(_imp->_selection.begin(), - _imp->_selection.end(),selected); + _imp->_selection.end(),selectedNode); if ( it != _imp->_selection.end() ) { (*it)->setUserSelected(false); _imp->_selection.erase(it); @@ -205,20 +269,22 @@ NodeGraph::mousePressEvent(QMouseEvent* e) _imp->_nodesWithinBDAtPenDown.insert(std::make_pair(*it,nodesWithin)); } } - - } else if ( buttonDownIsRight(e) ) { - if ( !selected->getIsSelected() ) { - selectNode(selected,true); ///< don't wipe the selection + + } else if (buttonDownIsRight(e)) { + if ( !selectedNode->getIsSelected() ) { + selectNode(selectedNode,true); //< don't wipe the selection } } - } else if (selectedBendPoint && groupEdited) { + } + + if (nearbyItemCode == eNearbyItemEdgeBendPoint && groupEdited) { _imp->setNodesBendPointsVisible(false); - + assert(nearbyEdge); ///Now connect the node to the edge input - NodePtr inputNode = selectedBendPoint->getSource()->getNode(); + NodePtr inputNode = nearbyEdge->getSource()->getNode(); assert(inputNode); ///disconnect previous connection - NodePtr outputNode = selectedBendPoint->getDest()->getNode(); + NodePtr outputNode = nearbyEdge->getDest()->getNode(); assert(outputNode); int inputNb = outputNode->inputIndex(inputNode); if (inputNb == -1) { @@ -269,8 +335,9 @@ NodeGraph::mousePressEvent(QMouseEvent* e) _imp->_evtState = eEventStateDraggingNode; didSomething = true; - } else if (selectedEdge && groupEdited) { - _imp->_arrowSelected = selectedEdge; + } else if (nearbyItemCode == eNearbyItemNodeEdge && groupEdited) { + assert(nearbyEdge); + _imp->_arrowSelected = nearbyEdge; didSomething = true; _imp->_evtState = eEventStateDraggingArrow; } diff --git a/Gui/NodeGraph15.cpp b/Gui/NodeGraph15.cpp index 19c723a926..2e7a25df96 100644 --- a/Gui/NodeGraph15.cpp +++ b/Gui/NodeGraph15.cpp @@ -125,7 +125,6 @@ NodeGraph::mouseReleaseEvent(QMouseEvent* e) bool hasMovedOnce = modCASIsControl(e) || _imp->_hasMovedOnce; if (state == eEventStateDraggingArrow && hasMovedOnce) { - QRectF sceneR = visibleSceneRect(); bool foundSrc = false; assert(_imp->_arrowSelected); @@ -133,59 +132,49 @@ NodeGraph::mouseReleaseEvent(QMouseEvent* e) _imp->_arrowSelected->getSource() : _imp->_arrowSelected->getDest(); assert(nodeHoldingEdge); - NodesGuiList nodes = getAllActiveNodes_mt_safe(); - QPointF ep = mapToScene( e->pos() ); - for (NodesGuiList::iterator it = _imp->_nodes.begin(); it != _imp->_nodes.end(); ++it) { - NodeGuiPtr & n = *it; - - BackdropGui* isBd = dynamic_cast(n.get()); - if (isBd) { - continue; - } - - QRectF bbox = n->mapToScene(n->boundingRect()).boundingRect(); - - if (n->isActive() && n->isVisible() && bbox.intersects(sceneR) && - n->isNearby(ep) && - n->getNode()->getScriptName() != nodeHoldingEdge->getNode()->getScriptName()) { + NodeGui* nearbyNode; + Edge* nearbyEdge; + NearbyItemEnum nearbyItemCode = hasItemNearbyMouse(e->pos(), &nearbyNode, &nearbyEdge); + + if (nearbyItemCode == eNearbyItemNode) { + NodeGuiPtr targetNode = nearbyNode->shared_from_this(); + if (targetNode != nodeHoldingEdge) { - if ( !_imp->_arrowSelected->isOutputEdge() ) { + if (!_imp->_arrowSelected->isOutputEdge()) { - bool ok = handleConnectionError(nodeHoldingEdge, n, _imp->_arrowSelected->getInputNumber()); - _imp->_arrowSelected->stackBefore( n.get() ); - if (!ok) { - break; + bool ok = handleConnectionError(nodeHoldingEdge, targetNode, _imp->_arrowSelected->getInputNumber()); + _imp->_arrowSelected->stackBefore( targetNode.get() ); + if (ok) { + foundSrc = true; + pushUndoCommand(new ConnectCommand(this,_imp->_arrowSelected,_imp->_arrowSelected->getSource(),targetNode)); } - pushUndoCommand( new ConnectCommand(this,_imp->_arrowSelected,_imp->_arrowSelected->getSource(),n) ); } else { - ///Find the input edge of the node we just released the mouse over, - ///and use that edge to connect to the source of the selected edge. - int preferredInput = n->getNode()->getPreferredInputForConnection(); - if (preferredInput != -1) { - - bool ok = handleConnectionError(n, nodeHoldingEdge, preferredInput); - if (!ok) { - break; + // Find the input edge of the node we just released the mouse over, + // and use that edge to connect to the source of the selected edge. + int preferredInput = targetNode->getNode()->getPreferredInputForConnection(); + if (preferredInput != -1) { + bool ok = handleConnectionError(targetNode, nodeHoldingEdge, preferredInput); + if (ok) { + + Edge* foundInput = targetNode->getInputArrow(preferredInput); + assert(foundInput); + foundSrc = true; + pushUndoCommand(new ConnectCommand(this,foundInput, + foundInput->getSource(),_imp->_arrowSelected->getSource())); } - - Edge* foundInput = n->getInputArrow(preferredInput); - assert(foundInput); - pushUndoCommand( new ConnectCommand( this,foundInput, - foundInput->getSource(),_imp->_arrowSelected->getSource() ) ); } } - foundSrc = true; - break; } } - ///if we disconnected the input edge, use the undo/redo stack. - ///Output edges can never be really connected, they're just there - ///So the user understands some nodes can have output - if ( !foundSrc && !_imp->_arrowSelected->isOutputEdge() && _imp->_arrowSelected->getSource() ) { - pushUndoCommand( new ConnectCommand( this,_imp->_arrowSelected,_imp->_arrowSelected->getSource(), - NodeGuiPtr() ) ); + + // If we disconnected the input edge, use the undo/redo stack. + // Output edges can never be really connected, they're just there + // So the user understands some nodes can have output + if (!foundSrc && !_imp->_arrowSelected->isOutputEdge() && _imp->_arrowSelected->getSource()) { + pushUndoCommand(new ConnectCommand(this,_imp->_arrowSelected,_imp->_arrowSelected->getSource(), + NodeGuiPtr())); } diff --git a/Gui/NodeGraph20.cpp b/Gui/NodeGraph20.cpp index c28834227c..61a8b6cd12 100644 --- a/Gui/NodeGraph20.cpp +++ b/Gui/NodeGraph20.cpp @@ -89,9 +89,12 @@ NodeGraph::checkForHints(bool shiftdown, bool controlDown, const NodeGuiPtr& sel NodePtr selectedNodeInternalNode = selectedNode->getNode(); bool selectedNodeIsReader = selectedNodeInternalNode->getEffectInstance()->isReader() || selectedNodeInternalNode->getMaxInputCount() == 0; Edge* edge = 0; + + std::set nodesWithinRect; + getNodesWithinViewportRect(visibleWidgetRect(), &nodesWithinRect); + { - QMutexLocker l(&_imp->_nodesMutex); - for (NodesGuiList::iterator it = _imp->_nodes.begin(); it != _imp->_nodes.end(); ++it) { + for (std::set::iterator it = nodesWithinRect.begin(); it != nodesWithinRect.end(); ++it) { bool isAlreadyAnOutput = false; const NodesWList& outputs = internalNode->getGuiOutputs(); @@ -109,7 +112,7 @@ NodeGraph::checkForHints(bool shiftdown, bool controlDown, const NodeGuiPtr& sel continue; } QRectF nodeBbox = (*it)->boundingRectWithEdges(); - if ((*it) != selectedNode && (*it)->isVisible() && nodeBbox.intersects(visibleSceneR)) { + if ((*it) != selectedNode.get() && (*it)->isVisible() && nodeBbox.intersects(visibleSceneR)) { if (doMergeHints) { @@ -139,7 +142,7 @@ NodeGraph::checkForHints(bool shiftdown, bool controlDown, const NodeGuiPtr& sel } } if (isValid) { - nodeToShowMergeRect = *it; + nodeToShowMergeRect = (*it)->shared_from_this(); } } else { (*it)->setMergeHintActive(false); @@ -430,38 +433,41 @@ NodeGraph::mouseMoveEvent(QMouseEvent* e) QRectF sceneR = visibleSceneRect(); if (groupEdited && _imp->_evtState != eEventStateSelectionRect && _imp->_evtState != eEventStateDraggingArrow) { - ///set cursor + // Set cursor + + std::set visibleNodes; + getNodesWithinViewportRect(visibleWidgetRect(), &visibleNodes); + NodeGuiPtr selected; Edge* selectedEdge = 0; - { - bool optionalInputsAutoHidden = areOptionalInputsAutoHidden(); - QMutexLocker l(&_imp->_nodesMutex); - for (NodesGuiList::iterator it = _imp->_nodes.begin(); it != _imp->_nodes.end(); ++it) { - QPointF evpt = (*it)->mapFromScene(newPos); - - QRectF bbox = (*it)->mapToScene((*it)->boundingRect()).boundingRect(); - if ((*it)->isActive() && bbox.intersects(sceneR)) { - if ((*it)->contains(evpt)) { - selected = (*it); - if (optionalInputsAutoHidden) { - (*it)->refreshEdgesVisility(true); - } else { - break; - } + + bool optionalInputsAutoHidden = areOptionalInputsAutoHidden(); + + for (std::set::iterator it = visibleNodes.begin(); it!=visibleNodes.end(); ++it) { + QPointF evpt = (*it)->mapFromScene(newPos); + + QRectF bbox = (*it)->mapToScene((*it)->boundingRect()).boundingRect(); + if ((*it)->isActive() && bbox.intersects(sceneR)) { + if ((*it)->contains(evpt)) { + selected = (*it)->shared_from_this(); + if (optionalInputsAutoHidden) { + (*it)->refreshEdgesVisility(true); } else { - Edge* edge = (*it)->hasEdgeNearbyPoint(newPos); - if (edge) { - selectedEdge = edge; - if (!optionalInputsAutoHidden) { - break; - } - } else if (optionalInputsAutoHidden && !(*it)->getIsSelected()) { - (*it)->refreshEdgesVisility(false); + break; + } + } else { + Edge* edge = (*it)->hasEdgeNearbyPoint(newPos); + if (edge) { + selectedEdge = edge; + if (!optionalInputsAutoHidden) { + break; } + } else if (optionalInputsAutoHidden && !(*it)->getIsSelected()) { + (*it)->refreshEdgesVisility(false); } } - } + } if (selected) { _imp->cursorSet = true; diff --git a/Gui/NodeGraph25.cpp b/Gui/NodeGraph25.cpp index 725d006c65..5600077e8a 100644 --- a/Gui/NodeGraph25.cpp +++ b/Gui/NodeGraph25.cpp @@ -66,31 +66,22 @@ void NodeGraph::mouseDoubleClickEvent(QMouseEvent* e) { - QPointF lastMousePosScene = mapToScene(_imp->_lastMousePos); + NodeGui* nearbyNode; + Edge* nearbyEdge; + NearbyItemEnum nearbyItemCode = hasItemNearbyMouse(e->pos(), &nearbyNode, &nearbyEdge); - NodesGuiList nodes = getAllActiveNodes_mt_safe(); - - ///Matches sorted by depth - std::map matches; - for (NodesGuiList::iterator it = nodes.begin(); it != nodes.end(); ++it) { - QPointF evpt = (*it)->mapFromScene(lastMousePosScene); - if ( (*it)->isVisible() && (*it)->isActive() && (*it)->contains(evpt) ) { - matches.insert(std::make_pair((*it)->zValue(), *it)); - } - } - if (!matches.empty()) { - const NodeGuiPtr& node = matches.rbegin()->second; + if (nearbyItemCode == eNearbyItemNode) { if (modCASIsControl(e)) { - node->ensurePanelCreated(); - if (node->getSettingPanel()) { - node->getSettingPanel()->floatPanel(); + nearbyNode->ensurePanelCreated(); + if (nearbyNode->getSettingPanel()) { + nearbyNode->getSettingPanel()->floatPanel(); } } else { - node->setVisibleSettingsPanel(true); - if (node->getSettingPanel()) { - getGui()->putSettingsPanelFirst( node->getSettingPanel() ); + nearbyNode->setVisibleSettingsPanel(true); + if (nearbyNode->getSettingPanel()) { + getGui()->putSettingsPanelFirst(nearbyNode->getSettingPanel()); } else { - ViewerInstance* isViewer = node->getNode()->isEffectViewer(); + ViewerInstance* isViewer = nearbyNode->getNode()->isEffectViewer(); if (isViewer) { ViewerGL* viewer = dynamic_cast(isViewer->getUiContext()); assert(viewer); @@ -129,12 +120,12 @@ NodeGraph::mouseDoubleClickEvent(QMouseEvent* e) } } } - if ( !node->wasBeginEditCalled() ) { - node->beginEditKnobs(); + if (!nearbyNode->wasBeginEditCalled()) { + nearbyNode->beginEditKnobs(); } if (modCASIsShift(e)) { - NodeGroup* isGrp = node->getNode()->isEffectGroup(); + NodeGroup* isGrp = nearbyNode->getNode()->isEffectGroup(); if (isGrp) { NodeGraphI* graph_i = isGrp->getNodeGraph(); assert(graph_i); @@ -260,7 +251,9 @@ NodeGraph::keyPressEvent(QKeyEvent* e) } else if ( isKeybind(kShortcutGroupNodegraph, kShortcutIDActionGraphCopy, modifiers, key) ) { copySelectedNodes(); } else if ( isKeybind(kShortcutGroupNodegraph, kShortcutIDActionGraphPaste, modifiers, key) ) { - pasteNodeClipBoards(); + if (!pasteNodeClipBoards()) { + accept = false; + } } else if ( isKeybind(kShortcutGroupNodegraph, kShortcutIDActionGraphCut, modifiers, key) ) { cutSelectedNodes(); } else if ( isKeybind(kShortcutGroupNodegraph, kShortcutIDActionGraphDuplicate, modifiers, key) ) { diff --git a/Gui/NodeGraph30.cpp b/Gui/NodeGraph30.cpp index 68c56b45a9..b3a2836614 100644 --- a/Gui/NodeGraph30.cpp +++ b/Gui/NodeGraph30.cpp @@ -334,9 +334,8 @@ NodeGraph::deleteSelection() "parameters from which other parameters " "of the project rely on through expressions " "or links. Deleting this node will " - "remove these expressions. " - ". Undoing the action will not recover " - "them. \nContinue anyway ?") + "may break these expressions." + "\nContinue anyway ?") .toStdString(), false ); if (reply == eStandardButtonNo) { return; diff --git a/Gui/NodeGraph35.cpp b/Gui/NodeGraph35.cpp index 36c989c66d..ba0a77b1e5 100644 --- a/Gui/NodeGraph35.cpp +++ b/Gui/NodeGraph35.cpp @@ -481,108 +481,5 @@ NodeGraph::showMenu(const QPoint & pos) } } -void -NodeGraph::dropEvent(QDropEvent* e) -{ - if ( !e->mimeData()->hasUrls() ) { - return; - } - - QStringList filesList; - QList urls = e->mimeData()->urls(); - for (int i = 0; i < urls.size(); ++i) { - const QUrl rl = QtCompat::toLocalFileUrlFixed(urls.at(i)); - QString path = rl.toLocalFile(); - -#ifdef __NATRON_WIN32__ - if ( !path.isEmpty() && ( path.at(0) == QLatin1Char('/') || path.at(0) == QLatin1Char('\\') ) ) { - path = path.remove(0,1); - } - path = FileSystemModel::mapPathWithDriveLetterToPathWithNetworkShareName(path); - -#endif - - - QDir dir(path); - - //if the path dropped is not a directory append it - if ( !dir.exists() ) { - filesList << path; - } else { - //otherwise append everything inside the dir recursively - SequenceFileDialog::appendFilesFromDirRecursively(&dir,&filesList); - } - } - - QStringList supportedExtensions; - supportedExtensions.push_back(QString::fromLatin1(NATRON_PROJECT_FILE_EXT)); - ///get all the decoders - std::map readersForFormat; - appPTR->getCurrentSettings()->getFileFormatsForReadingAndReader(&readersForFormat); - for (std::map::const_iterator it = readersForFormat.begin(); it != readersForFormat.end(); ++it) { - supportedExtensions.push_back( QString::fromUtf8(it->first.c_str()) ); - } - QPointF scenePos = mapToScene(e->pos()); - std::vector< boost::shared_ptr > files = SequenceFileDialog::fileSequencesFromFilesList(filesList,supportedExtensions); - std::locale local; - for (U32 i = 0; i < files.size(); ++i) { - - - boost::shared_ptr & sequence = files[i]; - if (sequence->count() < 1) { - continue; - } - - ///find a decoder for this file type - std::string ext = sequence->fileExtension(); - std::string extLower; - for (size_t j = 0; j < ext.size(); ++j) { - extLower.append( 1,std::tolower( ext.at(j),local ) ); - } - if (extLower == NATRON_PROJECT_FILE_EXT) { - const std::map& content = sequence->getFrameIndexes(); - assert(!content.empty()); - (void)getGui()->openProject(content.begin()->second.absoluteFileName()); - } else { - std::map::iterator found = readersForFormat.find(extLower); - if ( found == readersForFormat.end() ) { - Dialogs::errorDialog("Reader", "No plugin capable of decoding " + extLower + " was found."); - } else { - - std::string pattern = sequence->generateValidSequencePattern(); - - CreateNodeArgs args(QString::fromUtf8(found->second.c_str()), eCreateNodeReasonUserCreate, getGroup()); - args.xPosHint = scenePos.x(); - args.yPosHint = scenePos.y(); - args.paramValues.push_back(createDefaultValueForParam(kOfxImageEffectFileParamName, pattern)); - - NodePtr n = getGui()->getApp()->createNode(args); - - //And offset scenePos by the Width of the previous node created if several nodes are created - double w,h; - n->getSize(&w, &h); - scenePos.rx() += (w + 10); - } - } - } -} // dropEvent - -void -NodeGraph::dragEnterEvent(QDragEnterEvent* e) -{ - e->accept(); -} - -void -NodeGraph::dragLeaveEvent(QDragLeaveEvent* e) -{ - e->accept(); -} - -void -NodeGraph::dragMoveEvent(QDragMoveEvent* e) -{ - e->accept(); -} NATRON_NAMESPACE_EXIT; diff --git a/Gui/NodeGraph40.cpp b/Gui/NodeGraph40.cpp index 5f7f26f1b5..1f6dbb0713 100644 --- a/Gui/NodeGraph40.cpp +++ b/Gui/NodeGraph40.cpp @@ -157,13 +157,13 @@ NodeGraph::pasteCliboard(const NodeClipBoard& clipboard,std::listpasteNodesInternal(clipboard,position, false, newNodes); } -void +bool NodeGraph::pasteNodeClipBoards(const QPointF& pos) { QClipboard* clipboard = QApplication::clipboard(); const QMimeData* mimedata = clipboard->mimeData(); if (!mimedata->hasFormat(QLatin1String("text/plain"))) { - return; + return false; } QByteArray data = mimedata->data(QLatin1String("text/plain")); @@ -179,17 +179,17 @@ NodeGraph::pasteNodeClipBoards(const QPointF& pos) boost::archive::xml_iarchive iArchive(ss); iArchive >> boost::serialization::make_nvp("Clipboard",cb); } catch (...) { - Dialogs::errorDialog(tr("Paste").toStdString(), tr("Clipboard does not contain a Natron graph").toStdString()); - return; + return false; } _imp->pasteNodesInternal(cb,pos, true, &newNodes); + return true; } -void +bool NodeGraph::pasteNodeClipBoards() { QPointF position = _imp->_root->mapFromScene(mapToScene(mapFromGlobal(QCursor::pos()))); - pasteNodeClipBoards(position); + return pasteNodeClipBoards(position); } diff --git a/Gui/NodeGraphPrivate10.cpp b/Gui/NodeGraphPrivate10.cpp index 8e4050f6c0..b33a3097e3 100644 --- a/Gui/NodeGraphPrivate10.cpp +++ b/Gui/NodeGraphPrivate10.cpp @@ -158,7 +158,6 @@ NodeGraphPrivate::pasteNode(const boost::shared_ptr & interna args.serialization = internalSerialization; NodePtr n = _publicInterface->getGui()->getApp()->createNode(args); - assert(n); if (!n) { return NodeGuiPtr(); } diff --git a/Gui/NodeGraphUndoRedo.cpp b/Gui/NodeGraphUndoRedo.cpp index f07dc5f8ea..14e15bb72b 100644 --- a/Gui/NodeGraphUndoRedo.cpp +++ b/Gui/NodeGraphUndoRedo.cpp @@ -197,7 +197,7 @@ AddMultipleNodesCommand::redo() _graph->setSelection(nodes); } - + _graph->getGui()->getApp()->recheckInvalidExpressions(); _graph->getGui()->getApp()->triggerAutoSave(); for (std::list::const_iterator it = nodes.begin(); it != nodes.end(); ++it) { diff --git a/Gui/NodeGui.cpp b/Gui/NodeGui.cpp index 65d2b88072..44c2cd0cc9 100644 --- a/Gui/NodeGui.cpp +++ b/Gui/NodeGui.cpp @@ -378,7 +378,7 @@ NodeGui::restoreStateAfterCreation() { NodePtr internalNode = getNode(); ///Refresh the disabled knob - + setColorFromGrouping(); boost::shared_ptr disabledknob = internalNode->getDisabledKnob(); if (disabledknob && disabledknob->getValue()) { @@ -390,6 +390,7 @@ NodeGui::restoreStateAfterCreation() } ///Refresh the name in the line edit onInternalNameChanged( QString::fromUtf8(internalNode->getLabel().c_str()) ); + onOutputLayerChanged(); internalNode->refreshIdentityState(); onPersistentMessageChanged(); } @@ -2387,6 +2388,47 @@ static QString makeLinkString(Node* masterNode,KnobI* master,Node* slaveNode,Kno return tt; } +void +NodeGui::onKnobExpressionChanged(const KnobGui* knob) +{ + KnobPtr internalKnob = knob->getKnob(); + + for (KnobGuiLinks::iterator it = _knobsLinks.begin(); it != _knobsLinks.end(); ++it) { + + int totalLinks = 0; + int totalInvalid = 0; + + bool isCurrentLink = false; + + for (std::list::iterator it2 = it->second.knobs.begin(); it2 != it->second.knobs.end(); ++it2) { + KnobPtr slave = it2->slave.lock(); + if (slave == internalKnob) { + isCurrentLink = true; + } + int ndims = slave->getDimension(); + int invalid = 0; + for (int i = 0; i < ndims; ++i) { + if (!slave->getExpression(i).empty() && !slave->isExpressionValid(i, 0)) { + ++invalid; + } + } + totalLinks += it2->dimensions.size(); + totalInvalid += invalid; + + it2->linkInValid = invalid; + + } + if (isCurrentLink) { + if (totalLinks > 0) { + it->second.arrow->setVisible(totalLinks > totalInvalid); + } + break; + } + } + + +} + void NodeGui::onKnobsLinksChanged() { @@ -2424,26 +2466,30 @@ NodeGui::onKnobsLinksChanged() KnobGuiLinks::iterator foundGuiLink = masterNode ? _knobsLinks.find(it->masterNode) : _knobsLinks.end(); if (foundGuiLink != _knobsLinks.end()) { - - //We already have a link to the master node - bool found = false; + std::list::iterator found = foundGuiLink->second.knobs.end(); - for (std::list >::iterator it2 = foundGuiLink->second.knobs.begin(); it2 != foundGuiLink->second.knobs.end(); ++it2) { - if (it2->first == it->slave && it2->second == it->master) { - found = true; + for (std::list::iterator it2 = foundGuiLink->second.knobs.begin(); it2 != foundGuiLink->second.knobs.end(); ++it2) { + if (it2->slave.lock() == it->slave.lock() && it2->master.lock() == it->master.lock()) { + found = it2; break; } } - if (!found) { + if (found == foundGuiLink->second.knobs.end()) { ///There's no link for this knob, add info to the tooltip of the link arrow - - foundGuiLink->second.knobs.push_back(std::make_pair(it->slave,it->master)); + LinkedKnob k; + k.slave = it->slave; + k.master = it->master; + k.dimensions.insert(it->dimension); + k.linkInValid = 0; + foundGuiLink->second.knobs.push_back(k); QString fullTooltip; - for (std::list >::iterator it2 = foundGuiLink->second.knobs.begin(); it2 != foundGuiLink->second.knobs.end(); ++it2) { - QString tt = makeLinkString(masterNode.get(),it2->second,node.get(),it2->first); + for (std::list::iterator it2 = foundGuiLink->second.knobs.begin(); it2 != foundGuiLink->second.knobs.end(); ++it2) { + QString tt = makeLinkString(masterNode.get(),it2->master.lock().get(),node.get(),it2->slave.lock().get()); fullTooltip.append(tt); } + } else { + found->dimensions.insert(it->dimension); } } else { @@ -2452,20 +2498,25 @@ NodeGui::onKnobsLinksChanged() boost::shared_ptr master_i = masterNode->getNodeGui(); NodeGuiPtr master = boost::dynamic_pointer_cast(master_i); assert(master); + LinkArrow* arrow = new LinkArrow( master,thisShared,parentItem() ); arrow->setWidth(2); arrow->setColor( QColor(143,201,103) ); arrow->setArrowHeadColor( QColor(200,255,200) ); - QString tt = makeLinkString(masterNode.get(),it->master,node.get(),it->slave); + QString tt = makeLinkString(masterNode.get(),it->master.lock().get(),node.get(),it->slave.lock().get()); arrow->setToolTip(tt); if ( !getDagGui()->areKnobLinksVisible() ) { arrow->setVisible(false); } - LinkedDim guilink; - guilink.knobs.push_back(std::make_pair(it->slave,it->master)); + LinkedDim& guilink = _knobsLinks[it->masterNode]; guilink.arrow = arrow; - _knobsLinks.insert(std::make_pair(it->masterNode,guilink)); + LinkedKnob k; + k.slave = it->slave; + k.master = it->master; + k.dimensions.insert(it->dimension); + k.linkInValid = 0; + guilink.knobs.push_back(k); } } diff --git a/Gui/NodeGui.h b/Gui/NodeGui.h index fd12f9828f..7d8fd77951 100644 --- a/Gui/NodeGui.h +++ b/Gui/NodeGui.h @@ -28,6 +28,7 @@ #include "Global/Macros.h" #include +#include #include #include #include @@ -408,6 +409,8 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON virtual void onIdentityStateChanged(int inputNb) OVERRIDE FINAL; void copyPreviewImageBuffer(const std::vector& data, int width, int height); + + void onKnobExpressionChanged(const KnobGui* knob); protected: @@ -640,9 +643,30 @@ public Q_SLOTS: boost::weak_ptr _masterNodeGui; ///For each knob that has a link to another parameter, display an arrow + struct LinkedKnob { + + KnobWPtr master; + KnobWPtr slave; + + // Is this link valid (counter for all dimensions) + int linkInValid; + + // The dimensions of the slave linked to the master + std::set dimensions; + + LinkedKnob() + : master() + , slave() + , linkInValid(false) + , dimensions() + { + + } + + }; struct LinkedDim { - std::list > knobs; + std::list knobs; LinkArrow* arrow; }; diff --git a/Gui/ProjectGui.cpp b/Gui/ProjectGui.cpp index 47b37ad0b2..8d96edb26f 100644 --- a/Gui/ProjectGui.cpp +++ b/Gui/ProjectGui.cpp @@ -399,6 +399,9 @@ void loadNodeGuiSerialization(Gui* gui, tab->setInfobarVisible(found->second.infobarVisible); tab->setTimelineVisible(found->second.timelineVisible); tab->setCheckerboardEnabled(found->second.checkerboardEnabled); + if (!found->second.layerName.empty()) { + tab->setCurrentLayers(QString::fromUtf8(found->second.layerName.c_str()), QString::fromUtf8(found->second.alphaLayerName.c_str())); + } if (found->second.isPauseEnabled[0] && found->second.isPauseEnabled[1]) { tab->setViewerPaused(true, true); @@ -556,9 +559,9 @@ ProjectGui::load(boost::archive::xml_iarchive & ar if (found != registeredTabs.end()) { NATRON_PYTHON_NAMESPACE::PyPanel* panel = dynamic_cast(found->second.first); if (panel) { - panel->restore((*it)->userData); + panel->restore(QString::fromUtf8((*it)->userData.c_str())); for (std::list >::iterator it2 = (*it)->knobs.begin(); it2!=(*it)->knobs.end(); ++it2) { - NATRON_PYTHON_NAMESPACE::Param* param = panel->getParam((*it2)->getName()); + NATRON_PYTHON_NAMESPACE::Param* param = panel->getParam(QString::fromUtf8((*it2)->getName().c_str())); if (param) { param->getInternalKnob()->clone((*it2)->getKnob()); delete param; diff --git a/Gui/ProjectGuiSerialization.cpp b/Gui/ProjectGuiSerialization.cpp index bb921a0ecc..8419009910 100644 --- a/Gui/ProjectGuiSerialization.cpp +++ b/Gui/ProjectGuiSerialization.cpp @@ -113,6 +113,8 @@ ProjectGuiSerialization::initialize(const ProjectGui* projectGui) viewerData.fpsLocked = tab->isFPSLocked(); viewerData.isPauseEnabled[0] = tab->isViewerPaused(0); viewerData.isPauseEnabled[1] = tab->isViewerPaused(1); + viewerData.layerName = tab->getCurrentLayerName().toStdString(); + viewerData.alphaLayerName = tab->getCurrentAlphaLayerName().toStdString(); tab->getTimelineBounds(&viewerData.leftBound, &viewerData.rightBound); tab->getActiveInputs(&viewerData.aChoice, &viewerData.bChoice); viewerData.version = VIEWER_DATA_SERIALIZATION_VERSION; @@ -303,7 +305,7 @@ PythonPanelSerialization::initialize(NATRON_PYTHON_NAMESPACE::PyPanel* tab,const delete *it; } - userData = tab->save_serialization_thread(); + userData = tab->save_serialization_thread().toStdString(); } NATRON_NAMESPACE_EXIT; diff --git a/Gui/ProjectGuiSerialization.h b/Gui/ProjectGuiSerialization.h index 7d2124c30e..f77163537b 100644 --- a/Gui/ProjectGuiSerialization.h +++ b/Gui/ProjectGuiSerialization.h @@ -65,7 +65,8 @@ GCC_DIAG_ON(unused-parameter) #define VIEWER_DATA_INTRODUCES_GAMMA 10 #define VIEWER_DATA_INTRODUCES_ACTIVE_INPUTS 11 #define VIEWER_DATA_INTRODUCES_PAUSE_VIEWER 12 -#define VIEWER_DATA_SERIALIZATION_VERSION VIEWER_DATA_INTRODUCES_PAUSE_VIEWER +#define VIEWER_DATA_INTRODUCES_LAYER 13 +#define VIEWER_DATA_SERIALIZATION_VERSION VIEWER_DATA_INTRODUCES_LAYER #define PROJECT_GUI_INTRODUCES_BACKDROPS 2 #define PROJECT_GUI_REMOVES_ALL_NODE_PREVIEW_TOGGLED 3 @@ -110,6 +111,7 @@ struct ViewerData int mipMapLevel; std::string colorSpace; std::string channels; + std::string layerName,alphaLayerName; bool zoomOrPanSinceLastFit; int wipeCompositingOp; @@ -158,6 +160,10 @@ struct ViewerData gamma = 1.; } ar & ::boost::serialization::make_nvp("ColorSpace",colorSpace); + if (version >= VIEWER_DATA_INTRODUCES_LAYER) { + ar & ::boost::serialization::make_nvp("Layer",layerName); + ar & ::boost::serialization::make_nvp("AlphaLayer",alphaLayerName); + } ar & ::boost::serialization::make_nvp("Channels",channels); ar & ::boost::serialization::make_nvp("RenderScaleActivated",renderScaleActivated); ar & ::boost::serialization::make_nvp("MipMapLevel",mipMapLevel); diff --git a/Gui/PyGlobalGui.h b/Gui/PyGlobalGui.h index 395171a891..5e0e7c66c8 100644 --- a/Gui/PyGlobalGui.h +++ b/Gui/PyGlobalGui.h @@ -79,36 +79,36 @@ class PyGuiApplication : public PyCoreApplication return new GuiApp(app); } - void informationDialog(const std::string& title,const std::string& message) + void informationDialog(const QString& title,const QString& message) { - Dialogs::informationDialog(title, message); + Dialogs::informationDialog(title.toStdString(), message.toStdString()); } - void warningDialog(const std::string& title,const std::string& message) + void warningDialog(const QString& title,const QString& message) { - Dialogs::warningDialog(title,message); + Dialogs::warningDialog(title.toStdString(),message.toStdString()); } - void errorDialog(const std::string& title,const std::string& message) + void errorDialog(const QString& title,const QString& message) { - Dialogs::errorDialog(title,message); + Dialogs::errorDialog(title.toStdString(),message.toStdString()); } - StandardButtonEnum questionDialog(const std::string& title,const std::string& message) + StandardButtonEnum questionDialog(const QString& title,const QString& message) { - return Dialogs::questionDialog(title, message, false); + return Dialogs::questionDialog(title.toStdString(), message.toStdString(), false); } - void addMenuCommand(const std::string& grouping,const std::string& pythonFunctionName) + void addMenuCommand(const QString& grouping,const QString& pythonFunctionName) { - appPTR->addCommand(QString::fromUtf8(grouping.c_str()), pythonFunctionName, (Qt::Key)0, Qt::NoModifier); + appPTR->addCommand(grouping, pythonFunctionName.toStdString(), (Qt::Key)0, Qt::NoModifier); } - void addMenuCommand(const std::string& grouping,const std::string& pythonFunctionName, + void addMenuCommand(const QString& grouping,const QString& pythonFunctionName, Qt::Key key, const Qt::KeyboardModifiers& modifiers) { - appPTR->addCommand(QString::fromUtf8(grouping.c_str()), pythonFunctionName, key, modifiers); + appPTR->addCommand(grouping, pythonFunctionName.toStdString(), key, modifiers); } }; diff --git a/Gui/PyGuiApp.cpp b/Gui/PyGuiApp.cpp index 11207da233..ae244e29c1 100644 --- a/Gui/PyGuiApp.cpp +++ b/Gui/PyGuiApp.cpp @@ -83,23 +83,33 @@ GuiApp::createModalDialog() PyTabWidget* -GuiApp::getTabWidget(const std::string& name) const +GuiApp::getTabWidget(const QString& name) const { const std::list& tabs = _app->getGui()->getPanes(); for ( std::list::const_iterator it = tabs.begin(); it != tabs.end(); ++it) { - if ((*it)->objectName_mt_safe().toStdString() == name) { + if ((*it)->objectName_mt_safe() == name) { return new PyTabWidget(*it); } } return 0; } +PyTabWidget* +GuiApp::getActiveTabWidget() const +{ + TabWidget* tab = _app->getGui()->getLastEnteredTabWidget(); + if (!tab) { + return 0; + } + return new PyTabWidget(tab); +} + bool -GuiApp::moveTab(const std::string& scriptName,PyTabWidget* pane) +GuiApp::moveTab(const QString& scriptName,PyTabWidget* pane) { PanelWidget* w; ScriptObject* o; - _app->getGui()->findExistingTab(scriptName, &w, &o); + _app->getGui()->findExistingTab(scriptName.toStdString(), &w, &o); if (!w || !o) { return false; } @@ -108,9 +118,9 @@ GuiApp::moveTab(const std::string& scriptName,PyTabWidget* pane) } void -GuiApp::registerPythonPanel(PyPanel* panel,const std::string& pythonFunction) +GuiApp::registerPythonPanel(PyPanel* panel,const QString& pythonFunction) { - _app->getGui()->registerPyPanel(panel,pythonFunction); + _app->getGui()->registerPyPanel(panel,pythonFunction.toStdString()); } void @@ -119,105 +129,119 @@ GuiApp::unregisterPythonPanel(PyPanel* panel) _app->getGui()->unregisterPyPanel(panel); } -std::string -GuiApp::getFilenameDialog(const std::vector& filters, - const std::string& location) const +QString +GuiApp::getFilenameDialog(const QStringList& filters, + const QString& location) const { Gui* gui = _app->getGui(); + std::vector f; + for (QStringList::const_iterator it = filters.begin(); it!=filters.end(); ++it) { + f.push_back(it->toStdString()); + } SequenceFileDialog dialog(gui, - filters, + f, false, SequenceFileDialog::eFileDialogModeOpen, - location, + location.toStdString(), gui, false); if (dialog.exec()) { - std::string ret = dialog.selectedFiles(); + QString ret = QString::fromUtf8(dialog.selectedFiles().c_str()); return ret; } - return std::string(); + return QString(); } -std::string -GuiApp::getSequenceDialog(const std::vector& filters, - const std::string& location) const +QString +GuiApp::getSequenceDialog(const QStringList& filters, + const QString& location) const { Gui* gui = _app->getGui(); - + std::vector f; + for (QStringList::const_iterator it = filters.begin(); it!=filters.end(); ++it) { + f.push_back(it->toStdString()); + } SequenceFileDialog dialog(gui, - filters, + f, true, SequenceFileDialog::eFileDialogModeOpen, - location, + location.toStdString(), gui, false); if (dialog.exec()) { - std::string ret = dialog.selectedFiles(); + QString ret = QString::fromUtf8(dialog.selectedFiles().c_str()); return ret; } - return std::string(); + return QString(); } -std::string -GuiApp::getDirectoryDialog(const std::string& location) const +QString +GuiApp::getDirectoryDialog(const QString& location) const { Gui* gui = _app->getGui(); - std::vector filters; + std::vector f; + SequenceFileDialog dialog(gui, - filters, + f, false, SequenceFileDialog::eFileDialogModeDir, - location, + location.toStdString(), gui, false); if (dialog.exec()) { - std::string ret = dialog.selectedDirectory(); + QString ret = QString::fromUtf8(dialog.selectedDirectory().c_str()); return ret; } - return std::string(); + return QString(); } -std::string -GuiApp::saveFilenameDialog(const std::vector& filters, - const std::string& location) const +QString +GuiApp::saveFilenameDialog(const QStringList& filters, + const QString& location) const { Gui* gui = _app->getGui(); - + std::vector f; + for (QStringList::const_iterator it = filters.begin(); it!=filters.end(); ++it) { + f.push_back(it->toStdString()); + } SequenceFileDialog dialog(gui, - filters, + f, false, SequenceFileDialog::eFileDialogModeSave, - location, + location.toStdString(), gui, false); if (dialog.exec()) { - std::string ret = dialog.filesToSave(); + QString ret = QString::fromUtf8(dialog.filesToSave().c_str()); return ret; } - return std::string(); + return QString(); } -std::string -GuiApp::saveSequenceDialog(const std::vector& filters, - const std::string& location) const +QString +GuiApp::saveSequenceDialog(const QStringList& filters, + const QString& location) const { Gui* gui = _app->getGui(); - + std::vector f; + for (QStringList::const_iterator it = filters.begin(); it!=filters.end(); ++it) { + f.push_back(it->toStdString()); + } SequenceFileDialog dialog(gui, - filters, + f, true, SequenceFileDialog::eFileDialogModeSave, - location, + location.toStdString(), gui, false); if (dialog.exec()) { - std::string ret = dialog.filesToSave(); + QString ret = QString::fromUtf8(dialog.filesToSave().c_str()); return ret; } - return std::string(); + return QString(); } @@ -449,9 +473,9 @@ GuiApp::clearSelection(Group* group) } PyViewer* -GuiApp::getViewer(const std::string& scriptName) const +GuiApp::getViewer(const QString& scriptName) const { - NodePtr ptr = _app->getNodeByFullySpecifiedName(scriptName); + NodePtr ptr = _app->getNodeByFullySpecifiedName(scriptName.toStdString()); if (!ptr || !ptr->isActivated()) { return 0; } @@ -464,11 +488,29 @@ GuiApp::getViewer(const std::string& scriptName) const return new PyViewer(ptr); } +PyViewer* +GuiApp::getActiveViewer() const +{ + ViewerTab* tab = _app->getGui()->getActiveViewer(); + if (!tab) { + return 0; + } + ViewerInstance* instance = tab->getInternalNode(); + if (!instance) { + return 0; + } + NodePtr node = instance->getNode(); + if (!node) { + return 0; + } + return new PyViewer(node); +} + PyPanel* -GuiApp::getUserPanel(const std::string& scriptName) const +GuiApp::getUserPanel(const QString& scriptName) const { - PanelWidget* w = _app->getGui()->findExistingTab(scriptName); + PanelWidget* w = _app->getGui()->findExistingTab(scriptName.toStdString()); if (!w) { return 0; } diff --git a/Gui/PyGuiApp.h b/Gui/PyGuiApp.h index 0c78e57f3b..ca2ad2a88a 100644 --- a/Gui/PyGuiApp.h +++ b/Gui/PyGuiApp.h @@ -118,22 +118,24 @@ class GuiApp : public App PyModalDialog* createModalDialog(); - PyTabWidget* getTabWidget(const std::string& name) const; + PyTabWidget* getTabWidget(const QString& name) const; - bool moveTab(const std::string& scriptName,PyTabWidget* pane); + PyTabWidget* getActiveTabWidget() const; - void registerPythonPanel(PyPanel* panel,const std::string& pythonFunction); + bool moveTab(const QString& scriptName,PyTabWidget* pane); + + void registerPythonPanel(PyPanel* panel,const QString& pythonFunction); void unregisterPythonPanel(PyPanel* panel); - std::string getFilenameDialog(const std::vector& filters,const std::string& location = std::string()) const; + QString getFilenameDialog(const QStringList& filters,const QString& location = QString()) const; - std::string getSequenceDialog(const std::vector& filters,const std::string& location = std::string()) const; + QString getSequenceDialog(const QStringList& filters,const QString& location = QString()) const; - std::string getDirectoryDialog(const std::string& location = std::string()) const; + QString getDirectoryDialog(const QString& location = QString()) const; - std::string saveFilenameDialog(const std::vector& filters,const std::string& location = std::string()) const; + QString saveFilenameDialog(const QStringList& filters,const QString& location = QString()) const; - std::string saveSequenceDialog(const std::vector& filters,const std::string& location = std::string()) const; + QString saveSequenceDialog(const QStringList& filters,const QString& location = QString()) const; ColorTuple getRGBColorDialog() const; @@ -145,9 +147,11 @@ class GuiApp : public App void deselectNode(Effect* effect); void clearSelection(Group* group = 0); - PyViewer* getViewer(const std::string& scriptName) const; + PyViewer* getViewer(const QString& scriptName) const; + + PyViewer* getActiveViewer() const; - PyPanel* getUserPanel(const std::string& scriptName) const; + PyPanel* getUserPanel(const QString& scriptName) const; void renderBlocking(Effect* writeNode,int firstFrame, int lastFrame,int frameStep = 1); void renderBlocking(const std::list& effects,const std::list& firstFrames,const std::list& lastFrames,const std::list& frameSteps); diff --git a/Gui/PythonPanels.cpp b/Gui/PythonPanels.cpp index f1145ee0c5..6965d596f0 100644 --- a/Gui/PythonPanels.cpp +++ b/Gui/PythonPanels.cpp @@ -55,8 +55,8 @@ struct DialogParamHolderPrivate QMutex paramChangedCBMutex; std::string paramChangedCB; - DialogParamHolderPrivate(const std::string& uniqueID) - : uniqueID(uniqueID) + DialogParamHolderPrivate(const QString& uniqueID) + : uniqueID(uniqueID.toStdString()) , paramChangedCBMutex() , paramChangedCB() { @@ -64,7 +64,7 @@ struct DialogParamHolderPrivate } }; -DialogParamHolder::DialogParamHolder(const std::string& uniqueID,AppInstance* app) +DialogParamHolder::DialogParamHolder(const QString& uniqueID,AppInstance* app) : NamedKnobHolder(app) , _imp(new DialogParamHolderPrivate(uniqueID)) { @@ -83,10 +83,10 @@ DialogParamHolder::getScriptName_mt_safe() const } void -DialogParamHolder::setParamChangedCallback(const std::string& callback) +DialogParamHolder::setParamChangedCallback(const QString& callback) { QMutexLocker k(&_imp->paramChangedCBMutex); - _imp->paramChangedCB = callback; + _imp->paramChangedCB = callback.toStdString(); } void @@ -187,7 +187,7 @@ PyModalDialog::PyModalDialog(Gui* gui) , UserParamHolder() , _imp(new PyModalDialogPrivate(gui)) { - _imp->holder = new DialogParamHolder(std::string(),gui->getApp()); + _imp->holder = new DialogParamHolder(QString(),gui->getApp()); setHolder(_imp->holder); _imp->holder->initializeKnobsPublic(); _imp->mainLayout = new QVBoxLayout(this); @@ -240,15 +240,15 @@ PyModalDialog::addWidget(QWidget* widget) void -PyModalDialog::setParamChangedCallback(const std::string& callback) +PyModalDialog::setParamChangedCallback(const QString& callback) { _imp->holder->setParamChangedCallback(callback); } Param* -PyModalDialog::getParam(const std::string& scriptName) const +PyModalDialog::getParam(const QString& scriptName) const { - KnobPtr knob = _imp->holder->getKnobByName(scriptName); + KnobPtr knob = _imp->holder->getKnobByName(scriptName.toStdString()); if (!knob) { return 0; } @@ -270,7 +270,7 @@ struct PyPanelPrivate QVBoxLayout* centerLayout; mutable QMutex serializationMutex; - std::string serialization; + QString serialization; PyPanelPrivate() @@ -288,17 +288,17 @@ struct PyPanelPrivate -PyPanel::PyPanel(const std::string& scriptName,const std::string& label,bool useUserParameters,GuiApp* app) +PyPanel::PyPanel(const QString& scriptName,const QString& label,bool useUserParameters,GuiApp* app) : QWidget(app->getGui()) , UserParamHolder() , PanelWidget(this,app->getGui()) , _imp(new PyPanelPrivate()) { - setLabel(label.c_str()); + setLabel(label.toStdString()); int idx = 1; - std::string name = NATRON_PYTHON_NAMESPACE::makeNameScriptFriendly(scriptName); + std::string name = NATRON_PYTHON_NAMESPACE::makeNameScriptFriendly(scriptName.toStdString()); PanelWidget* existing = 0; existing = getGui()->findExistingTab(name); while (existing) { @@ -316,7 +316,7 @@ PyPanel::PyPanel(const std::string& scriptName,const std::string& label,bool use if (useUserParameters) { - _imp->holder = new DialogParamHolder(name,getGui()->getApp()); + _imp->holder = new DialogParamHolder(QString::fromUtf8(name.c_str()),getGui()->getApp()); setHolder(_imp->holder); _imp->holder->initializeKnobsPublic(); _imp->mainLayout = new QVBoxLayout(this); @@ -349,36 +349,35 @@ PyPanel::~PyPanel() getGui()->unregisterPyPanel(this); } -std::string +QString PyPanel::getPanelScriptName() const { - return getScriptName(); + return QString::fromUtf8(getScriptName().c_str()); } void -PyPanel::setPanelLabel(const std::string& label) +PyPanel::setPanelLabel(const QString& label) { - setLabel(label); - QString name = QString::fromUtf8(label.c_str()); + setLabel(label.toStdString()); TabWidget* parent = dynamic_cast(parentWidget()); if (parent) { - parent->setTabLabel(this, name); + parent->setTabLabel(this, label); } } -std::string +QString PyPanel::getPanelLabel() const { - return getLabel(); + return QString::fromUtf8(getLabel().c_str()); } Param* -PyPanel::getParam(const std::string& scriptName) const +PyPanel::getParam(const QString& scriptName) const { if (!_imp->holder) { return 0; } - KnobPtr knob = _imp->holder->getKnobByName(scriptName); + KnobPtr knob = _imp->holder->getKnobByName(scriptName.toStdString()); if (!knob) { return 0; } @@ -405,7 +404,7 @@ PyPanel::getParams() const void -PyPanel::setParamChangedCallback(const std::string& callback) +PyPanel::setParamChangedCallback(const QString& callback) { if (_imp->holder) { _imp->holder->setParamChangedCallback(callback); @@ -437,7 +436,7 @@ PyPanel::onUserDataChanged() _imp->serialization = save(); } -std::string +QString PyPanel::save_serialization_thread() const { QMutexLocker k(&_imp->serializationMutex); @@ -516,10 +515,10 @@ PyTabWidget::closeTab(int index) _tab->removeTab(index, true); } -std::string +QString PyTabWidget::getTabLabel(int index) const { - return _tab->getTabLabel(index).toStdString(); + return QString::fromUtf8(_tab->getTabLabel(index).toStdString().c_str()); } int @@ -608,10 +607,10 @@ PyTabWidget::closeCurrentTab() _tab->closeCurrentWidget(); } -std::string +QString PyTabWidget::getScriptName() const { - return _tab->objectName_mt_safe().toStdString(); + return _tab->objectName_mt_safe(); } NATRON_PYTHON_NAMESPACE_EXIT; diff --git a/Gui/PythonPanels.h b/Gui/PythonPanels.h index 7f4ba3179d..d55d68a204 100644 --- a/Gui/PythonPanels.h +++ b/Gui/PythonPanels.h @@ -50,13 +50,13 @@ class DialogParamHolder : public NamedKnobHolder public: - DialogParamHolder(const std::string& uniqueID,AppInstance* app); + DialogParamHolder(const QString& uniqueID,AppInstance* app); virtual ~DialogParamHolder(); virtual std::string getScriptName_mt_safe() const OVERRIDE FINAL; - void setParamChangedCallback(const std::string& callback); + void setParamChangedCallback(const QString& callback); private: @@ -86,9 +86,9 @@ class PyModalDialog : public QDialog, public UserParamHolder virtual ~PyModalDialog(); - Param* getParam(const std::string& scriptName) const; + Param* getParam(const QString& scriptName) const; - void setParamChangedCallback(const std::string& callback); + void setParamChangedCallback(const QString& callback); void insertWidget(int index, QWidget* widget); @@ -111,25 +111,25 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON public: - PyPanel(const std::string& scriptName,const std::string& label,bool useUserParameters,GuiApp* app); + PyPanel(const QString& scriptName,const QString& label,bool useUserParameters,GuiApp* app); virtual ~PyPanel(); - std::string save_serialization_thread() const; + QString save_serialization_thread() const; - virtual void restore(const std::string& /*data*/) {} + virtual void restore(const QString& /*data*/) {} - std::string getPanelScriptName() const; + QString getPanelScriptName() const; - void setPanelLabel(const std::string& label); + void setPanelLabel(const QString& label); - std::string getPanelLabel() const; + QString getPanelLabel() const; - Param* getParam(const std::string& scriptName) const; + Param* getParam(const QString& scriptName) const; std::list getParams() const; - void setParamChangedCallback(const std::string& callback); + void setParamChangedCallback(const QString& callback); void insertWidget(int index, QWidget* widget); @@ -137,7 +137,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON protected: - virtual std::string save() { return std::string(); } + virtual QString save() { return QString(); } void onUserDataChanged(); @@ -175,7 +175,7 @@ public : void closeTab(int index); - std::string getTabLabel(int index) const; + QString getTabLabel(int index) const; int count(); @@ -199,7 +199,7 @@ public : void closeCurrentTab(); - std::string getScriptName() const; + QString getScriptName() const; }; NATRON_PYTHON_NAMESPACE_EXIT; diff --git a/Gui/Resources/PyPlugs/ZMask.py b/Gui/Resources/PyPlugs/ZMask.py index f618d348b9..b7f3a056d5 100644 --- a/Gui/Resources/PyPlugs/ZMask.py +++ b/Gui/Resources/PyPlugs/ZMask.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # DO NOT EDIT THIS FILE -# This file was automatically generated by Natron PyPlug exporter version 3. +# This file was automatically generated by Natron PyPlug exporter version 7. # Hand-written code should be added in a separate file named ZMaskExt.py # See http://natron.readthedocs.org/en/master/groups.html#adding-hand-written-code-callbacks-etc @@ -49,33 +49,12 @@ def createInstance(app,group): param = lastNode.getParam("operation") if param is not None: - options = param.getOptions() - foundOption = False - for i in range(len(options)): - if options[i] == "difference": - param.setValue(i) - foundOption = True - break - if not foundOption: - app.writeToScriptEditor("Could not set option for parameter operation of node ZMask.Merge1") + param.set("difference") del param param = lastNode.getParam("B_channels") if param is not None: - options = param.getOptions() - foundOption = False - for i in range(len(options)): - if options[i] == "RGBA": - param.setValue(i) - foundOption = True - break - if not foundOption: - app.writeToScriptEditor("Could not set option for parameter B_channels of node ZMask.Merge1") - del param - - param = lastNode.getParam("userTextArea") - if param is not None: - param.setValue("(difference)") + param.set("Color.RGBA") del param del lastNode @@ -90,12 +69,6 @@ def createInstance(app,group): lastNode.setColor(0.3, 0.5, 0.2) groupSolid1 = lastNode - param = lastNode.getParam("size") - if param is not None: - param.setValue(1920, 0) - param.setValue(1080, 1) - del param - param = lastNode.getParam("color") if param is not None: param.setValue(1, 0) @@ -149,14 +122,6 @@ def createInstance(app,group): lastNode.setColor(0.48, 0.66, 1) groupColorCorrect1 = lastNode - param = lastNode.getParam("MasterGain") - if param is not None: - param.setValue(1, 0) - param.setValue(1, 1) - param.setValue(1, 2) - param.setValue(1, 3) - del param - param = lastNode.getParam("toneRanges") if param is not None: param.setCurveColor(0, 0.6, 0.4, 0.6) @@ -215,15 +180,7 @@ def createInstance(app,group): param = lastNode.getParam("p1_channels") if param is not None: - options = param.getOptions() - foundOption = False - for i in range(len(options)): - if options[i] == "RGBA": - param.setValue(i) - foundOption = True - break - if not foundOption: - app.writeToScriptEditor("Could not set option for parameter p1_channels of node ZMask.Switch1") + param.set("Color.RGBA") del param del lastNode @@ -406,34 +363,7 @@ def createInstance(app,group): del param param = lastNode.createChoiceParam("Source_channels", "Source Layer") - entries = [ ("None", ""), - ("RGBA", ""), - ("Composite.Combined", ""), - ("RenderLayer.AO", ""), - ("RenderLayer.Combined", ""), - ("RenderLayer.Depth", ""), - ("RenderLayer.DiffCol", ""), - ("RenderLayer.DiffDir", ""), - ("RenderLayer.DiffInd", ""), - ("RenderLayer.Emit", ""), - ("RenderLayer.Env", ""), - ("RenderLayer.GlossCol", ""), - ("RenderLayer.GlossDir", ""), - ("RenderLayer.GlossInd", ""), - ("RenderLayer.IndexMA", ""), - ("RenderLayer.IndexOB", ""), - ("RenderLayer.Normal", ""), - ("RenderLayer.Shadow", ""), - ("RenderLayer.TransCol", ""), - ("RenderLayer.TransInd", ""), - ("RenderLayer.UV", ""), - ("Backward", ""), - ("DisparityLeft", ""), - ("DisparityRight", ""), - ("Forward", "")] - param.setOptions(entries) - del entries - param.setDefaultValue("RGBA") + param.setDefaultValue(1) # Add the param to the page lastNode.controls.addParam(param) @@ -459,7 +389,7 @@ def createInstance(app,group): del param # Refresh the GUI with the newly created parameters - lastNode.setPagesOrder(['controls', 'Node', 'Info']) + lastNode.setPagesOrder(['controls', 'Node', 'Info', 'Settings']) lastNode.refreshUserParamsGUI() del lastNode diff --git a/Gui/RotoUndoCommand.cpp b/Gui/RotoUndoCommand.cpp index 284b4300b6..aef61ea848 100644 --- a/Gui/RotoUndoCommand.cpp +++ b/Gui/RotoUndoCommand.cpp @@ -364,13 +364,10 @@ AddPointUndoCommand::AddPointUndoCommand(RotoGui* roto, : QUndoCommand() , _firstRedoCalled(false) , _roto(roto) - , _oldCurve() , _curve(curve) , _index(index) , _t(t) { - _oldCurve.reset( new Bezier(curve->getContext(),curve->getScriptName(),curve->getParentLayer(), false) ); - _oldCurve->clone(curve.get()); } @@ -381,7 +378,7 @@ AddPointUndoCommand::~AddPointUndoCommand() void AddPointUndoCommand::undo() { - _curve->clone(_oldCurve.get()); + _curve->removeControlPointByIndex(_index + 1); _roto->setSelection( _curve, std::make_pair( CpPtr(),CpPtr() ) ); _roto->evaluate(true); setText( QObject::tr("Add point to %1 of %2").arg(QString::fromUtf8( _curve->getLabel().c_str() )).arg( _roto->getNodeName() ) ); @@ -390,7 +387,7 @@ AddPointUndoCommand::undo() void AddPointUndoCommand::redo() { - _oldCurve->clone(_curve.get()); + boost::shared_ptr cp = _curve->addControlPointAfterIndex(_index,_t); boost::shared_ptr newFp = _curve->getFeatherPointAtIndex(_index + 1); diff --git a/Gui/RotoUndoCommand.h b/Gui/RotoUndoCommand.h index 9c3517b12c..11836b1a9a 100644 --- a/Gui/RotoUndoCommand.h +++ b/Gui/RotoUndoCommand.h @@ -148,7 +148,7 @@ class AddPointUndoCommand bool _firstRedoCalled; //< false by default RotoGui* _roto; - boost::shared_ptr _oldCurve,_curve; + boost::shared_ptr _curve; int _index; double _t; }; diff --git a/Gui/ScriptEditor.cpp b/Gui/ScriptEditor.cpp index af1d14605a..60d7016881 100644 --- a/Gui/ScriptEditor.cpp +++ b/Gui/ScriptEditor.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -245,20 +246,14 @@ ScriptEditor::ScriptEditor(Gui* gui) QSplitter* splitter = new QSplitter(Qt::Vertical,this); - QFont scriptFont(QString::fromUtf8("Courier New"), 12); - if (!scriptFont.exactMatch()) { - scriptFont = font(); - } - + _imp->outputEdit = new OutputScriptTextEdit(this); QObject::connect(_imp->outputEdit, SIGNAL(userScrollChanged(bool)), this, SLOT(onUserScrollChanged(bool))); _imp->outputEdit->setFocusPolicy(Qt::ClickFocus); _imp->outputEdit->setReadOnly(true); - _imp->outputEdit->setFont(scriptFont); _imp->inputEdit = new InputScriptTextEdit(gui, this); QObject::connect(_imp->inputEdit, SIGNAL(textChanged()), this, SLOT(onInputScriptTextChanged())); - _imp->inputEdit->setFont(scriptFont); QFontMetrics fm = _imp->inputEdit->fontMetrics(); _imp->inputEdit->setTabStopWidth(fm.width(QLatin1Char(' ')) * 4); _imp->outputEdit->setTabStopWidth(fm.width(QLatin1Char(' ')) * 4); @@ -272,6 +267,8 @@ ScriptEditor::ScriptEditor(Gui* gui) QObject::connect(&_imp->history, SIGNAL(canRedoChanged(bool)), this, SLOT(onHistoryCanRedoChanged(bool))); _imp->autoSaveTimer.setSingleShot(true); + + reloadFont(); } ScriptEditor::~ScriptEditor() @@ -287,6 +284,19 @@ ScriptEditor::reloadHighlighter() } } +void +ScriptEditor::reloadFont() +{ + QString fontFamily = QString::fromUtf8(appPTR->getCurrentSettings()->getSEFontFamily().c_str()); + int fontSize = appPTR->getCurrentSettings()->getSEFontSize(); + QFont font(fontFamily, fontSize); + if (font.exactMatch()) { + _imp->inputEdit->setFont(font); + _imp->outputEdit->setFont(font); + } + +} + void ScriptEditor::onHistoryCanUndoChanged(bool canUndo) { @@ -332,6 +342,20 @@ ScriptEditor::onRedoClicked() _imp->history.redo(); } +void +ScriptEditor::sourceScript(const QString& filename) +{ + QFile file(filename); + if (file.open(QIODevice::ReadOnly)) { + QTextStream ts(&file); + QString content = ts.readAll(); + _imp->inputEdit->setPlainText(content); + onExecScriptClicked(); + } else { + Dialogs::errorDialog(tr("Operation failed").toStdString(), tr("Failed to open ").toStdString() + filename.toStdString()); + } +} + void ScriptEditor::onSourceScriptClicked() { @@ -346,15 +370,7 @@ ScriptEditor::onSourceScriptClicked() getGui()->updateLastOpenedProjectPath(currentDir.absolutePath()); QString fileName(QString::fromUtf8(dialog.selectedFiles().c_str())); - QFile file(fileName); - if (file.open(QIODevice::ReadOnly)) { - QTextStream ts(&file); - QString content = ts.readAll(); - _imp->inputEdit->setPlainText(content); - onExecScriptClicked(); - } else { - Dialogs::errorDialog(tr("Operation failed").toStdString(), tr("Failure to open the file").toStdString()); - } + sourceScript(fileName); } } @@ -640,6 +656,13 @@ ScriptEditor::onShowAutoDeclVarsClicked(bool clicked) appPTR->getCurrentSettings()->setAutoDeclaredVariablePrintEnabled(clicked); } +void +ScriptEditor::focusInEvent(QFocusEvent* e) +{ + _imp->inputEdit->setFocus(); + QWidget::focusInEvent(e); +} + NATRON_NAMESPACE_EXIT; NATRON_NAMESPACE_USING; diff --git a/Gui/ScriptEditor.h b/Gui/ScriptEditor.h index eeb4ae5752..b995692517 100644 --- a/Gui/ScriptEditor.h +++ b/Gui/ScriptEditor.h @@ -69,6 +69,10 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON void reloadHighlighter(); + void reloadFont(); + + void sourceScript(const QString& filename); + public Q_SLOTS: void doAppendToScriptEditorOnMainThread(const QString& str); @@ -108,6 +112,7 @@ public Q_SLOTS: private: + virtual void focusInEvent(QFocusEvent* e) OVERRIDE FINAL; virtual void mousePressEvent(QMouseEvent* e) OVERRIDE FINAL; virtual void enterEvent(QEvent *e) OVERRIDE FINAL; virtual void leaveEvent(QEvent *e) OVERRIDE FINAL; diff --git a/Gui/TabWidget.cpp b/Gui/TabWidget.cpp index 2941d90218..b3a45e2270 100644 --- a/Gui/TabWidget.cpp +++ b/Gui/TabWidget.cpp @@ -434,7 +434,7 @@ TabWidget::createMenu() for (std::map::iterator it = userPanels.begin(); it != userPanels.end(); ++it) { - QAction* pAction = new QAction(QString::fromUtf8(it->first->getPanelLabel().c_str()) + tr(" here"),userPanelsMenu); + QAction* pAction = new QAction(it->first->getPanelLabel()+ tr(" here"),userPanelsMenu); QObject::connect(pAction, SIGNAL(triggered()), this, SLOT(onUserPanelActionTriggered())); pAction->setData(QString::fromUtf8(it->first->getScriptName().c_str())); userPanelsMenu->addAction(pAction); diff --git a/Gui/ViewerTab.h b/Gui/ViewerTab.h index e8b8aa2dbe..692ca3136a 100644 --- a/Gui/ViewerTab.h +++ b/Gui/ViewerTab.h @@ -282,6 +282,13 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON bool isViewerPaused(int texIndex) const; + QString getCurrentLayerName() const; + + QString getCurrentAlphaLayerName() const; + + void setCurrentLayers(const QString& layer, const QString& alphaLayer); + + public Q_SLOTS: void onPauseViewerButtonClicked(bool clicked); diff --git a/Gui/ViewerTab10.cpp b/Gui/ViewerTab10.cpp index 85dd991507..08628b64f7 100644 --- a/Gui/ViewerTab10.cpp +++ b/Gui/ViewerTab10.cpp @@ -534,6 +534,9 @@ ViewerTab::leaveEvent(QEvent* e) void ViewerTab::keyPressEvent(QKeyEvent* e) { + if (getGui()) { + getGui()->setActiveViewer(this); + } bool accept = true; diff --git a/Gui/ViewerTab40.cpp b/Gui/ViewerTab40.cpp index cde1b0070b..e7b2f0fe0b 100644 --- a/Gui/ViewerTab40.cpp +++ b/Gui/ViewerTab40.cpp @@ -182,6 +182,8 @@ ViewerTab::isViewerPaused(int texIndex) const return _imp->viewerNode->isViewerPaused(texIndex); } + + void ViewerTab::toggleViewerPauseMode(bool allInputs) { @@ -636,6 +638,9 @@ void ViewerTab::onMousePressCalledInViewer() { takeClickFocus(); + if (getGui()) { + getGui()->setActiveViewer(this); + } } void @@ -913,16 +918,9 @@ ViewerTab::refreshLayerAndAlphaChannelComboBox() } - int layerIdx; - if (foundCurIt == components.end()) { - layerCurChoice = QString::fromUtf8("-"); - } - - - - if (layerCurChoice == QString::fromUtf8("-")) { + if (layerCurChoice == QString::fromUtf8("-") || layerCurChoice.isEmpty() || foundCurIt == components.end()) { - ///Try to find color plane, otherwise fallback on any other layer + // Try to find color plane, otherwise fallback on any other layer if (foundColorIt != components.end()) { layerCurChoice = QString::fromUtf8(foundColorIt->getLayerName().c_str()) + QLatin1Char('.') + QString::fromUtf8(foundColorIt->getComponentsGlobalName().c_str()); @@ -939,15 +937,16 @@ ViewerTab::refreshLayerAndAlphaChannelComboBox() } - layerIdx = _imp->layerChoice->itemIndex(layerCurChoice); - assert(layerIdx != -1); - - _imp->layerChoice->setCurrentIndex_no_emit(layerIdx); if (foundCurIt == components.end()) { + _imp->layerChoice->setCurrentText_no_emit(layerCurChoice); _imp->viewerNode->setActiveLayer(ImageComponents::getNoneComponents(), false); } else { + + int layerIdx = _imp->layerChoice->itemIndex(layerCurChoice); + assert(layerIdx != -1); + _imp->layerChoice->setCurrentIndex_no_emit(layerIdx); if (foundCurIt->getNumComponents() == 1) { //Switch auto to alpha if there's only this to view _imp->viewerChannels->setCurrentIndex_no_emit(5); @@ -963,12 +962,7 @@ ViewerTab::refreshLayerAndAlphaChannelComboBox() _imp->viewerNode->setActiveLayer(*foundCurIt, false); } - int alphaIdx; - if (foundCurAlphaIt == components.end() || foundAlphaChannel.empty()) { - alphaCurChoice = QString::fromUtf8("-"); - } - - if (alphaCurChoice == QString::fromUtf8("-")) { + if (alphaCurChoice == QString::fromUtf8("-") || alphaCurChoice.isEmpty() || foundCurAlphaIt == components.end()) { ///Try to find color plane, otherwise fallback on any other layer if (foundColorIt != components.end() && @@ -990,18 +984,24 @@ ViewerTab::refreshLayerAndAlphaChannelComboBox() } - alphaIdx = _imp->alphaChannelChoice->itemIndex(alphaCurChoice); - if (alphaIdx == -1) { - alphaIdx = 0; - } - - _imp->alphaChannelChoice->setCurrentIndex_no_emit(alphaIdx); - if (foundCurAlphaIt != components.end()) { - _imp->viewerNode->setAlphaChannel(*foundCurAlphaIt, foundAlphaChannel, false); - } else { + if (foundCurAlphaIt == components.end() || foundAlphaChannel.empty()) { + _imp->alphaChannelChoice->setCurrentText_no_emit(alphaCurChoice); _imp->viewerNode->setAlphaChannel(ImageComponents::getNoneComponents(), std::string(), false); + } else { + int layerIdx = _imp->alphaChannelChoice->itemIndex(alphaCurChoice); + assert(layerIdx != -1); + _imp->alphaChannelChoice->setCurrentIndex_no_emit(layerIdx); + + _imp->viewerNode->setAlphaChannel(*foundCurAlphaIt, foundAlphaChannel, false); + } + { + QMutexLocker k(&_imp->currentLayerMutex); + _imp->currentLayerChoice = layerCurChoice; + _imp->currentAlphaLayerChoice = alphaCurChoice; + } + } void @@ -1009,6 +1009,11 @@ ViewerTab::onAlphaChannelComboChanged(int index) { std::set components; _imp->getComponentsAvailabel(&components); + + { + QMutexLocker k(&_imp->currentLayerMutex); + _imp->currentAlphaLayerChoice = _imp->alphaChannelChoice->getCurrentIndexText(); + } int i = 1; // because of the "-" choice for (std::set::iterator it = components.begin(); it != components.end(); ++it) { @@ -1026,6 +1031,7 @@ ViewerTab::onAlphaChannelComboChanged(int index) } } _imp->viewerNode->setAlphaChannel(ImageComponents::getNoneComponents(), std::string(), true); + } void @@ -1033,6 +1039,10 @@ ViewerTab::onLayerComboChanged(int index) { std::set components; _imp->getComponentsAvailabel(&components); + { + QMutexLocker k(&_imp->currentLayerMutex); + _imp->currentLayerChoice = _imp->layerChoice->getCurrentIndexText(); + } if (index >= (int)(components.size() + 1) || index < 0) { qDebug() << "ViewerTab::onLayerComboChanged: invalid index"; return; @@ -1060,6 +1070,28 @@ ViewerTab::onLayerComboChanged(int index) } +QString +ViewerTab::getCurrentLayerName() const +{ + QMutexLocker k(&_imp->currentLayerMutex); + return _imp->currentLayerChoice; +} + +QString +ViewerTab::getCurrentAlphaLayerName() const +{ + QMutexLocker k(&_imp->currentLayerMutex); + return _imp->currentAlphaLayerChoice; +} + +void +ViewerTab::setCurrentLayers(const QString& layer, const QString& alphaLayer) +{ + _imp->layerChoice->setCurrentText_no_emit(layer); + _imp->alphaChannelChoice->setCurrentText_no_emit(alphaLayer); + refreshLayerAndAlphaChannelComboBox(); +} + void ViewerTab::onGainToggled(bool clicked) { diff --git a/Gui/ViewerTabPrivate.h b/Gui/ViewerTabPrivate.h index 2db08bbf70..bf6cf70a82 100644 --- a/Gui/ViewerTabPrivate.h +++ b/Gui/ViewerTabPrivate.h @@ -77,6 +77,8 @@ struct ViewerTabPrivate //ComboBox* viewerLayers; ComboBox* layerChoice; ComboBox* alphaChannelChoice; + mutable QMutex currentLayerMutex; + QString currentLayerChoice,currentAlphaLayerChoice; ChannelsComboBox* viewerChannels; bool viewerChannelsAutoswitchedToAlpha; ComboBox* zoomCombobox; diff --git a/Gui/typesystem_natronGui.xml b/Gui/typesystem_natronGui.xml index 49b101432d..940a889301 100644 --- a/Gui/typesystem_natronGui.xml +++ b/Gui/typesystem_natronGui.xml @@ -26,11 +26,17 @@ - + + + + + + + std::list<Effect*> effects = %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES); @@ -45,7 +51,12 @@ return ret; - + + + + + + @@ -141,7 +152,7 @@ - + @@ -149,7 +160,7 @@ - + diff --git a/ceres/ceres.xcodeproj/project.pbxproj b/ceres/ceres.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..b78a031c0d --- /dev/null +++ b/ceres/ceres.xcodeproj/project.pbxproj @@ -0,0 +1,3658 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + D7BA7D76DAB5DD13389D6332 = { + buildActionMask = 2147483647; + files = ( + ); + generatedFileNames = ( + ); + isa = PBXShellScriptBuildPhase; + name = "Qt Qmake"; + neededFileNames = ( + ); + shellPath = "/bin/sh"; + shellScript = "make\ -C\ /Users/alexandre/development/Natron/ceres\ -f\ \'ceres.xcodeproj/qt_makeqmake.mak\'"; + }; + 16DC6676CCD725E080021DFE = { + isa = PBXFileReference; + name = "array_utils.cc"; + path = "../libs/ceres/internal/ceres/array_utils.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 11AF19B3026E737C268E69D7 = { + fileRef = "16DC6676CCD725E080021DFE"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 529C7FA5C87EBAA8A24C237F = { + isa = PBXFileReference; + name = "blas.cc"; + path = "../libs/ceres/internal/ceres/blas.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + EB6F14EFBF32329C15030C97 = { + fileRef = "529C7FA5C87EBAA8A24C237F"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 5CD625DE3D1B36D042ACEADB = { + isa = PBXFileReference; + name = "block_evaluate_preparer.cc"; + path = "../libs/ceres/internal/ceres/block_evaluate_preparer.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 1107147767FC3ADC80B0C30B = { + fileRef = "5CD625DE3D1B36D042ACEADB"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + F4E2F087483EF972C1875582 = { + isa = PBXFileReference; + name = "block_jacobian_writer.cc"; + path = "../libs/ceres/internal/ceres/block_jacobian_writer.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 0660B8324202B3E976C1A531 = { + fileRef = "F4E2F087483EF972C1875582"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 27E9673BD8E2F2A795B1C762 = { + isa = PBXFileReference; + name = "block_jacobi_preconditioner.cc"; + path = "../libs/ceres/internal/ceres/block_jacobi_preconditioner.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 7146FFFAA15F912A37E0CF51 = { + fileRef = "27E9673BD8E2F2A795B1C762"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 23979218EEBC15095DB760FF = { + isa = PBXFileReference; + name = "block_random_access_dense_matrix.cc"; + path = "../libs/ceres/internal/ceres/block_random_access_dense_matrix.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 921D3549DADEEAC71CE8BA71 = { + fileRef = "23979218EEBC15095DB760FF"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 1D223A54D94D8E67F90DA1DD = { + isa = PBXFileReference; + name = "block_random_access_diagonal_matrix.cc"; + path = "../libs/ceres/internal/ceres/block_random_access_diagonal_matrix.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 5498923F9C447660CDF2E842 = { + fileRef = "1D223A54D94D8E67F90DA1DD"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 50B4D41EAFDE35F4E66B6FB1 = { + isa = PBXFileReference; + name = "block_random_access_matrix.cc"; + path = "../libs/ceres/internal/ceres/block_random_access_matrix.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 750E1D60500E276145AC8ADD = { + fileRef = "50B4D41EAFDE35F4E66B6FB1"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 538B233E48B2A6EE9D6400A7 = { + isa = PBXFileReference; + name = "block_random_access_sparse_matrix.cc"; + path = "../libs/ceres/internal/ceres/block_random_access_sparse_matrix.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 3421F4F978C3F9FA196C5677 = { + fileRef = "538B233E48B2A6EE9D6400A7"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 9C99D00AF2EC2C1E0D5651FC = { + isa = PBXFileReference; + name = "block_sparse_matrix.cc"; + path = "../libs/ceres/internal/ceres/block_sparse_matrix.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 24B21F10DB04E83DC7C77227 = { + fileRef = "9C99D00AF2EC2C1E0D5651FC"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + FB348526FCB438C5C23AF5B5 = { + isa = PBXFileReference; + name = "block_structure.cc"; + path = "../libs/ceres/internal/ceres/block_structure.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + B5D96611BA57E978D5A2675E = { + fileRef = "FB348526FCB438C5C23AF5B5"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 837E0AA7BC0948A35226DE98 = { + isa = PBXFileReference; + name = "callbacks.cc"; + path = "../libs/ceres/internal/ceres/callbacks.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + D210C957721242F784051874 = { + fileRef = "837E0AA7BC0948A35226DE98"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + FA648D4C00FD27AE26FBCB43 = { + isa = PBXFileReference; + name = "canonical_views_clustering.cc"; + path = "../libs/ceres/internal/ceres/canonical_views_clustering.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 4A53598650E90C6F3C97780C = { + fileRef = "FA648D4C00FD27AE26FBCB43"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 11B61ACFE41D21A33D17D066 = { + isa = PBXFileReference; + name = "c_api.cc"; + path = "../libs/ceres/internal/ceres/c_api.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + AF7A0241307467E43F29CC35 = { + fileRef = "11B61ACFE41D21A33D17D066"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 3F28EFB5A4824EA7CBC94CDF = { + isa = PBXFileReference; + name = "cgnr_solver.cc"; + path = "../libs/ceres/internal/ceres/cgnr_solver.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + CD05907880B1952B1CA8E666 = { + fileRef = "3F28EFB5A4824EA7CBC94CDF"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 28EFBB9245E5090DB2C7622C = { + isa = PBXFileReference; + name = "compressed_col_sparse_matrix_utils.cc"; + path = "../libs/ceres/internal/ceres/compressed_col_sparse_matrix_utils.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + F1F080A5A4AD980B32A69DE7 = { + fileRef = "28EFBB9245E5090DB2C7622C"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 1F2DD4F349E35BCEB719AEBF = { + isa = PBXFileReference; + name = "compressed_row_jacobian_writer.cc"; + path = "../libs/ceres/internal/ceres/compressed_row_jacobian_writer.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 6F12D6C75E7BFB57BFB1EE26 = { + fileRef = "1F2DD4F349E35BCEB719AEBF"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 210B827364E18CFAE2BE2D7F = { + isa = PBXFileReference; + name = "compressed_row_sparse_matrix.cc"; + path = "../libs/ceres/internal/ceres/compressed_row_sparse_matrix.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 1701E81E4C29C84F5E1F0C21 = { + fileRef = "210B827364E18CFAE2BE2D7F"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + DE5A0431C74420CBDC4928FF = { + isa = PBXFileReference; + name = "conditioned_cost_function.cc"; + path = "../libs/ceres/internal/ceres/conditioned_cost_function.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 3E71EE233E56656B699906F2 = { + fileRef = "DE5A0431C74420CBDC4928FF"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 6450DBB8136ACC6ADF2DF52B = { + isa = PBXFileReference; + name = "conjugate_gradients_solver.cc"; + path = "../libs/ceres/internal/ceres/conjugate_gradients_solver.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + A4454067FF9D581B4CB655E7 = { + fileRef = "6450DBB8136ACC6ADF2DF52B"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 6D71CC88837E6525DC4D42F1 = { + isa = PBXFileReference; + name = "coordinate_descent_minimizer.cc"; + path = "../libs/ceres/internal/ceres/coordinate_descent_minimizer.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 85D16DCDD2ADE07C10F23B67 = { + fileRef = "6D71CC88837E6525DC4D42F1"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + D1515E55D959BFCC74D93CC0 = { + isa = PBXFileReference; + name = "corrector.cc"; + path = "../libs/ceres/internal/ceres/corrector.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + DBA69DE81853201AEF907A88 = { + fileRef = "D1515E55D959BFCC74D93CC0"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + CFCF175A6168FACF1CF82A6D = { + isa = PBXFileReference; + name = "covariance.cc"; + path = "../libs/ceres/internal/ceres/covariance.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + FA0A20435699BFC1CEE68997 = { + fileRef = "CFCF175A6168FACF1CF82A6D"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + EE3E439E06A25E1AC38DA980 = { + isa = PBXFileReference; + name = "covariance_impl.cc"; + path = "../libs/ceres/internal/ceres/covariance_impl.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 49A703593B8E016337DF7782 = { + fileRef = "EE3E439E06A25E1AC38DA980"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 4489E390B4423DE7B4204C8E = { + isa = PBXFileReference; + name = "cxsparse.cc"; + path = "../libs/ceres/internal/ceres/cxsparse.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 09697209D1E08995B2DAA985 = { + fileRef = "4489E390B4423DE7B4204C8E"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 371E6066AE24AA9A5BB9F863 = { + isa = PBXFileReference; + name = "dense_normal_cholesky_solver.cc"; + path = "../libs/ceres/internal/ceres/dense_normal_cholesky_solver.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + D38A18B0B96C19CA055F3B13 = { + fileRef = "371E6066AE24AA9A5BB9F863"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + FA033A6844A598623179FE48 = { + isa = PBXFileReference; + name = "dense_qr_solver.cc"; + path = "../libs/ceres/internal/ceres/dense_qr_solver.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 27623FACAC7686AC7616282C = { + fileRef = "FA033A6844A598623179FE48"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + AEB1221E240E4D77B9943916 = { + isa = PBXFileReference; + name = "dense_sparse_matrix.cc"; + path = "../libs/ceres/internal/ceres/dense_sparse_matrix.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + F66C847A3CF0DBB53326F6B7 = { + fileRef = "AEB1221E240E4D77B9943916"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + DC5F3E1F05DB46A7522B82B4 = { + isa = PBXFileReference; + name = "detect_structure.cc"; + path = "../libs/ceres/internal/ceres/detect_structure.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 1CDB293002ECD622E1F1C1DD = { + fileRef = "DC5F3E1F05DB46A7522B82B4"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 837304105638A08861FC637C = { + isa = PBXFileReference; + name = "dogleg_strategy.cc"; + path = "../libs/ceres/internal/ceres/dogleg_strategy.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + E3EBA5DBB9049AD4C22B5C40 = { + fileRef = "837304105638A08861FC637C"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 5000CA618AAB927B4547733A = { + isa = PBXFileReference; + name = "dynamic_compressed_row_jacobian_writer.cc"; + path = "../libs/ceres/internal/ceres/dynamic_compressed_row_jacobian_writer.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 5C7E0B0C561932B93DC9D8FC = { + fileRef = "5000CA618AAB927B4547733A"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 7F988AA541D7F021A3CB26F2 = { + isa = PBXFileReference; + name = "dynamic_compressed_row_sparse_matrix.cc"; + path = "../libs/ceres/internal/ceres/dynamic_compressed_row_sparse_matrix.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 8569668603F678050044E170 = { + fileRef = "7F988AA541D7F021A3CB26F2"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 1AFEBDC13C6D402BBB765640 = { + isa = PBXFileReference; + name = "evaluator.cc"; + path = "../libs/ceres/internal/ceres/evaluator.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + B36F4ED5D4F272812766B1A4 = { + fileRef = "1AFEBDC13C6D402BBB765640"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + EB1E9252D2C0574FE4CCCC60 = { + isa = PBXFileReference; + name = "file.cc"; + path = "../libs/ceres/internal/ceres/file.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 43D48F58C40752723564083E = { + fileRef = "EB1E9252D2C0574FE4CCCC60"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + E8A93EF65AD5B544F411BDED = { + isa = PBXFileReference; + name = "partitioned_matrix_view_d_d_d.cc"; + path = "../libs/ceres/internal/ceres/generated/partitioned_matrix_view_d_d_d.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 3C72F8586FDEBE10F5F603C6 = { + fileRef = "E8A93EF65AD5B544F411BDED"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 938A9EFDCD0F4BC92F13C20C = { + isa = PBXFileReference; + name = "schur_eliminator_d_d_d.cc"; + path = "../libs/ceres/internal/ceres/generated/schur_eliminator_d_d_d.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 6BF15CF18E4514A98B55A09A = { + fileRef = "938A9EFDCD0F4BC92F13C20C"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 30FB3D642592A1822939944B = { + isa = PBXFileReference; + name = "gradient_checking_cost_function.cc"; + path = "../libs/ceres/internal/ceres/gradient_checking_cost_function.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + BAAF472F604AF9E73F1185FC = { + fileRef = "30FB3D642592A1822939944B"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + C95E39630C62174AE0808F58 = { + isa = PBXFileReference; + name = "gradient_problem.cc"; + path = "../libs/ceres/internal/ceres/gradient_problem.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 3FF34F7DDAD0C23E79CC9BAE = { + fileRef = "C95E39630C62174AE0808F58"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 22FEA51257881CBC7BE71D5B = { + isa = PBXFileReference; + name = "gradient_problem_solver.cc"; + path = "../libs/ceres/internal/ceres/gradient_problem_solver.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 14F06A1BBD1EA1089B0FC886 = { + fileRef = "22FEA51257881CBC7BE71D5B"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + F5FE2F9D7D3DDA86B42F5948 = { + isa = PBXFileReference; + name = "implicit_schur_complement.cc"; + path = "../libs/ceres/internal/ceres/implicit_schur_complement.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 4A6E5AA9BC0379369D2ECB19 = { + fileRef = "F5FE2F9D7D3DDA86B42F5948"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + B981F11AACB721DD03A3314C = { + isa = PBXFileReference; + name = "incomplete_lq_factorization.cc"; + path = "../libs/ceres/internal/ceres/incomplete_lq_factorization.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + EBDAA1ED4A51763F27FE77EA = { + fileRef = "B981F11AACB721DD03A3314C"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 2A980F4C7463831D3B0B7CDC = { + isa = PBXFileReference; + name = "iterative_schur_complement_solver.cc"; + path = "../libs/ceres/internal/ceres/iterative_schur_complement_solver.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 7AE7BDF8852BC3DFB2C8E6CF = { + fileRef = "2A980F4C7463831D3B0B7CDC"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 5A660D5A1F695D1256DBDE89 = { + isa = PBXFileReference; + name = "lapack.cc"; + path = "../libs/ceres/internal/ceres/lapack.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + FA2217A89ED014F27DEB4BF3 = { + fileRef = "5A660D5A1F695D1256DBDE89"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 5EC4A2ED6FE04C5D32E72103 = { + isa = PBXFileReference; + name = "levenberg_marquardt_strategy.cc"; + path = "../libs/ceres/internal/ceres/levenberg_marquardt_strategy.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 97953CEBA2C8178E10DC0CF3 = { + fileRef = "5EC4A2ED6FE04C5D32E72103"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 5D8A5B74B2E59034DCA75770 = { + isa = PBXFileReference; + name = "linear_least_squares_problems.cc"; + path = "../libs/ceres/internal/ceres/linear_least_squares_problems.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + A5748B2FA7D0250AE88777AD = { + fileRef = "5D8A5B74B2E59034DCA75770"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 97C95F3ADE46593137C648DB = { + isa = PBXFileReference; + name = "linear_operator.cc"; + path = "../libs/ceres/internal/ceres/linear_operator.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 19E78E6A547867B0B713F9E0 = { + fileRef = "97C95F3ADE46593137C648DB"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 9381E60052D0CD31BB78263D = { + isa = PBXFileReference; + name = "linear_solver.cc"; + path = "../libs/ceres/internal/ceres/linear_solver.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 4CB1877E1E754197CB6B52D3 = { + fileRef = "9381E60052D0CD31BB78263D"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 6F209709D1DE4641EA18F647 = { + isa = PBXFileReference; + name = "line_search.cc"; + path = "../libs/ceres/internal/ceres/line_search.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + AD7CBE1B724A594865304294 = { + fileRef = "6F209709D1DE4641EA18F647"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 4C3FF4D26AA6F52E2F68D5FA = { + isa = PBXFileReference; + name = "line_search_direction.cc"; + path = "../libs/ceres/internal/ceres/line_search_direction.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + EE73435E63FBDDC57CD6A1CA = { + fileRef = "4C3FF4D26AA6F52E2F68D5FA"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 3BF12F6C610CC7DD790FB962 = { + isa = PBXFileReference; + name = "line_search_minimizer.cc"; + path = "../libs/ceres/internal/ceres/line_search_minimizer.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 712C0C70FE20F1010AEFEEA9 = { + fileRef = "3BF12F6C610CC7DD790FB962"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 3BEC7F2286F35E893F153F3B = { + isa = PBXFileReference; + name = "line_search_preprocessor.cc"; + path = "../libs/ceres/internal/ceres/line_search_preprocessor.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 702F8EE308964875BB4B38B5 = { + fileRef = "3BEC7F2286F35E893F153F3B"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 74A5E0A3009358BEA6BDDE6B = { + isa = PBXFileReference; + name = "local_parameterization.cc"; + path = "../libs/ceres/internal/ceres/local_parameterization.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + D82EEC2B2ABB553E765E7759 = { + fileRef = "74A5E0A3009358BEA6BDDE6B"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + C58B0F7BFE59B2CEB58344D7 = { + isa = PBXFileReference; + name = "loss_function.cc"; + path = "../libs/ceres/internal/ceres/loss_function.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + A3C31395573845E6CC0C9B6B = { + fileRef = "C58B0F7BFE59B2CEB58344D7"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + B6C4DDB3CFD578995B727F69 = { + isa = PBXFileReference; + name = "low_rank_inverse_hessian.cc"; + path = "../libs/ceres/internal/ceres/low_rank_inverse_hessian.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 095489D9291E5ABBDA73A535 = { + fileRef = "B6C4DDB3CFD578995B727F69"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 5625B5C322984A4D446BE8B2 = { + isa = PBXFileReference; + name = "minimizer.cc"; + path = "../libs/ceres/internal/ceres/minimizer.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + C79703411AAAF4A26138BE19 = { + fileRef = "5625B5C322984A4D446BE8B2"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + FAA0E2552D16CE2578E754C8 = { + isa = PBXFileReference; + name = "normal_prior.cc"; + path = "../libs/ceres/internal/ceres/normal_prior.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 6617B29CBCB470DB5E373A62 = { + fileRef = "FAA0E2552D16CE2578E754C8"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 4110979D5205EEA21F5A2D17 = { + isa = PBXFileReference; + name = "parameter_block_ordering.cc"; + path = "../libs/ceres/internal/ceres/parameter_block_ordering.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 158383CBE3945A5ADD3B80C6 = { + fileRef = "4110979D5205EEA21F5A2D17"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 62B42CEFE9503247919E55F3 = { + isa = PBXFileReference; + name = "partitioned_matrix_view.cc"; + path = "../libs/ceres/internal/ceres/partitioned_matrix_view.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 8420F5A0193E5EC5C88641DB = { + fileRef = "62B42CEFE9503247919E55F3"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 230E55A2369DBA8E71B59966 = { + isa = PBXFileReference; + name = "polynomial.cc"; + path = "../libs/ceres/internal/ceres/polynomial.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + E93ADD11E13E565D02A29F6B = { + fileRef = "230E55A2369DBA8E71B59966"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 1EF3B9479ABECF9A7D6F6851 = { + isa = PBXFileReference; + name = "preconditioner.cc"; + path = "../libs/ceres/internal/ceres/preconditioner.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 88EF33F8BF735F2C28F64643 = { + fileRef = "1EF3B9479ABECF9A7D6F6851"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 84D4EE7EF4C487D9800E5F7D = { + isa = PBXFileReference; + name = "preprocessor.cc"; + path = "../libs/ceres/internal/ceres/preprocessor.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + ED720B94005851685A09AD37 = { + fileRef = "84D4EE7EF4C487D9800E5F7D"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 6BB2A2A2F6C6A03D4E260E4D = { + isa = PBXFileReference; + name = "problem.cc"; + path = "../libs/ceres/internal/ceres/problem.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + DF5DFCAAB8B90933147CDA29 = { + fileRef = "6BB2A2A2F6C6A03D4E260E4D"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 821E5D6813BE152B250D3F45 = { + isa = PBXFileReference; + name = "problem_impl.cc"; + path = "../libs/ceres/internal/ceres/problem_impl.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 1CFF2529FDCFCB83664CEE50 = { + fileRef = "821E5D6813BE152B250D3F45"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 11F7D2BAA01FD00160F55EC7 = { + isa = PBXFileReference; + name = "program.cc"; + path = "../libs/ceres/internal/ceres/program.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + C6AC48526F09D917EBA04306 = { + fileRef = "11F7D2BAA01FD00160F55EC7"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 834A33D7114F28D1981D4DEA = { + isa = PBXFileReference; + name = "reorder_program.cc"; + path = "../libs/ceres/internal/ceres/reorder_program.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 8FB9522295138D376AC024F8 = { + fileRef = "834A33D7114F28D1981D4DEA"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 4E41DDBB569D154A65B7D4DB = { + isa = PBXFileReference; + name = "residual_block.cc"; + path = "../libs/ceres/internal/ceres/residual_block.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 6D13290B9E0D2E2C9C085F6A = { + fileRef = "4E41DDBB569D154A65B7D4DB"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + A6432697409FE0714021A2B7 = { + isa = PBXFileReference; + name = "residual_block_utils.cc"; + path = "../libs/ceres/internal/ceres/residual_block_utils.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 21EED037A0F3C47730A88462 = { + fileRef = "A6432697409FE0714021A2B7"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + F04A354B03E1E1E76037073A = { + isa = PBXFileReference; + name = "schur_complement_solver.cc"; + path = "../libs/ceres/internal/ceres/schur_complement_solver.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + E69128D31B7360668FEBF048 = { + fileRef = "F04A354B03E1E1E76037073A"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 732AE5B2CB10AEB378244464 = { + isa = PBXFileReference; + name = "schur_eliminator.cc"; + path = "../libs/ceres/internal/ceres/schur_eliminator.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 2A71A3176BE2F27EB74C0948 = { + fileRef = "732AE5B2CB10AEB378244464"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 182EB8282BA11839A6B36C55 = { + isa = PBXFileReference; + name = "schur_jacobi_preconditioner.cc"; + path = "../libs/ceres/internal/ceres/schur_jacobi_preconditioner.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 9F8183CF16CD60D173584285 = { + fileRef = "182EB8282BA11839A6B36C55"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + A1088E236939E7B97A2DC135 = { + isa = PBXFileReference; + name = "scratch_evaluate_preparer.cc"; + path = "../libs/ceres/internal/ceres/scratch_evaluate_preparer.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + F8CA433C31BF9642C9E9DB09 = { + fileRef = "A1088E236939E7B97A2DC135"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + B4278E749FF7DCBC1DC0553A = { + isa = PBXFileReference; + name = "single_linkage_clustering.cc"; + path = "../libs/ceres/internal/ceres/single_linkage_clustering.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + C1FD730A19040E93D0B3ADDC = { + fileRef = "B4278E749FF7DCBC1DC0553A"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + DC1565FCD6A68D8314C635E4 = { + isa = PBXFileReference; + name = "solver.cc"; + path = "../libs/ceres/internal/ceres/solver.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + FEEC7109F2AC1F59B4F10EEC = { + fileRef = "DC1565FCD6A68D8314C635E4"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 435493FE248DEBC8361FD4FC = { + isa = PBXFileReference; + name = "solver_utils.cc"; + path = "../libs/ceres/internal/ceres/solver_utils.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 3D83886E608DDA05C70C8AA7 = { + fileRef = "435493FE248DEBC8361FD4FC"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + B9AA111BB9DB73993DDFAAC3 = { + isa = PBXFileReference; + name = "sparse_matrix.cc"; + path = "../libs/ceres/internal/ceres/sparse_matrix.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + EB1681993E054CF2C6B0AD70 = { + fileRef = "B9AA111BB9DB73993DDFAAC3"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 1AA163643EA738A57D447691 = { + isa = PBXFileReference; + name = "sparse_normal_cholesky_solver.cc"; + path = "../libs/ceres/internal/ceres/sparse_normal_cholesky_solver.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + CA2B7701BE0F2BBE9BC7ABED = { + fileRef = "1AA163643EA738A57D447691"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 17F892C243E6DBEEA7CD49A6 = { + isa = PBXFileReference; + name = "split.cc"; + path = "../libs/ceres/internal/ceres/split.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 3BDAA367A104489FA7F565F7 = { + fileRef = "17F892C243E6DBEEA7CD49A6"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 0FC895CB77A67DD903552418 = { + isa = PBXFileReference; + name = "stringprintf.cc"; + path = "../libs/ceres/internal/ceres/stringprintf.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 3A38FAF01AD57C0B3126DE78 = { + fileRef = "0FC895CB77A67DD903552418"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + E764E26D713FC242DE6737B5 = { + isa = PBXFileReference; + name = "suitesparse.cc"; + path = "../libs/ceres/internal/ceres/suitesparse.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + E13B3FA373ACB53DD91E1247 = { + fileRef = "E764E26D713FC242DE6737B5"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 60DEBF991E651759267BC075 = { + isa = PBXFileReference; + name = "triplet_sparse_matrix.cc"; + path = "../libs/ceres/internal/ceres/triplet_sparse_matrix.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 6758BBB2DCE080D63717823D = { + fileRef = "60DEBF991E651759267BC075"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 43D9E5EABCD9D6F2ABF3296E = { + isa = PBXFileReference; + name = "trust_region_minimizer.cc"; + path = "../libs/ceres/internal/ceres/trust_region_minimizer.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 4CB9316EEBEB0A751E672614 = { + fileRef = "43D9E5EABCD9D6F2ABF3296E"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 387D7D440A733C527E121B77 = { + isa = PBXFileReference; + name = "trust_region_preprocessor.cc"; + path = "../libs/ceres/internal/ceres/trust_region_preprocessor.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + A3D760452DECB82E9055B0B1 = { + fileRef = "387D7D440A733C527E121B77"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 136A2069A9B7E0494F000E77 = { + isa = PBXFileReference; + name = "trust_region_strategy.cc"; + path = "../libs/ceres/internal/ceres/trust_region_strategy.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + DAF36F9F065553BC6C4BFB03 = { + fileRef = "136A2069A9B7E0494F000E77"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 31B023316BF57E367A1F8F39 = { + isa = PBXFileReference; + name = "types.cc"; + path = "../libs/ceres/internal/ceres/types.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 10D73E208E7F7947ABA39AFC = { + fileRef = "31B023316BF57E367A1F8F39"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + F82360CBCBEB43390C6616E4 = { + isa = PBXFileReference; + name = "visibility_based_preconditioner.cc"; + path = "../libs/ceres/internal/ceres/visibility_based_preconditioner.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 47DE60EA9F38E9059D73CF41 = { + fileRef = "F82360CBCBEB43390C6616E4"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 1325BB322B13AA5B17E5B965 = { + isa = PBXFileReference; + name = "visibility.cc"; + path = "../libs/ceres/internal/ceres/visibility.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 59E5701B8E30C71754F81F0C = { + fileRef = "1325BB322B13AA5B17E5B965"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 305EBA9B82C8D0783BD1BF3A = { + isa = PBXFileReference; + name = "wall_time.cc"; + path = "../libs/ceres/internal/ceres/wall_time.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + CC72F6FBE4D32A128C205208 = { + fileRef = "305EBA9B82C8D0783BD1BF3A"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 7B79424BC98F140CB460ECAB = { + isa = PBXFileReference; + name = "demangle.cc"; + path = "../libs/glog/src/demangle.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 49C6E0A13271C2CEA509F8A1 = { + fileRef = "7B79424BC98F140CB460ECAB"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + D35E6E30F6934D06B2AFDD51 = { + isa = PBXFileReference; + name = "logging.cc"; + path = "../libs/glog/src/logging.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 3CB16915C2FCDF063FC81683 = { + fileRef = "D35E6E30F6934D06B2AFDD51"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + D0825500889B1752ABA2464B = { + isa = PBXFileReference; + name = "raw_logging.cc"; + path = "../libs/glog/src/raw_logging.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + D8338392327A41894ED44292 = { + fileRef = "D0825500889B1752ABA2464B"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 32FA8308BF0B3EDDD6600B50 = { + isa = PBXFileReference; + name = "signalhandler.cc"; + path = "../libs/glog/src/signalhandler.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 15AFABDFB546A0AEA754EFB0 = { + fileRef = "32FA8308BF0B3EDDD6600B50"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 1B1E0C06DD9397537FD9893F = { + isa = PBXFileReference; + name = "symbolize.cc"; + path = "../libs/glog/src/symbolize.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + EF7E53D31F18275DE006BC21 = { + fileRef = "1B1E0C06DD9397537FD9893F"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + C52CBBCD3C727A85B59AE304 = { + isa = PBXFileReference; + name = "utilities.cc"; + path = "../libs/glog/src/utilities.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 94B8D622E923531EC220D30A = { + fileRef = "C52CBBCD3C727A85B59AE304"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 578EF19B6E21BB0DDD7780B3 = { + isa = PBXFileReference; + name = "vlog_is_on.cc"; + path = "../libs/glog/src/vlog_is_on.cc"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + lastKnownFileType = "sourcecode.cpp.cpp"; + }; + 8AE0A85ACA31DF37674ADADE = { + fileRef = "578EF19B6E21BB0DDD7780B3"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 277F70CC3D6A7E7B0422493F = { + isa = PBXFileReference; + name = "autodiff_cost_function.h"; + path = "../libs/ceres/include/ceres/autodiff_cost_function.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 99FCA6406489F72B52574DCB = { + isa = PBXFileReference; + name = "autodiff_local_parameterization.h"; + path = "../libs/ceres/include/ceres/autodiff_local_parameterization.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 7632E7E3BBE27CE15F5FF019 = { + isa = PBXFileReference; + name = "c_api.h"; + path = "../libs/ceres/include/ceres/c_api.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + B74D9BB73414BDC0F6E85989 = { + isa = PBXFileReference; + name = "ceres.h"; + path = "../libs/ceres/include/ceres/ceres.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + C2A29B003C8D3AE2F526875A = { + isa = PBXFileReference; + name = "conditioned_cost_function.h"; + path = "../libs/ceres/include/ceres/conditioned_cost_function.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 03413935676E50B413DBEEB1 = { + isa = PBXFileReference; + name = "cost_function.h"; + path = "../libs/ceres/include/ceres/cost_function.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + FDC0067E2775DF0C0020CFB7 = { + isa = PBXFileReference; + name = "cost_function_to_functor.h"; + path = "../libs/ceres/include/ceres/cost_function_to_functor.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 7040C2AD91D71DDFB594C93D = { + isa = PBXFileReference; + name = "covariance.h"; + path = "../libs/ceres/include/ceres/covariance.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + C89979F65FAD52C4EB31C26E = { + isa = PBXFileReference; + name = "crs_matrix.h"; + path = "../libs/ceres/include/ceres/crs_matrix.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 5EEA35F8A5D826C74C3A12E3 = { + isa = PBXFileReference; + name = "dynamic_autodiff_cost_function.h"; + path = "../libs/ceres/include/ceres/dynamic_autodiff_cost_function.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 4FA6DF15493002404F559B9A = { + isa = PBXFileReference; + name = "dynamic_numeric_diff_cost_function.h"; + path = "../libs/ceres/include/ceres/dynamic_numeric_diff_cost_function.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + F3548A4BA772429A84D89455 = { + isa = PBXFileReference; + name = "fpclassify.h"; + path = "../libs/ceres/include/ceres/fpclassify.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 3A7D83498303A594A19C9D0A = { + isa = PBXFileReference; + name = "gradient_checker.h"; + path = "../libs/ceres/include/ceres/gradient_checker.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 1E378E452887079FC32EA7E4 = { + isa = PBXFileReference; + name = "gradient_problem.h"; + path = "../libs/ceres/include/ceres/gradient_problem.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + F9EB59946E4FB56FF726C18B = { + isa = PBXFileReference; + name = "gradient_problem_solver.h"; + path = "../libs/ceres/include/ceres/gradient_problem_solver.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 5CB462273464243C5A1AB9B6 = { + isa = PBXFileReference; + name = "autodiff.h"; + path = "../libs/ceres/include/ceres/internal/autodiff.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + D544FB12490D3AC1F5D571CF = { + isa = PBXFileReference; + name = "disable_warnings.h"; + path = "../libs/ceres/include/ceres/internal/disable_warnings.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 5FC70C819377F6E10ECDE083 = { + isa = PBXFileReference; + name = "eigen.h"; + path = "../libs/ceres/include/ceres/internal/eigen.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 6950E8DBD935E26FB96CD7C1 = { + isa = PBXFileReference; + name = "fixed_array.h"; + path = "../libs/ceres/include/ceres/internal/fixed_array.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + B462329C84B932C10792F604 = { + isa = PBXFileReference; + name = "macros.h"; + path = "../libs/ceres/include/ceres/internal/macros.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 26BF4884EC13FF3D2099DB97 = { + isa = PBXFileReference; + name = "manual_constructor.h"; + path = "../libs/ceres/include/ceres/internal/manual_constructor.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + BA7FDB72E48E42A71E094D6B = { + isa = PBXFileReference; + name = "numeric_diff.h"; + path = "../libs/ceres/include/ceres/internal/numeric_diff.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 569EAA521B73C7C478F53971 = { + isa = PBXFileReference; + name = "port.h"; + path = "../libs/ceres/include/ceres/internal/port.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 88168FE6F1AA2D24BEDE532B = { + isa = PBXFileReference; + name = "reenable_warnings.h"; + path = "../libs/ceres/include/ceres/internal/reenable_warnings.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 4C6791C9F4AD68D8B8EB7B41 = { + isa = PBXFileReference; + name = "scoped_ptr.h"; + path = "../libs/ceres/include/ceres/internal/scoped_ptr.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 7A6BBB4D9CBAFD1401262AAD = { + isa = PBXFileReference; + name = "variadic_evaluate.h"; + path = "../libs/ceres/include/ceres/internal/variadic_evaluate.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + E106DD69836FD7029B58C992 = { + isa = PBXFileReference; + name = "iteration_callback.h"; + path = "../libs/ceres/include/ceres/iteration_callback.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 29DA31E8BB36CBBD1DEB7FE9 = { + isa = PBXFileReference; + name = "jet.h"; + path = "../libs/ceres/include/ceres/jet.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + AD3B98B69F4D5F6CAADB3E4B = { + isa = PBXFileReference; + name = "local_parameterization.h"; + path = "../libs/ceres/include/ceres/local_parameterization.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + FA91A18ECCA498BC0B83B29C = { + isa = PBXFileReference; + name = "loss_function.h"; + path = "../libs/ceres/include/ceres/loss_function.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 28B0657BF5B2B6759F8375B3 = { + isa = PBXFileReference; + name = "normal_prior.h"; + path = "../libs/ceres/include/ceres/normal_prior.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 37A086B451BBCF7FCC109E4E = { + isa = PBXFileReference; + name = "numeric_diff_cost_function.h"; + path = "../libs/ceres/include/ceres/numeric_diff_cost_function.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + EE78A62B986FDE5D660D8CD9 = { + isa = PBXFileReference; + name = "ordered_groups.h"; + path = "../libs/ceres/include/ceres/ordered_groups.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 759195CB7C7F8FC16B588BEA = { + isa = PBXFileReference; + name = "problem.h"; + path = "../libs/ceres/include/ceres/problem.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + CDDEC19A602971CE0664C421 = { + isa = PBXFileReference; + name = "rotation.h"; + path = "../libs/ceres/include/ceres/rotation.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 6EE776FC96108E466C63B7BB = { + isa = PBXFileReference; + name = "sized_cost_function.h"; + path = "../libs/ceres/include/ceres/sized_cost_function.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + E9BBD2CB842C784E1E53448E = { + isa = PBXFileReference; + name = "solver.h"; + path = "../libs/ceres/include/ceres/solver.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 8D99F7D0822977B6904BAB10 = { + isa = PBXFileReference; + name = "types.h"; + path = "../libs/ceres/include/ceres/types.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 300B804D870B69ABF9D1B6B2 = { + isa = PBXFileReference; + name = "version.h"; + path = "../libs/ceres/include/ceres/version.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 485288B918CA6034295DB5C7 = { + isa = PBXFileReference; + name = "array_utils.h"; + path = "../libs/ceres/internal/ceres/array_utils.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 9CD28196EB05F7A523AF63D5 = { + isa = PBXFileReference; + name = "blas.h"; + path = "../libs/ceres/internal/ceres/blas.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 1AE208EA40DD828E3F057C4F = { + isa = PBXFileReference; + name = "block_evaluate_preparer.h"; + path = "../libs/ceres/internal/ceres/block_evaluate_preparer.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + A8D7EC71072E017DD089AB5D = { + isa = PBXFileReference; + name = "block_jacobian_writer.h"; + path = "../libs/ceres/internal/ceres/block_jacobian_writer.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 61214410548A8E4FBBB97F61 = { + isa = PBXFileReference; + name = "block_jacobi_preconditioner.h"; + path = "../libs/ceres/internal/ceres/block_jacobi_preconditioner.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + A6EF3FA49A2F4B4EEBF261B8 = { + isa = PBXFileReference; + name = "block_random_access_dense_matrix.h"; + path = "../libs/ceres/internal/ceres/block_random_access_dense_matrix.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 539B5CE2B5FBBDEF72549006 = { + isa = PBXFileReference; + name = "block_random_access_diagonal_matrix.h"; + path = "../libs/ceres/internal/ceres/block_random_access_diagonal_matrix.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + B74BD77FAD433F224DEC5402 = { + isa = PBXFileReference; + name = "block_random_access_matrix.h"; + path = "../libs/ceres/internal/ceres/block_random_access_matrix.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + C9C963B7DAED6CE024159388 = { + isa = PBXFileReference; + name = "block_random_access_sparse_matrix.h"; + path = "../libs/ceres/internal/ceres/block_random_access_sparse_matrix.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + E7032B5294E87F696E49D98D = { + isa = PBXFileReference; + name = "block_sparse_matrix.h"; + path = "../libs/ceres/internal/ceres/block_sparse_matrix.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 70D17C49192C0EAFB4F65CC0 = { + isa = PBXFileReference; + name = "block_structure.h"; + path = "../libs/ceres/internal/ceres/block_structure.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 45BAEFEFA838F869CE2A179A = { + isa = PBXFileReference; + name = "callbacks.h"; + path = "../libs/ceres/internal/ceres/callbacks.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 65946C44D913D6E25B7F09E1 = { + isa = PBXFileReference; + name = "canonical_views_clustering.h"; + path = "../libs/ceres/internal/ceres/canonical_views_clustering.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 796B5082E7FA05CED4CDEDAD = { + isa = PBXFileReference; + name = "casts.h"; + path = "../libs/ceres/internal/ceres/casts.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 407FD17540E2C7EE27A6D4B9 = { + isa = PBXFileReference; + name = "cgnr_linear_operator.h"; + path = "../libs/ceres/internal/ceres/cgnr_linear_operator.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + BC4C0A0BD5A1A37BEB12E223 = { + isa = PBXFileReference; + name = "cgnr_solver.h"; + path = "../libs/ceres/internal/ceres/cgnr_solver.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + B2CC7A61DA76D8CC798C6EDE = { + isa = PBXFileReference; + name = "collections_port.h"; + path = "../libs/ceres/internal/ceres/collections_port.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + A6E69EEBB5839F5DD20E06BD = { + isa = PBXFileReference; + name = "compressed_col_sparse_matrix_utils.h"; + path = "../libs/ceres/internal/ceres/compressed_col_sparse_matrix_utils.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 6A47B8BE61B85FC66CA54665 = { + isa = PBXFileReference; + name = "compressed_row_jacobian_writer.h"; + path = "../libs/ceres/internal/ceres/compressed_row_jacobian_writer.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 117E42B0B3ADE26D27E088DF = { + isa = PBXFileReference; + name = "compressed_row_sparse_matrix.h"; + path = "../libs/ceres/internal/ceres/compressed_row_sparse_matrix.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 7F5CE37D8A3F6C78F0AFC220 = { + isa = PBXFileReference; + name = "conjugate_gradients_solver.h"; + path = "../libs/ceres/internal/ceres/conjugate_gradients_solver.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + C2293BCB1FB2E6308727EBB6 = { + isa = PBXFileReference; + name = "coordinate_descent_minimizer.h"; + path = "../libs/ceres/internal/ceres/coordinate_descent_minimizer.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 3D2ED43E9498507193406223 = { + isa = PBXFileReference; + name = "corrector.h"; + path = "../libs/ceres/internal/ceres/corrector.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 2FE508EC64ED249E2E92D89C = { + isa = PBXFileReference; + name = "covariance_impl.h"; + path = "../libs/ceres/internal/ceres/covariance_impl.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + EEC2F254C34AFA2AE9640192 = { + isa = PBXFileReference; + name = "cxsparse.h"; + path = "../libs/ceres/internal/ceres/cxsparse.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 8D848C221FBBF3295D339D9A = { + isa = PBXFileReference; + name = "dense_jacobian_writer.h"; + path = "../libs/ceres/internal/ceres/dense_jacobian_writer.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 8D1FEFB84ED76E7FCA6F7D28 = { + isa = PBXFileReference; + name = "dense_normal_cholesky_solver.h"; + path = "../libs/ceres/internal/ceres/dense_normal_cholesky_solver.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 73923AF3450ADA098D3DFCD3 = { + isa = PBXFileReference; + name = "dense_qr_solver.h"; + path = "../libs/ceres/internal/ceres/dense_qr_solver.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + F293E2A64F7D6A66B9F1B0F1 = { + isa = PBXFileReference; + name = "dense_sparse_matrix.h"; + path = "../libs/ceres/internal/ceres/dense_sparse_matrix.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 0C967221500EE22D6D369781 = { + isa = PBXFileReference; + name = "detect_structure.h"; + path = "../libs/ceres/internal/ceres/detect_structure.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + E3DE7FDA349E53F2EF259E8A = { + isa = PBXFileReference; + name = "dogleg_strategy.h"; + path = "../libs/ceres/internal/ceres/dogleg_strategy.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 8321B327A511D1B0AF379DF8 = { + isa = PBXFileReference; + name = "dynamic_compressed_row_finalizer.h"; + path = "../libs/ceres/internal/ceres/dynamic_compressed_row_finalizer.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + C9855C175A42EDF6CF507DB1 = { + isa = PBXFileReference; + name = "dynamic_compressed_row_jacobian_writer.h"; + path = "../libs/ceres/internal/ceres/dynamic_compressed_row_jacobian_writer.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 9AC494510B2782C8DAA1AC74 = { + isa = PBXFileReference; + name = "dynamic_compressed_row_sparse_matrix.h"; + path = "../libs/ceres/internal/ceres/dynamic_compressed_row_sparse_matrix.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 9EB6D9ACD0D573D6A8AF0678 = { + isa = PBXFileReference; + name = "evaluator.h"; + path = "../libs/ceres/internal/ceres/evaluator.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + A48A16824B8AD1EB58FA0FB6 = { + isa = PBXFileReference; + name = "execution_summary.h"; + path = "../libs/ceres/internal/ceres/execution_summary.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + ADC50ABCFE866CBA38B5A038 = { + isa = PBXFileReference; + name = "file.h"; + path = "../libs/ceres/internal/ceres/file.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + C41CF7E85EC0DA27D2F159BF = { + isa = PBXFileReference; + name = "gradient_checking_cost_function.h"; + path = "../libs/ceres/internal/ceres/gradient_checking_cost_function.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 0D264731A5913ECD2CF3EC08 = { + isa = PBXFileReference; + name = "gradient_problem_evaluator.h"; + path = "../libs/ceres/internal/ceres/gradient_problem_evaluator.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + AC9EB1A5205DE63D5B21CFF6 = { + isa = PBXFileReference; + name = "graph_algorithms.h"; + path = "../libs/ceres/internal/ceres/graph_algorithms.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + DF197C853596A5D393D96BAA = { + isa = PBXFileReference; + name = "graph.h"; + path = "../libs/ceres/internal/ceres/graph.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 750F235C095B6013C0C87908 = { + isa = PBXFileReference; + name = "implicit_schur_complement.h"; + path = "../libs/ceres/internal/ceres/implicit_schur_complement.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + E7E3FDDEBB6407460A65CE34 = { + isa = PBXFileReference; + name = "incomplete_lq_factorization.h"; + path = "../libs/ceres/internal/ceres/incomplete_lq_factorization.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 30293C06933B0FE2146450BF = { + isa = PBXFileReference; + name = "integral_types.h"; + path = "../libs/ceres/internal/ceres/integral_types.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 5E2BDDC4F9ED581622434A16 = { + isa = PBXFileReference; + name = "iterative_schur_complement_solver.h"; + path = "../libs/ceres/internal/ceres/iterative_schur_complement_solver.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 9CAF9F5766100848AB53126E = { + isa = PBXFileReference; + name = "lapack.h"; + path = "../libs/ceres/internal/ceres/lapack.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 8B826D396FD8E1B7E7AFCC9A = { + isa = PBXFileReference; + name = "levenberg_marquardt_strategy.h"; + path = "../libs/ceres/internal/ceres/levenberg_marquardt_strategy.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 25544FD5F5ACCB4ED10152E6 = { + isa = PBXFileReference; + name = "linear_least_squares_problems.h"; + path = "../libs/ceres/internal/ceres/linear_least_squares_problems.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 14CC691CE1121DF84EA360C6 = { + isa = PBXFileReference; + name = "linear_operator.h"; + path = "../libs/ceres/internal/ceres/linear_operator.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 4A6D00F6EAFCAADBF20ECFF2 = { + isa = PBXFileReference; + name = "linear_solver.h"; + path = "../libs/ceres/internal/ceres/linear_solver.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + D827FE20EDEB54FB4312C6F0 = { + isa = PBXFileReference; + name = "line_search_direction.h"; + path = "../libs/ceres/internal/ceres/line_search_direction.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 7142EDFA0567857940538C09 = { + isa = PBXFileReference; + name = "line_search.h"; + path = "../libs/ceres/internal/ceres/line_search.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + FF81F4D521D751E6E3E1C90D = { + isa = PBXFileReference; + name = "line_search_minimizer.h"; + path = "../libs/ceres/internal/ceres/line_search_minimizer.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 1A6C7A53610B7E389D0D9599 = { + isa = PBXFileReference; + name = "line_search_preprocessor.h"; + path = "../libs/ceres/internal/ceres/line_search_preprocessor.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + A58A6CF8FE33C886E7F83B06 = { + isa = PBXFileReference; + name = "low_rank_inverse_hessian.h"; + path = "../libs/ceres/internal/ceres/low_rank_inverse_hessian.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + E941BAD3D154785B4B706EBD = { + isa = PBXFileReference; + name = "map_util.h"; + path = "../libs/ceres/internal/ceres/map_util.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 625876D39B7DC9B8AC25F6CD = { + isa = PBXFileReference; + name = "minimizer.h"; + path = "../libs/ceres/internal/ceres/minimizer.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 65A80796E0C1F871ABB40912 = { + isa = PBXFileReference; + name = "mutex.h"; + path = "../libs/ceres/internal/ceres/mutex.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + F57612221DE8601E12CF478D = { + isa = PBXFileReference; + name = "parameter_block.h"; + path = "../libs/ceres/internal/ceres/parameter_block.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 96A9E125983A1830D1D0D38D = { + isa = PBXFileReference; + name = "parameter_block_ordering.h"; + path = "../libs/ceres/internal/ceres/parameter_block_ordering.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + C0F052BBD1392101B2740B03 = { + isa = PBXFileReference; + name = "partitioned_matrix_view.h"; + path = "../libs/ceres/internal/ceres/partitioned_matrix_view.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 7A58F00E5D3EF86FE04734FA = { + isa = PBXFileReference; + name = "partitioned_matrix_view_impl.h"; + path = "../libs/ceres/internal/ceres/partitioned_matrix_view_impl.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + EA0B45B8276E6C74362E36F6 = { + isa = PBXFileReference; + name = "polynomial.h"; + path = "../libs/ceres/internal/ceres/polynomial.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 51CB7A892623DAEA1860959E = { + isa = PBXFileReference; + name = "preconditioner.h"; + path = "../libs/ceres/internal/ceres/preconditioner.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 1876A491982D60927D6EAC07 = { + isa = PBXFileReference; + name = "preprocessor.h"; + path = "../libs/ceres/internal/ceres/preprocessor.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 6E0EA528CA07E9E3384436C8 = { + isa = PBXFileReference; + name = "problem_impl.h"; + path = "../libs/ceres/internal/ceres/problem_impl.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 1CA3B552921D10AD4DC22A37 = { + isa = PBXFileReference; + name = "program_evaluator.h"; + path = "../libs/ceres/internal/ceres/program_evaluator.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 85C5E6559282BCA4AC468BDE = { + isa = PBXFileReference; + name = "program.h"; + path = "../libs/ceres/internal/ceres/program.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + D67066444304C40AE4FF0686 = { + isa = PBXFileReference; + name = "random.h"; + path = "../libs/ceres/internal/ceres/random.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + B1C68C7666DBABF6C323B69C = { + isa = PBXFileReference; + name = "reorder_program.h"; + path = "../libs/ceres/internal/ceres/reorder_program.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 7E7F107C38913F8BA72FC31E = { + isa = PBXFileReference; + name = "residual_block.h"; + path = "../libs/ceres/internal/ceres/residual_block.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 44D9C78844D733DF1BD78103 = { + isa = PBXFileReference; + name = "residual_block_utils.h"; + path = "../libs/ceres/internal/ceres/residual_block_utils.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + E4E8BEA8E8AECBE853B07F39 = { + isa = PBXFileReference; + name = "schur_complement_solver.h"; + path = "../libs/ceres/internal/ceres/schur_complement_solver.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 41DAA0CF81D06E29270EB29C = { + isa = PBXFileReference; + name = "schur_eliminator.h"; + path = "../libs/ceres/internal/ceres/schur_eliminator.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 58C1B6B3F6BCEBCF6DD8193C = { + isa = PBXFileReference; + name = "schur_eliminator_impl.h"; + path = "../libs/ceres/internal/ceres/schur_eliminator_impl.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 766B4C98EAE1746A878940BB = { + isa = PBXFileReference; + name = "schur_jacobi_preconditioner.h"; + path = "../libs/ceres/internal/ceres/schur_jacobi_preconditioner.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + A7A24893E65B65C861EDDB56 = { + isa = PBXFileReference; + name = "scratch_evaluate_preparer.h"; + path = "../libs/ceres/internal/ceres/scratch_evaluate_preparer.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + DEBCD1041C10FFB0F5A34726 = { + isa = PBXFileReference; + name = "single_linkage_clustering.h"; + path = "../libs/ceres/internal/ceres/single_linkage_clustering.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + E4E8A150BDEB4B173F029A2B = { + isa = PBXFileReference; + name = "small_blas.h"; + path = "../libs/ceres/internal/ceres/small_blas.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 20BBA39778D869EFBA0E8CC6 = { + isa = PBXFileReference; + name = "solver_utils.h"; + path = "../libs/ceres/internal/ceres/solver_utils.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 8C128D2000508DA1DD2E2DB3 = { + isa = PBXFileReference; + name = "sparse_matrix.h"; + path = "../libs/ceres/internal/ceres/sparse_matrix.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 0356FC6BE7C1310071E88CC8 = { + isa = PBXFileReference; + name = "sparse_normal_cholesky_solver.h"; + path = "../libs/ceres/internal/ceres/sparse_normal_cholesky_solver.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + B444886FE4A499D6050FA73D = { + isa = PBXFileReference; + name = "split.h"; + path = "../libs/ceres/internal/ceres/split.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + BDE90A116A13374821A399B3 = { + isa = PBXFileReference; + name = "stl_util.h"; + path = "../libs/ceres/internal/ceres/stl_util.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + C83F52780D239CFE2B8FE091 = { + isa = PBXFileReference; + name = "stringprintf.h"; + path = "../libs/ceres/internal/ceres/stringprintf.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 64BCFEB8824248DDF7CF30BB = { + isa = PBXFileReference; + name = "suitesparse.h"; + path = "../libs/ceres/internal/ceres/suitesparse.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + B8BF1CEA5335C0D86A838AD1 = { + isa = PBXFileReference; + name = "triplet_sparse_matrix.h"; + path = "../libs/ceres/internal/ceres/triplet_sparse_matrix.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 69DB419AB63E2753562C67E5 = { + isa = PBXFileReference; + name = "trust_region_minimizer.h"; + path = "../libs/ceres/internal/ceres/trust_region_minimizer.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 255BB6D839104AE118C53206 = { + isa = PBXFileReference; + name = "trust_region_preprocessor.h"; + path = "../libs/ceres/internal/ceres/trust_region_preprocessor.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + DDABA9BFDA8CB00A5EA95AD7 = { + isa = PBXFileReference; + name = "trust_region_strategy.h"; + path = "../libs/ceres/internal/ceres/trust_region_strategy.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + C3DF3C59C35E1F0CE8A368B0 = { + isa = PBXFileReference; + name = "visibility_based_preconditioner.h"; + path = "../libs/ceres/internal/ceres/visibility_based_preconditioner.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 68FCD367073E9E818C145EB7 = { + isa = PBXFileReference; + name = "visibility.h"; + path = "../libs/ceres/internal/ceres/visibility.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + A35445D87005CB958ACF3F04 = { + isa = PBXFileReference; + name = "wall_time.h"; + path = "../libs/ceres/internal/ceres/wall_time.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 0539FDE552A12EA6DA96C647 = { + isa = PBXFileReference; + name = "commandlineflags.h"; + path = "../libs/glog/src/base/commandlineflags.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + B5723380E7961B4173B4F299 = { + isa = PBXFileReference; + name = "googleinit.h"; + path = "../libs/glog/src/base/googleinit.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 86E0EB9950644264BC8A0E9A = { + isa = PBXFileReference; + name = "mutex.h"; + path = "../libs/glog/src/base/mutex.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 16DC340EE6FF5A6DDD5BC4C4 = { + isa = PBXFileReference; + name = "config_freebsd.h"; + path = "../libs/glog/src/config_freebsd.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 480496D1419549F4DDC987D9 = { + isa = PBXFileReference; + name = "config.h"; + path = "../libs/glog/src/config.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + CD5565EAE05AF3EE37AA6267 = { + isa = PBXFileReference; + name = "config_hurd.h"; + path = "../libs/glog/src/config_hurd.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + D78270812D90D60BE5DF2761 = { + isa = PBXFileReference; + name = "config_linux.h"; + path = "../libs/glog/src/config_linux.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 4002E739B106FFB651BBB95D = { + isa = PBXFileReference; + name = "config_mac.h"; + path = "../libs/glog/src/config_mac.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 7108E376504CFEB11F71C6C5 = { + isa = PBXFileReference; + name = "demangle.h"; + path = "../libs/glog/src/demangle.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 876AF12EDECF9E8E1CB6866D = { + isa = PBXFileReference; + name = "logging.h"; + path = "../libs/glog/src/glog/logging.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 3EA1A1163FC4F1A249830E06 = { + isa = PBXFileReference; + name = "log_severity.h"; + path = "../libs/glog/src/glog/log_severity.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + D40D9BFEFB82758C98F6A7A8 = { + isa = PBXFileReference; + name = "raw_logging.h"; + path = "../libs/glog/src/glog/raw_logging.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 1D021797BCEA05F9AE946290 = { + isa = PBXFileReference; + name = "vlog_is_on.h"; + path = "../libs/glog/src/glog/vlog_is_on.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + A5FF73A30CF6461B9304C6F2 = { + isa = PBXFileReference; + name = "stacktrace_generic-inl.h"; + path = "../libs/glog/src/stacktrace_generic-inl.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 5A7046D8E55DA77BCF525A0C = { + isa = PBXFileReference; + name = "stacktrace.h"; + path = "../libs/glog/src/stacktrace.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 0DA4DD463213167DBB909BEA = { + isa = PBXFileReference; + name = "stacktrace_libunwind-inl.h"; + path = "../libs/glog/src/stacktrace_libunwind-inl.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + D5FC34F51D14C6FAF07B3103 = { + isa = PBXFileReference; + name = "stacktrace_powerpc-inl.h"; + path = "../libs/glog/src/stacktrace_powerpc-inl.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 873D157755215817E8CE9D14 = { + isa = PBXFileReference; + name = "stacktrace_x86_64-inl.h"; + path = "../libs/glog/src/stacktrace_x86_64-inl.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 0177B0806316D2F59B0F2104 = { + isa = PBXFileReference; + name = "stacktrace_x86-inl.h"; + path = "../libs/glog/src/stacktrace_x86-inl.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 03BEAEB19B8BFAFF27673019 = { + isa = PBXFileReference; + name = "symbolize.h"; + path = "../libs/glog/src/symbolize.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 4F0425C693E4DD2AA8834CE4 = { + isa = PBXFileReference; + name = "utilities.h"; + path = "../libs/glog/src/utilities.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + BDFA9E2CF5657BA29E9D4C46 = { + isa = PBXFileReference; + name = "ceres.pro"; + path = "ceres.pro"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 883D7615C4D2DE3FA1218F12 = { + isa = PBXGroup; + children = ( + "4458B98565818D7E2682FA2D"); + name = "Headers"; + refType = 4; + sourceTree = ""; + }; + 4458B98565818D7E2682FA2D = { + isa = PBXGroup; + children = ( + "4ADF3BA822EEA2B3AF314130"); + name = ".."; + refType = 4; + sourceTree = ""; + }; + 4ADF3BA822EEA2B3AF314130 = { + isa = PBXGroup; + children = ( + "27B97CC8CC589073F9C5B3A6", + "220A4C01503A064EEC3E5B55"); + name = "libs"; + refType = 4; + sourceTree = ""; + }; + 27B97CC8CC589073F9C5B3A6 = { + isa = PBXGroup; + children = ( + "1FDBD76AC3D5BD677BF814DB", + "50855E39BD928CFB04F1E834"); + name = "ceres"; + refType = 4; + sourceTree = ""; + }; + 1FDBD76AC3D5BD677BF814DB = { + isa = PBXGroup; + children = ( + "C8A14A15FA0853963BD47D40"); + name = "include"; + refType = 4; + sourceTree = ""; + }; + C8A14A15FA0853963BD47D40 = { + isa = PBXGroup; + children = ( + "277F70CC3D6A7E7B0422493F", + "99FCA6406489F72B52574DCB", + "7632E7E3BBE27CE15F5FF019", + "B74D9BB73414BDC0F6E85989", + "C2A29B003C8D3AE2F526875A", + "03413935676E50B413DBEEB1", + "FDC0067E2775DF0C0020CFB7", + "7040C2AD91D71DDFB594C93D", + "C89979F65FAD52C4EB31C26E", + "5EEA35F8A5D826C74C3A12E3", + "4FA6DF15493002404F559B9A", + "F3548A4BA772429A84D89455", + "3A7D83498303A594A19C9D0A", + "1E378E452887079FC32EA7E4", + "F9EB59946E4FB56FF726C18B", + "44A49D5310C226679C128213", + "E106DD69836FD7029B58C992", + "29DA31E8BB36CBBD1DEB7FE9", + "AD3B98B69F4D5F6CAADB3E4B", + "FA91A18ECCA498BC0B83B29C", + "28B0657BF5B2B6759F8375B3", + "37A086B451BBCF7FCC109E4E", + "EE78A62B986FDE5D660D8CD9", + "759195CB7C7F8FC16B588BEA", + "CDDEC19A602971CE0664C421", + "6EE776FC96108E466C63B7BB", + "E9BBD2CB842C784E1E53448E", + "8D99F7D0822977B6904BAB10", + "300B804D870B69ABF9D1B6B2"); + name = "ceres"; + refType = 4; + sourceTree = ""; + }; + 44A49D5310C226679C128213 = { + isa = PBXGroup; + children = ( + "5CB462273464243C5A1AB9B6", + "D544FB12490D3AC1F5D571CF", + "5FC70C819377F6E10ECDE083", + "6950E8DBD935E26FB96CD7C1", + "B462329C84B932C10792F604", + "26BF4884EC13FF3D2099DB97", + "BA7FDB72E48E42A71E094D6B", + "569EAA521B73C7C478F53971", + "88168FE6F1AA2D24BEDE532B", + "4C6791C9F4AD68D8B8EB7B41", + "7A6BBB4D9CBAFD1401262AAD"); + name = "internal"; + refType = 4; + sourceTree = ""; + }; + 50855E39BD928CFB04F1E834 = { + isa = PBXGroup; + children = ( + "5598DBC5FF007B4C3B06128F"); + name = "internal"; + refType = 4; + sourceTree = ""; + }; + 5598DBC5FF007B4C3B06128F = { + isa = PBXGroup; + children = ( + "485288B918CA6034295DB5C7", + "9CD28196EB05F7A523AF63D5", + "1AE208EA40DD828E3F057C4F", + "A8D7EC71072E017DD089AB5D", + "61214410548A8E4FBBB97F61", + "A6EF3FA49A2F4B4EEBF261B8", + "539B5CE2B5FBBDEF72549006", + "B74BD77FAD433F224DEC5402", + "C9C963B7DAED6CE024159388", + "E7032B5294E87F696E49D98D", + "70D17C49192C0EAFB4F65CC0", + "45BAEFEFA838F869CE2A179A", + "65946C44D913D6E25B7F09E1", + "796B5082E7FA05CED4CDEDAD", + "407FD17540E2C7EE27A6D4B9", + "BC4C0A0BD5A1A37BEB12E223", + "B2CC7A61DA76D8CC798C6EDE", + "A6E69EEBB5839F5DD20E06BD", + "6A47B8BE61B85FC66CA54665", + "117E42B0B3ADE26D27E088DF", + "7F5CE37D8A3F6C78F0AFC220", + "C2293BCB1FB2E6308727EBB6", + "3D2ED43E9498507193406223", + "2FE508EC64ED249E2E92D89C", + "EEC2F254C34AFA2AE9640192", + "8D848C221FBBF3295D339D9A", + "8D1FEFB84ED76E7FCA6F7D28", + "73923AF3450ADA098D3DFCD3", + "F293E2A64F7D6A66B9F1B0F1", + "0C967221500EE22D6D369781", + "E3DE7FDA349E53F2EF259E8A", + "8321B327A511D1B0AF379DF8", + "C9855C175A42EDF6CF507DB1", + "9AC494510B2782C8DAA1AC74", + "9EB6D9ACD0D573D6A8AF0678", + "A48A16824B8AD1EB58FA0FB6", + "ADC50ABCFE866CBA38B5A038", + "C41CF7E85EC0DA27D2F159BF", + "0D264731A5913ECD2CF3EC08", + "AC9EB1A5205DE63D5B21CFF6", + "DF197C853596A5D393D96BAA", + "750F235C095B6013C0C87908", + "E7E3FDDEBB6407460A65CE34", + "30293C06933B0FE2146450BF", + "5E2BDDC4F9ED581622434A16", + "9CAF9F5766100848AB53126E", + "8B826D396FD8E1B7E7AFCC9A", + "25544FD5F5ACCB4ED10152E6", + "14CC691CE1121DF84EA360C6", + "4A6D00F6EAFCAADBF20ECFF2", + "D827FE20EDEB54FB4312C6F0", + "7142EDFA0567857940538C09", + "FF81F4D521D751E6E3E1C90D", + "1A6C7A53610B7E389D0D9599", + "A58A6CF8FE33C886E7F83B06", + "E941BAD3D154785B4B706EBD", + "625876D39B7DC9B8AC25F6CD", + "65A80796E0C1F871ABB40912", + "F57612221DE8601E12CF478D", + "96A9E125983A1830D1D0D38D", + "C0F052BBD1392101B2740B03", + "7A58F00E5D3EF86FE04734FA", + "EA0B45B8276E6C74362E36F6", + "51CB7A892623DAEA1860959E", + "1876A491982D60927D6EAC07", + "6E0EA528CA07E9E3384436C8", + "1CA3B552921D10AD4DC22A37", + "85C5E6559282BCA4AC468BDE", + "D67066444304C40AE4FF0686", + "B1C68C7666DBABF6C323B69C", + "7E7F107C38913F8BA72FC31E", + "44D9C78844D733DF1BD78103", + "E4E8BEA8E8AECBE853B07F39", + "41DAA0CF81D06E29270EB29C", + "58C1B6B3F6BCEBCF6DD8193C", + "766B4C98EAE1746A878940BB", + "A7A24893E65B65C861EDDB56", + "DEBCD1041C10FFB0F5A34726", + "E4E8A150BDEB4B173F029A2B", + "20BBA39778D869EFBA0E8CC6", + "8C128D2000508DA1DD2E2DB3", + "0356FC6BE7C1310071E88CC8", + "B444886FE4A499D6050FA73D", + "BDE90A116A13374821A399B3", + "C83F52780D239CFE2B8FE091", + "64BCFEB8824248DDF7CF30BB", + "B8BF1CEA5335C0D86A838AD1", + "69DB419AB63E2753562C67E5", + "255BB6D839104AE118C53206", + "DDABA9BFDA8CB00A5EA95AD7", + "C3DF3C59C35E1F0CE8A368B0", + "68FCD367073E9E818C145EB7", + "A35445D87005CB958ACF3F04"); + name = "ceres"; + refType = 4; + sourceTree = ""; + }; + 220A4C01503A064EEC3E5B55 = { + isa = PBXGroup; + children = ( + "42A3B3CA22B8CF5F72568D25"); + name = "glog"; + refType = 4; + sourceTree = ""; + }; + 42A3B3CA22B8CF5F72568D25 = { + isa = PBXGroup; + children = ( + "497AC667D3068BD65088E84D", + "16DC340EE6FF5A6DDD5BC4C4", + "480496D1419549F4DDC987D9", + "CD5565EAE05AF3EE37AA6267", + "D78270812D90D60BE5DF2761", + "4002E739B106FFB651BBB95D", + "7108E376504CFEB11F71C6C5", + "9F854580EF8F74ABA4532C0C", + "A5FF73A30CF6461B9304C6F2", + "5A7046D8E55DA77BCF525A0C", + "0DA4DD463213167DBB909BEA", + "D5FC34F51D14C6FAF07B3103", + "873D157755215817E8CE9D14", + "0177B0806316D2F59B0F2104", + "03BEAEB19B8BFAFF27673019", + "4F0425C693E4DD2AA8834CE4"); + name = "src"; + refType = 4; + sourceTree = ""; + }; + 497AC667D3068BD65088E84D = { + isa = PBXGroup; + children = ( + "0539FDE552A12EA6DA96C647", + "B5723380E7961B4173B4F299", + "86E0EB9950644264BC8A0E9A"); + name = "base"; + refType = 4; + sourceTree = ""; + }; + 9F854580EF8F74ABA4532C0C = { + isa = PBXGroup; + children = ( + "876AF12EDECF9E8E1CB6866D", + "3EA1A1163FC4F1A249830E06", + "D40D9BFEFB82758C98F6A7A8", + "1D021797BCEA05F9AE946290"); + name = "glog"; + refType = 4; + sourceTree = ""; + }; + BFA3A29D17FD123C907B6E35 = { + isa = PBXGroup; + children = ( + "CF7B803FE3C9F0CA6A6971C2"); + name = ".."; + refType = 4; + sourceTree = ""; + }; + CF7B803FE3C9F0CA6A6971C2 = { + isa = PBXGroup; + children = ( + "6E08B2381A26108E7B6194CE", + "072FD262AFA1442BD80C9F97"); + name = "libs"; + refType = 4; + sourceTree = ""; + }; + 6E08B2381A26108E7B6194CE = { + isa = PBXGroup; + children = ( + "79C395026E269351E3913EAA"); + name = "ceres"; + refType = 4; + sourceTree = ""; + }; + 79C395026E269351E3913EAA = { + isa = PBXGroup; + children = ( + "C451900DBAA52A37B00BB35E"); + name = "internal"; + refType = 4; + sourceTree = ""; + }; + C451900DBAA52A37B00BB35E = { + isa = PBXGroup; + children = ( + "16DC6676CCD725E080021DFE", + "529C7FA5C87EBAA8A24C237F", + "5CD625DE3D1B36D042ACEADB", + "F4E2F087483EF972C1875582", + "27E9673BD8E2F2A795B1C762", + "23979218EEBC15095DB760FF", + "1D223A54D94D8E67F90DA1DD", + "50B4D41EAFDE35F4E66B6FB1", + "538B233E48B2A6EE9D6400A7", + "9C99D00AF2EC2C1E0D5651FC", + "FB348526FCB438C5C23AF5B5", + "837E0AA7BC0948A35226DE98", + "FA648D4C00FD27AE26FBCB43", + "11B61ACFE41D21A33D17D066", + "3F28EFB5A4824EA7CBC94CDF", + "28EFBB9245E5090DB2C7622C", + "1F2DD4F349E35BCEB719AEBF", + "210B827364E18CFAE2BE2D7F", + "DE5A0431C74420CBDC4928FF", + "6450DBB8136ACC6ADF2DF52B", + "6D71CC88837E6525DC4D42F1", + "D1515E55D959BFCC74D93CC0", + "CFCF175A6168FACF1CF82A6D", + "EE3E439E06A25E1AC38DA980", + "4489E390B4423DE7B4204C8E", + "371E6066AE24AA9A5BB9F863", + "FA033A6844A598623179FE48", + "AEB1221E240E4D77B9943916", + "DC5F3E1F05DB46A7522B82B4", + "837304105638A08861FC637C", + "5000CA618AAB927B4547733A", + "7F988AA541D7F021A3CB26F2", + "1AFEBDC13C6D402BBB765640", + "EB1E9252D2C0574FE4CCCC60", + "B15EC1DA2CA2C32E99CF3C16", + "30FB3D642592A1822939944B", + "C95E39630C62174AE0808F58", + "22FEA51257881CBC7BE71D5B", + "F5FE2F9D7D3DDA86B42F5948", + "B981F11AACB721DD03A3314C", + "2A980F4C7463831D3B0B7CDC", + "5A660D5A1F695D1256DBDE89", + "5EC4A2ED6FE04C5D32E72103", + "5D8A5B74B2E59034DCA75770", + "97C95F3ADE46593137C648DB", + "9381E60052D0CD31BB78263D", + "6F209709D1DE4641EA18F647", + "4C3FF4D26AA6F52E2F68D5FA", + "3BF12F6C610CC7DD790FB962", + "3BEC7F2286F35E893F153F3B", + "74A5E0A3009358BEA6BDDE6B", + "C58B0F7BFE59B2CEB58344D7", + "B6C4DDB3CFD578995B727F69", + "5625B5C322984A4D446BE8B2", + "FAA0E2552D16CE2578E754C8", + "4110979D5205EEA21F5A2D17", + "62B42CEFE9503247919E55F3", + "230E55A2369DBA8E71B59966", + "1EF3B9479ABECF9A7D6F6851", + "84D4EE7EF4C487D9800E5F7D", + "6BB2A2A2F6C6A03D4E260E4D", + "821E5D6813BE152B250D3F45", + "11F7D2BAA01FD00160F55EC7", + "834A33D7114F28D1981D4DEA", + "4E41DDBB569D154A65B7D4DB", + "A6432697409FE0714021A2B7", + "F04A354B03E1E1E76037073A", + "732AE5B2CB10AEB378244464", + "182EB8282BA11839A6B36C55", + "A1088E236939E7B97A2DC135", + "B4278E749FF7DCBC1DC0553A", + "DC1565FCD6A68D8314C635E4", + "435493FE248DEBC8361FD4FC", + "B9AA111BB9DB73993DDFAAC3", + "1AA163643EA738A57D447691", + "17F892C243E6DBEEA7CD49A6", + "0FC895CB77A67DD903552418", + "E764E26D713FC242DE6737B5", + "60DEBF991E651759267BC075", + "43D9E5EABCD9D6F2ABF3296E", + "387D7D440A733C527E121B77", + "136A2069A9B7E0494F000E77", + "31B023316BF57E367A1F8F39", + "F82360CBCBEB43390C6616E4", + "1325BB322B13AA5B17E5B965", + "305EBA9B82C8D0783BD1BF3A"); + name = "ceres"; + refType = 4; + sourceTree = ""; + }; + B15EC1DA2CA2C32E99CF3C16 = { + isa = PBXGroup; + children = ( + "E8A93EF65AD5B544F411BDED", + "938A9EFDCD0F4BC92F13C20C"); + name = "generated"; + refType = 4; + sourceTree = ""; + }; + 072FD262AFA1442BD80C9F97 = { + isa = PBXGroup; + children = ( + "57F04EEA14BB027C75291513"); + name = "glog"; + refType = 4; + sourceTree = ""; + }; + 57F04EEA14BB027C75291513 = { + isa = PBXGroup; + children = ( + "7B79424BC98F140CB460ECAB", + "D35E6E30F6934D06B2AFDD51", + "D0825500889B1752ABA2464B", + "32FA8308BF0B3EDDD6600B50", + "1B1E0C06DD9397537FD9893F", + "C52CBBCD3C727A85B59AE304", + "578EF19B6E21BB0DDD7780B3"); + name = "src"; + refType = 4; + sourceTree = ""; + }; + FB61758D0F0FDA4BA867C3D5 = { + isa = PBXGroup; + children = ( + "BFA3A29D17FD123C907B6E35"); + name = "Sources"; + refType = 4; + sourceTree = ""; + }; + 7CABE3C80E79AD2B307756D2 = { + isa = PBXGroup; + children = ( + "BDFA9E2CF5657BA29E9D4C46"); + name = "Sources [qmake]"; + refType = 4; + sourceTree = ""; + }; + A0A52A2ADF7A1E2A99738674 = { + buildActionMask = 2147483647; + files = ( + ); + generatedFileNames = ( + "11AF19B3026E737C268E69D7", + "EB6F14EFBF32329C15030C97", + "1107147767FC3ADC80B0C30B", + "0660B8324202B3E976C1A531", + "7146FFFAA15F912A37E0CF51", + "921D3549DADEEAC71CE8BA71", + "5498923F9C447660CDF2E842", + "750E1D60500E276145AC8ADD", + "3421F4F978C3F9FA196C5677", + "24B21F10DB04E83DC7C77227", + "B5D96611BA57E978D5A2675E", + "D210C957721242F784051874", + "4A53598650E90C6F3C97780C", + "AF7A0241307467E43F29CC35", + "CD05907880B1952B1CA8E666", + "F1F080A5A4AD980B32A69DE7", + "6F12D6C75E7BFB57BFB1EE26", + "1701E81E4C29C84F5E1F0C21", + "3E71EE233E56656B699906F2", + "A4454067FF9D581B4CB655E7", + "85D16DCDD2ADE07C10F23B67", + "DBA69DE81853201AEF907A88", + "FA0A20435699BFC1CEE68997", + "49A703593B8E016337DF7782", + "09697209D1E08995B2DAA985", + "D38A18B0B96C19CA055F3B13", + "27623FACAC7686AC7616282C", + "F66C847A3CF0DBB53326F6B7", + "1CDB293002ECD622E1F1C1DD", + "E3EBA5DBB9049AD4C22B5C40", + "5C7E0B0C561932B93DC9D8FC", + "8569668603F678050044E170", + "B36F4ED5D4F272812766B1A4", + "43D48F58C40752723564083E", + "3C72F8586FDEBE10F5F603C6", + "6BF15CF18E4514A98B55A09A", + "BAAF472F604AF9E73F1185FC", + "3FF34F7DDAD0C23E79CC9BAE", + "14F06A1BBD1EA1089B0FC886", + "4A6E5AA9BC0379369D2ECB19", + "EBDAA1ED4A51763F27FE77EA", + "7AE7BDF8852BC3DFB2C8E6CF", + "FA2217A89ED014F27DEB4BF3", + "97953CEBA2C8178E10DC0CF3", + "A5748B2FA7D0250AE88777AD", + "19E78E6A547867B0B713F9E0", + "4CB1877E1E754197CB6B52D3", + "AD7CBE1B724A594865304294", + "EE73435E63FBDDC57CD6A1CA", + "712C0C70FE20F1010AEFEEA9", + "702F8EE308964875BB4B38B5", + "D82EEC2B2ABB553E765E7759", + "A3C31395573845E6CC0C9B6B", + "095489D9291E5ABBDA73A535", + "C79703411AAAF4A26138BE19", + "6617B29CBCB470DB5E373A62", + "158383CBE3945A5ADD3B80C6", + "8420F5A0193E5EC5C88641DB", + "E93ADD11E13E565D02A29F6B", + "88EF33F8BF735F2C28F64643", + "ED720B94005851685A09AD37", + "DF5DFCAAB8B90933147CDA29", + "1CFF2529FDCFCB83664CEE50", + "C6AC48526F09D917EBA04306", + "8FB9522295138D376AC024F8", + "6D13290B9E0D2E2C9C085F6A", + "21EED037A0F3C47730A88462", + "E69128D31B7360668FEBF048", + "2A71A3176BE2F27EB74C0948", + "9F8183CF16CD60D173584285", + "F8CA433C31BF9642C9E9DB09", + "C1FD730A19040E93D0B3ADDC", + "FEEC7109F2AC1F59B4F10EEC", + "3D83886E608DDA05C70C8AA7", + "EB1681993E054CF2C6B0AD70", + "CA2B7701BE0F2BBE9BC7ABED", + "3BDAA367A104489FA7F565F7", + "3A38FAF01AD57C0B3126DE78", + "E13B3FA373ACB53DD91E1247", + "6758BBB2DCE080D63717823D", + "4CB9316EEBEB0A751E672614", + "A3D760452DECB82E9055B0B1", + "DAF36F9F065553BC6C4BFB03", + "10D73E208E7F7947ABA39AFC", + "47DE60EA9F38E9059D73CF41", + "59E5701B8E30C71754F81F0C", + "CC72F6FBE4D32A128C205208", + "49C6E0A13271C2CEA509F8A1", + "3CB16915C2FCDF063FC81683", + "D8338392327A41894ED44292", + "15AFABDFB546A0AEA754EFB0", + "EF7E53D31F18275DE006BC21", + "94B8D622E923531EC220D30A", + "8AE0A85ACA31DF37674ADADE"); + isa = PBXShellScriptBuildPhase; + name = "Qt Preprocessors"; + neededFileNames = ( + "11AF19B3026E737C268E69D7", + "EB6F14EFBF32329C15030C97", + "1107147767FC3ADC80B0C30B", + "0660B8324202B3E976C1A531", + "7146FFFAA15F912A37E0CF51", + "921D3549DADEEAC71CE8BA71", + "5498923F9C447660CDF2E842", + "750E1D60500E276145AC8ADD", + "3421F4F978C3F9FA196C5677", + "24B21F10DB04E83DC7C77227", + "B5D96611BA57E978D5A2675E", + "D210C957721242F784051874", + "4A53598650E90C6F3C97780C", + "AF7A0241307467E43F29CC35", + "CD05907880B1952B1CA8E666", + "F1F080A5A4AD980B32A69DE7", + "6F12D6C75E7BFB57BFB1EE26", + "1701E81E4C29C84F5E1F0C21", + "3E71EE233E56656B699906F2", + "A4454067FF9D581B4CB655E7", + "85D16DCDD2ADE07C10F23B67", + "DBA69DE81853201AEF907A88", + "FA0A20435699BFC1CEE68997", + "49A703593B8E016337DF7782", + "09697209D1E08995B2DAA985", + "D38A18B0B96C19CA055F3B13", + "27623FACAC7686AC7616282C", + "F66C847A3CF0DBB53326F6B7", + "1CDB293002ECD622E1F1C1DD", + "E3EBA5DBB9049AD4C22B5C40", + "5C7E0B0C561932B93DC9D8FC", + "8569668603F678050044E170", + "B36F4ED5D4F272812766B1A4", + "43D48F58C40752723564083E", + "3C72F8586FDEBE10F5F603C6", + "6BF15CF18E4514A98B55A09A", + "BAAF472F604AF9E73F1185FC", + "3FF34F7DDAD0C23E79CC9BAE", + "14F06A1BBD1EA1089B0FC886", + "4A6E5AA9BC0379369D2ECB19", + "EBDAA1ED4A51763F27FE77EA", + "7AE7BDF8852BC3DFB2C8E6CF", + "FA2217A89ED014F27DEB4BF3", + "97953CEBA2C8178E10DC0CF3", + "A5748B2FA7D0250AE88777AD", + "19E78E6A547867B0B713F9E0", + "4CB1877E1E754197CB6B52D3", + "AD7CBE1B724A594865304294", + "EE73435E63FBDDC57CD6A1CA", + "712C0C70FE20F1010AEFEEA9", + "702F8EE308964875BB4B38B5", + "D82EEC2B2ABB553E765E7759", + "A3C31395573845E6CC0C9B6B", + "095489D9291E5ABBDA73A535", + "C79703411AAAF4A26138BE19", + "6617B29CBCB470DB5E373A62", + "158383CBE3945A5ADD3B80C6", + "8420F5A0193E5EC5C88641DB", + "E93ADD11E13E565D02A29F6B", + "88EF33F8BF735F2C28F64643", + "ED720B94005851685A09AD37", + "DF5DFCAAB8B90933147CDA29", + "1CFF2529FDCFCB83664CEE50", + "C6AC48526F09D917EBA04306", + "8FB9522295138D376AC024F8", + "6D13290B9E0D2E2C9C085F6A", + "21EED037A0F3C47730A88462", + "E69128D31B7360668FEBF048", + "2A71A3176BE2F27EB74C0948", + "9F8183CF16CD60D173584285", + "F8CA433C31BF9642C9E9DB09", + "C1FD730A19040E93D0B3ADDC", + "FEEC7109F2AC1F59B4F10EEC", + "3D83886E608DDA05C70C8AA7", + "EB1681993E054CF2C6B0AD70", + "CA2B7701BE0F2BBE9BC7ABED", + "3BDAA367A104489FA7F565F7", + "3A38FAF01AD57C0B3126DE78", + "E13B3FA373ACB53DD91E1247", + "6758BBB2DCE080D63717823D", + "4CB9316EEBEB0A751E672614", + "A3D760452DECB82E9055B0B1", + "DAF36F9F065553BC6C4BFB03", + "10D73E208E7F7947ABA39AFC", + "47DE60EA9F38E9059D73CF41", + "59E5701B8E30C71754F81F0C", + "CC72F6FBE4D32A128C205208", + "49C6E0A13271C2CEA509F8A1", + "3CB16915C2FCDF063FC81683", + "D8338392327A41894ED44292", + "15AFABDFB546A0AEA754EFB0", + "EF7E53D31F18275DE006BC21", + "94B8D622E923531EC220D30A", + "8AE0A85ACA31DF37674ADADE"); + shellPath = "/bin/sh"; + shellScript = "make\ -C\ /Users/alexandre/development/Natron/ceres\ -f\ \'ceres.xcodeproj/qt_preprocess.mak\'"; + }; + C29B8785722055ED95EF7B57 = { + buildActionMask = 2147483647; + files = ( + "11AF19B3026E737C268E69D7", + "EB6F14EFBF32329C15030C97", + "1107147767FC3ADC80B0C30B", + "0660B8324202B3E976C1A531", + "7146FFFAA15F912A37E0CF51", + "921D3549DADEEAC71CE8BA71", + "5498923F9C447660CDF2E842", + "750E1D60500E276145AC8ADD", + "3421F4F978C3F9FA196C5677", + "24B21F10DB04E83DC7C77227", + "B5D96611BA57E978D5A2675E", + "D210C957721242F784051874", + "4A53598650E90C6F3C97780C", + "AF7A0241307467E43F29CC35", + "CD05907880B1952B1CA8E666", + "F1F080A5A4AD980B32A69DE7", + "6F12D6C75E7BFB57BFB1EE26", + "1701E81E4C29C84F5E1F0C21", + "3E71EE233E56656B699906F2", + "A4454067FF9D581B4CB655E7", + "85D16DCDD2ADE07C10F23B67", + "DBA69DE81853201AEF907A88", + "FA0A20435699BFC1CEE68997", + "49A703593B8E016337DF7782", + "09697209D1E08995B2DAA985", + "D38A18B0B96C19CA055F3B13", + "27623FACAC7686AC7616282C", + "F66C847A3CF0DBB53326F6B7", + "1CDB293002ECD622E1F1C1DD", + "E3EBA5DBB9049AD4C22B5C40", + "5C7E0B0C561932B93DC9D8FC", + "8569668603F678050044E170", + "B36F4ED5D4F272812766B1A4", + "43D48F58C40752723564083E", + "3C72F8586FDEBE10F5F603C6", + "6BF15CF18E4514A98B55A09A", + "BAAF472F604AF9E73F1185FC", + "3FF34F7DDAD0C23E79CC9BAE", + "14F06A1BBD1EA1089B0FC886", + "4A6E5AA9BC0379369D2ECB19", + "EBDAA1ED4A51763F27FE77EA", + "7AE7BDF8852BC3DFB2C8E6CF", + "FA2217A89ED014F27DEB4BF3", + "97953CEBA2C8178E10DC0CF3", + "A5748B2FA7D0250AE88777AD", + "19E78E6A547867B0B713F9E0", + "4CB1877E1E754197CB6B52D3", + "AD7CBE1B724A594865304294", + "EE73435E63FBDDC57CD6A1CA", + "712C0C70FE20F1010AEFEEA9", + "702F8EE308964875BB4B38B5", + "D82EEC2B2ABB553E765E7759", + "A3C31395573845E6CC0C9B6B", + "095489D9291E5ABBDA73A535", + "C79703411AAAF4A26138BE19", + "6617B29CBCB470DB5E373A62", + "158383CBE3945A5ADD3B80C6", + "8420F5A0193E5EC5C88641DB", + "E93ADD11E13E565D02A29F6B", + "88EF33F8BF735F2C28F64643", + "ED720B94005851685A09AD37", + "DF5DFCAAB8B90933147CDA29", + "1CFF2529FDCFCB83664CEE50", + "C6AC48526F09D917EBA04306", + "8FB9522295138D376AC024F8", + "6D13290B9E0D2E2C9C085F6A", + "21EED037A0F3C47730A88462", + "E69128D31B7360668FEBF048", + "2A71A3176BE2F27EB74C0948", + "9F8183CF16CD60D173584285", + "F8CA433C31BF9642C9E9DB09", + "C1FD730A19040E93D0B3ADDC", + "FEEC7109F2AC1F59B4F10EEC", + "3D83886E608DDA05C70C8AA7", + "EB1681993E054CF2C6B0AD70", + "CA2B7701BE0F2BBE9BC7ABED", + "3BDAA367A104489FA7F565F7", + "3A38FAF01AD57C0B3126DE78", + "E13B3FA373ACB53DD91E1247", + "6758BBB2DCE080D63717823D", + "4CB9316EEBEB0A751E672614", + "A3D760452DECB82E9055B0B1", + "DAF36F9F065553BC6C4BFB03", + "10D73E208E7F7947ABA39AFC", + "47DE60EA9F38E9059D73CF41", + "59E5701B8E30C71754F81F0C", + "CC72F6FBE4D32A128C205208", + "49C6E0A13271C2CEA509F8A1", + "3CB16915C2FCDF063FC81683", + "D8338392327A41894ED44292", + "15AFABDFB546A0AEA754EFB0", + "EF7E53D31F18275DE006BC21", + "94B8D622E923531EC220D30A", + "8AE0A85ACA31DF37674ADADE"); + isa = PBXSourcesBuildPhase; + name = "Build Sources"; + }; + 2A1043669E6E5A7426EA502A = { + buildActionMask = 2147483647; + files = ( + ); + isa = PBXFrameworksBuildPhase; + name = "Frameworks & Libraries"; + }; + 05596AB53D8D521C69802C27 = { + children = ( + "FB61758D0F0FDA4BA867C3D5", + "883D7615C4D2DE3FA1218F12", + "7CABE3C80E79AD2B307756D2"); + isa = PBXGroup; + name = "ceres"; + path = ""; + refType = 4; + sourceTree = ""; + }; + BB2596081CAD184B800CF99D = { + isa = PBXFileReference; + explicitFileType = "compiled.mach-o.dylib"; + path = "libceres.a"; + refType = 3; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 068F80C7519D0528FB08E821 = { + children = ( + "BB2596081CAD184B800CF99D"); + isa = PBXGroup; + name = "Products"; + refType = 4; + }; + B72CC4B33C9020E72F8C7D40 = { + buildPhases = ( + "D7BA7D76DAB5DD13389D6332", + "A0A52A2ADF7A1E2A99738674", + "C29B8785722055ED95EF7B57", + "2A1043669E6E5A7426EA502A"); + buildSettings = { + CC = "/usr/bin/clang"; + CPLUSPLUS = "/usr/bin/clang++"; + LEXFLAGS = ""; + YACCFLAGS = "-d"; + OTHER_REZFLAGS = ""; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ""; + PREBINDING = NO; + BUILD_ROOT = "/Users/alexandre/development/Natron/ceres"; + INSTALL_PATH = ""; + DYLIB_CURRENT_VERSION = "1.0.0"; + DYLIB_COMPATIBILITY_VERSION = "1.0"; + MACOSX_DEPLOYMENT_TARGET = "10.11"; + LIBRARY_STYLE = "STATIC"; + PRODUCT_NAME = "ceres"; + }; + conditionalBuildSettings = { + }; + dependencies = ( + ); + productReference = "BB2596081CAD184B800CF99D"; + shouldUseHeadermap = 1; + buildConfigurationList = 17B3380A4D6A7D415E7F2E1E; + isa = PBXNativeTarget; + name = "ceres"; + productName = "ceres"; + productType = "com.apple.product-type.library.static"; + startupPath = "<>"; + }; + 4B72B24813252891014BCF61 = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = "NO"; + GCC_GENERATE_DEBUGGING_SYMBOLS = "YES"; + GCC_OPTIMIZATION_LEVEL = "0"; + PRODUCT_NAME = "ceres"; + HEADER_SEARCH_PATHS = ( + "/opt/local/include", + "../libs/ceres/config", + "../libs/ceres/include", + "../libs/ceres/internal", + "../libs/gflags", + "../libs/gflags/src", + "../libs/gflags/src/gflags", + "../libs/glog/src", + "../libs/libmv/third_party", + "../libs/Eigen3", + "../libs/glog/src", + "/usr/local/include", + "/System/Library/Frameworks/CarbonCore.framework/Headers", + "/opt/local/libexec/qt4/share/mkspecs/macx-xcode"); + LIBRARY_SEARCH_PATHS = ( + ); + FRAMEWORK_SEARCH_PATHS = ( + ); + INFOPLIST_FILE = "Info.plist"; + OTHER_CFLAGS = ( + "-pipe", + "-g", + "-Wall", + "-W", + "-fPIC", + "-DCERES_HAVE_PTHREAD", + "-DCERES_NO_SUITESPARSE", + "-DCERES_NO_CXSPARSE", + "-DCERES_HAVE_RWLOCK", + "-DCERES_NO_LAPACK", + "-DCERES_RESTRICT_SCHUR_SPECIALIZATION", + "-DWITH_LIBMV_GUARDED_ALLOC", + "-DGOOGLE_GLOG_DLL_DECL=", + "-DLIBMV_NO_FAST_DETECTOR=", + "-DCERES_BOOST_SHARED_PTR", + "-DCERES_BOOST_UNORDERED_MAP", + "-DOFX_EXTENSIONS_NUKE", + "-DOFX_EXTENSIONS_TUTTLE", + "-DOFX_EXTENSIONS_VEGAS", + "-DOFX_SUPPORTS_PARAMETRIC", + "-DOFX_EXTENSIONS_TUTTLE", + "-DOFX_EXTENSIONS_NATRON", + "-DOFX_SUPPORTS_OPENGLRENDER", + "-DOFX_SUPPORTS_MULTITHREAD", + "-DOFX_SUPPORTS_DIALOG", + "-DQT_NO_CAST_FROM_ASCII", + "-DDEBUG", + "-DNATRON_USE_BREAKPAD", + "-DNATRON_BUILD_NUMBER=0"); + OTHER_CPLUSPLUSFLAGS = ( + "-pipe", + "-ftemplate-depth-1024", + "-g", + "-Wall", + "-W", + "-fPIC", + "-DCERES_HAVE_PTHREAD", + "-DCERES_NO_SUITESPARSE", + "-DCERES_NO_CXSPARSE", + "-DCERES_HAVE_RWLOCK", + "-DCERES_NO_LAPACK", + "-DCERES_RESTRICT_SCHUR_SPECIALIZATION", + "-DWITH_LIBMV_GUARDED_ALLOC", + "-DGOOGLE_GLOG_DLL_DECL=", + "-DLIBMV_NO_FAST_DETECTOR=", + "-DCERES_BOOST_SHARED_PTR", + "-DCERES_BOOST_UNORDERED_MAP", + "-DOFX_EXTENSIONS_NUKE", + "-DOFX_EXTENSIONS_TUTTLE", + "-DOFX_EXTENSIONS_VEGAS", + "-DOFX_SUPPORTS_PARAMETRIC", + "-DOFX_EXTENSIONS_TUTTLE", + "-DOFX_EXTENSIONS_NATRON", + "-DOFX_SUPPORTS_OPENGLRENDER", + "-DOFX_SUPPORTS_MULTITHREAD", + "-DOFX_SUPPORTS_DIALOG", + "-DQT_NO_CAST_FROM_ASCII", + "-DDEBUG", + "-DNATRON_USE_BREAKPAD", + "-DNATRON_BUILD_NUMBER=0"); + ARCHS = "x86_64"; + }; + name = "Debug"; + }; + BEC09A62E69C3553534FF35E = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = "NO"; + GCC_GENERATE_DEBUGGING_SYMBOLS = "YES"; + GCC_OPTIMIZATION_LEVEL = "0"; + PRODUCT_NAME = "ceres"; + LIBRARY_STYLE = "STATIC"; + PRODUCT_NAME = "ceres"; + }; + name = "Debug"; + }; + 2C641C3335766025DD51B7BD = { + buildRules = ( + ); + buildSettings = { + COPY_PHASE_STRIP = "NO"; + GCC_GENERATE_DEBUGGING_SYMBOLS = "YES"; + GCC_OPTIMIZATION_LEVEL = "0"; + PRODUCT_NAME = "ceres"; + }; + isa = "PBXBuildStyle"; + name = "Debug"; + }; + D70590BEB531B51029F711BB = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = "YES"; + GCC_GENERATE_DEBUGGING_SYMBOLS = "NO"; + PRODUCT_NAME = "ceres"; + HEADER_SEARCH_PATHS = ( + "/opt/local/include", + "../libs/ceres/config", + "../libs/ceres/include", + "../libs/ceres/internal", + "../libs/gflags", + "../libs/gflags/src", + "../libs/gflags/src/gflags", + "../libs/glog/src", + "../libs/libmv/third_party", + "../libs/Eigen3", + "../libs/glog/src", + "/usr/local/include", + "/System/Library/Frameworks/CarbonCore.framework/Headers", + "/opt/local/libexec/qt4/share/mkspecs/macx-xcode"); + LIBRARY_SEARCH_PATHS = ( + ); + FRAMEWORK_SEARCH_PATHS = ( + ); + INFOPLIST_FILE = "Info.plist"; + OTHER_CFLAGS = ( + "-pipe", + "-g", + "-Wall", + "-W", + "-fPIC", + "-DCERES_HAVE_PTHREAD", + "-DCERES_NO_SUITESPARSE", + "-DCERES_NO_CXSPARSE", + "-DCERES_HAVE_RWLOCK", + "-DCERES_NO_LAPACK", + "-DCERES_RESTRICT_SCHUR_SPECIALIZATION", + "-DWITH_LIBMV_GUARDED_ALLOC", + "-DGOOGLE_GLOG_DLL_DECL=", + "-DLIBMV_NO_FAST_DETECTOR=", + "-DCERES_BOOST_SHARED_PTR", + "-DCERES_BOOST_UNORDERED_MAP", + "-DOFX_EXTENSIONS_NUKE", + "-DOFX_EXTENSIONS_TUTTLE", + "-DOFX_EXTENSIONS_VEGAS", + "-DOFX_SUPPORTS_PARAMETRIC", + "-DOFX_EXTENSIONS_TUTTLE", + "-DOFX_EXTENSIONS_NATRON", + "-DOFX_SUPPORTS_OPENGLRENDER", + "-DOFX_SUPPORTS_MULTITHREAD", + "-DOFX_SUPPORTS_DIALOG", + "-DQT_NO_CAST_FROM_ASCII", + "-DDEBUG", + "-DNATRON_USE_BREAKPAD", + "-DNATRON_BUILD_NUMBER=0"); + OTHER_CPLUSPLUSFLAGS = ( + "-pipe", + "-ftemplate-depth-1024", + "-g", + "-Wall", + "-W", + "-fPIC", + "-DCERES_HAVE_PTHREAD", + "-DCERES_NO_SUITESPARSE", + "-DCERES_NO_CXSPARSE", + "-DCERES_HAVE_RWLOCK", + "-DCERES_NO_LAPACK", + "-DCERES_RESTRICT_SCHUR_SPECIALIZATION", + "-DWITH_LIBMV_GUARDED_ALLOC", + "-DGOOGLE_GLOG_DLL_DECL=", + "-DLIBMV_NO_FAST_DETECTOR=", + "-DCERES_BOOST_SHARED_PTR", + "-DCERES_BOOST_UNORDERED_MAP", + "-DOFX_EXTENSIONS_NUKE", + "-DOFX_EXTENSIONS_TUTTLE", + "-DOFX_EXTENSIONS_VEGAS", + "-DOFX_SUPPORTS_PARAMETRIC", + "-DOFX_EXTENSIONS_TUTTLE", + "-DOFX_EXTENSIONS_NATRON", + "-DOFX_SUPPORTS_OPENGLRENDER", + "-DOFX_SUPPORTS_MULTITHREAD", + "-DOFX_SUPPORTS_DIALOG", + "-DQT_NO_CAST_FROM_ASCII", + "-DDEBUG", + "-DNATRON_USE_BREAKPAD", + "-DNATRON_BUILD_NUMBER=0"); + ARCHS = "x86_64"; + }; + name = "Release"; + }; + 8C7174830A1E4DCBA0332EC1 = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = "YES"; + GCC_GENERATE_DEBUGGING_SYMBOLS = "NO"; + PRODUCT_NAME = "ceres"; + LIBRARY_STYLE = "STATIC"; + PRODUCT_NAME = "ceres"; + }; + name = "Release"; + }; + 26DE8D2AEA4B3714B41E931F = { + buildRules = ( + ); + buildSettings = { + COPY_PHASE_STRIP = "YES"; + GCC_GENERATE_DEBUGGING_SYMBOLS = "NO"; + PRODUCT_NAME = "ceres"; + }; + isa = "PBXBuildStyle"; + name = "Release"; + }; + CC82A9286117DFED018F418F = { + isa = XCConfigurationList; + buildConfigurations = ( + "4B72B24813252891014BCF61", + "D70590BEB531B51029F711BB"); + defaultConfigurationIsVisible = 0; + defaultConfigurationIsName = "Debug"; + }; + 17B3380A4D6A7D415E7F2E1E = { + isa = XCConfigurationList; + buildConfigurations = ( + "BEC09A62E69C3553534FF35E", + "8C7174830A1E4DCBA0332EC1"); + defaultConfigurationIsVisible = 0; + defaultConfigurationIsName = "Debug"; + }; + 91B15E841AA80083484172DE = { + buildStyles = ( + "2C641C3335766025DD51B7BD", + "26DE8D2AEA4B3714B41E931F"); + hasScannedForEncodings = 1; + isa = PBXProject; + mainGroup = "05596AB53D8D521C69802C27"; + buildConfigurationList = "CC82A9286117DFED018F418F"; + projectDirPath = ""; + targets = ( + "B72CC4B33C9020E72F8C7D40"); + }; + }; + rootObject = "91B15E841AA80083484172DE"; +} diff --git a/ceres/ceres.xcodeproj/qt_makeqmake.mak b/ceres/ceres.xcodeproj/qt_makeqmake.mak new file mode 100644 index 0000000000..b8d92d3d02 --- /dev/null +++ b/ceres/ceres.xcodeproj/qt_makeqmake.mak @@ -0,0 +1,79 @@ +############################################################################# +# Makefile for building: libceres.a +# Generated by qmake (2.01a) (Qt 4.8.7) on: Thu Mar 24 15:45:23 2016 +# Project: ceres.pro +# Template: lib +# Command: /opt/local/libexec/qt4/bin/qmake -spec /opt/local/libexec/qt4/share/mkspecs/macx-xcode CONFIG+=debug -o ceres.xcodeproj/project.pbxproj ceres.pro +############################################################################# + +QMAKE = /opt/local/libexec/qt4/bin/qmake +ceres.xcodeproj/project.pbxproj: ceres.pro /opt/local/libexec/qt4/share/mkspecs/macx-xcode/qmake.conf /opt/local/libexec/qt4/share/mkspecs/common/unix.conf \ + /opt/local/libexec/qt4/share/mkspecs/common/mac.conf \ + /opt/local/libexec/qt4/share/mkspecs/common/gcc-base.conf \ + /opt/local/libexec/qt4/share/mkspecs/common/gcc-base-macx.conf \ + /opt/local/libexec/qt4/share/mkspecs/common/g++-base.conf \ + /opt/local/libexec/qt4/share/mkspecs/common/g++-macx.conf \ + /opt/local/libexec/qt4/share/mkspecs/qconfig.pri \ + /opt/local/libexec/qt4/share/mkspecs/modules/qt_webkit_version.pri \ + /opt/local/libexec/qt4/share/mkspecs/features/qt_functions.prf \ + /opt/local/libexec/qt4/share/mkspecs/features/qt_config.prf \ + /opt/local/libexec/qt4/share/mkspecs/features/exclusive_builds.prf \ + /opt/local/libexec/qt4/share/mkspecs/features/default_pre.prf \ + /opt/local/libexec/qt4/share/mkspecs/features/mac/default_pre.prf \ + ../global.pri \ + ../config.pri \ + /opt/local/libexec/qt4/share/mkspecs/features/debug.prf \ + /opt/local/libexec/qt4/share/mkspecs/features/default_post.prf \ + /opt/local/libexec/qt4/share/mkspecs/features/mac/default_post.prf \ + /opt/local/libexec/qt4/share/mkspecs/features/mac/objective_cxx.prf \ + /opt/local/libexec/qt4/share/mkspecs/features/mac/objective_c.prf \ + /opt/local/libexec/qt4/share/mkspecs/features/mac/split_sources.prf \ + /opt/local/libexec/qt4/share/mkspecs/features/link_pkgconfig.prf \ + /opt/local/libexec/qt4/share/mkspecs/features/warn_on.prf \ + /opt/local/libexec/qt4/share/mkspecs/features/staticlib.prf \ + /opt/local/libexec/qt4/share/mkspecs/features/static.prf \ + /opt/local/libexec/qt4/share/mkspecs/features/mac/x86_64.prf \ + /opt/local/libexec/qt4/share/mkspecs/features/mac/rez.prf \ + /opt/local/libexec/qt4/share/mkspecs/features/mac/sdk.prf \ + /opt/local/libexec/qt4/share/mkspecs/features/resources.prf \ + /opt/local/libexec/qt4/share/mkspecs/features/uic.prf \ + /opt/local/libexec/qt4/share/mkspecs/features/yacc.prf \ + /opt/local/libexec/qt4/share/mkspecs/features/lex.prf \ + /opt/local/libexec/qt4/share/mkspecs/features/include_source_dir.prf + $(QMAKE) -spec /opt/local/libexec/qt4/share/mkspecs/macx-xcode CONFIG+=debug -o ceres.xcodeproj/project.pbxproj ceres.pro +/opt/local/libexec/qt4/share/mkspecs/common/unix.conf: +/opt/local/libexec/qt4/share/mkspecs/common/mac.conf: +/opt/local/libexec/qt4/share/mkspecs/common/gcc-base.conf: +/opt/local/libexec/qt4/share/mkspecs/common/gcc-base-macx.conf: +/opt/local/libexec/qt4/share/mkspecs/common/g++-base.conf: +/opt/local/libexec/qt4/share/mkspecs/common/g++-macx.conf: +/opt/local/libexec/qt4/share/mkspecs/qconfig.pri: +/opt/local/libexec/qt4/share/mkspecs/modules/qt_webkit_version.pri: +/opt/local/libexec/qt4/share/mkspecs/features/qt_functions.prf: +/opt/local/libexec/qt4/share/mkspecs/features/qt_config.prf: +/opt/local/libexec/qt4/share/mkspecs/features/exclusive_builds.prf: +/opt/local/libexec/qt4/share/mkspecs/features/default_pre.prf: +/opt/local/libexec/qt4/share/mkspecs/features/mac/default_pre.prf: +../global.pri: +../config.pri: +/opt/local/libexec/qt4/share/mkspecs/features/debug.prf: +/opt/local/libexec/qt4/share/mkspecs/features/default_post.prf: +/opt/local/libexec/qt4/share/mkspecs/features/mac/default_post.prf: +/opt/local/libexec/qt4/share/mkspecs/features/mac/objective_cxx.prf: +/opt/local/libexec/qt4/share/mkspecs/features/mac/objective_c.prf: +/opt/local/libexec/qt4/share/mkspecs/features/mac/split_sources.prf: +/opt/local/libexec/qt4/share/mkspecs/features/link_pkgconfig.prf: +/opt/local/libexec/qt4/share/mkspecs/features/warn_on.prf: +/opt/local/libexec/qt4/share/mkspecs/features/staticlib.prf: +/opt/local/libexec/qt4/share/mkspecs/features/static.prf: +/opt/local/libexec/qt4/share/mkspecs/features/mac/x86_64.prf: +/opt/local/libexec/qt4/share/mkspecs/features/mac/rez.prf: +/opt/local/libexec/qt4/share/mkspecs/features/mac/sdk.prf: +/opt/local/libexec/qt4/share/mkspecs/features/resources.prf: +/opt/local/libexec/qt4/share/mkspecs/features/uic.prf: +/opt/local/libexec/qt4/share/mkspecs/features/yacc.prf: +/opt/local/libexec/qt4/share/mkspecs/features/lex.prf: +/opt/local/libexec/qt4/share/mkspecs/features/include_source_dir.prf: +qmake: FORCE + @$(QMAKE) -spec /opt/local/libexec/qt4/share/mkspecs/macx-xcode CONFIG+=debug -o ceres.xcodeproj/project.pbxproj ceres.pro + diff --git a/ceres/ceres.xcodeproj/qt_preprocess.mak b/ceres/ceres.xcodeproj/qt_preprocess.mak new file mode 100644 index 0000000000..8d447131c0 --- /dev/null +++ b/ceres/ceres.xcodeproj/qt_preprocess.mak @@ -0,0 +1,49 @@ +############################################################################# +# Makefile for building: libceres.a +# Generated by qmake (2.01a) (Qt 4.8.7) on: Thu Mar 24 15:45:23 2016 +# Project: ceres.pro +# Template: lib +# Command: /opt/local/libexec/qt4/bin/qmake -spec /opt/local/libexec/qt4/share/mkspecs/macx-xcode CONFIG+=debug -o ceres.xcodeproj/project.pbxproj ceres.pro +############################################################################# + +MOC = /opt/local/libexec/qt4/bin/moc +UIC = /opt/local/libexec/qt4/bin/uic +LEX = flex +LEXFLAGS = +YACC = yacc +YACCFLAGS = -d +DEFINES = -DCERES_HAVE_PTHREAD -DCERES_NO_SUITESPARSE -DCERES_NO_CXSPARSE -DCERES_HAVE_RWLOCK -DCERES_NO_LAPACK -DCERES_RESTRICT_SCHUR_SPECIALIZATION -DWITH_LIBMV_GUARDED_ALLOC -DGOOGLE_GLOG_DLL_DECL= -DLIBMV_NO_FAST_DETECTOR= -DCERES_BOOST_SHARED_PTR -DCERES_BOOST_UNORDERED_MAP -DOFX_EXTENSIONS_NUKE -DOFX_EXTENSIONS_TUTTLE -DOFX_EXTENSIONS_VEGAS -DOFX_SUPPORTS_PARAMETRIC -DOFX_EXTENSIONS_TUTTLE -DOFX_EXTENSIONS_NATRON -DOFX_SUPPORTS_OPENGLRENDER -DOFX_SUPPORTS_MULTITHREAD -DOFX_SUPPORTS_DIALOG -DQT_NO_CAST_FROM_ASCII -DDEBUG -DNATRON_USE_BREAKPAD -DNATRON_BUILD_NUMBER=0 +INCPATH = -I/opt/local/libexec/qt4/share/mkspecs/macx-xcode -I. -I/opt/local/include -I../libs/ceres/config -I../libs/ceres/include -I../libs/ceres/internal -I../libs/gflags -I../libs/gflags/src -I../libs/gflags/src/gflags -I../libs/glog/src -I../libs/libmv/third_party -I../libs/Eigen3 -I../libs/glog/src -I/usr/local/include -I/System/Library/Frameworks/CarbonCore.framework/Headers +DEL_FILE = rm -f +MOVE = mv -f + +IMAGES = +PARSERS = +preprocess: $(PARSERS) compilers +clean preprocess_clean: parser_clean compiler_clean + +parser_clean: +check: first + +compilers: +compiler_objective_cxx_make_all: +compiler_objective_cxx_clean: +compiler_objective_c_make_all: +compiler_objective_c_clean: +compiler_rez_source_make_all: +compiler_rez_source_clean: +compiler_rcc_make_all: +compiler_rcc_clean: +compiler_uic_make_all: +compiler_uic_clean: +compiler_image_collection_make_all: qmake_image_collection.cpp +compiler_image_collection_clean: + -$(DEL_FILE) qmake_image_collection.cpp +compiler_yacc_decl_make_all: +compiler_yacc_decl_clean: +compiler_yacc_impl_make_all: +compiler_yacc_impl_clean: +compiler_lex_make_all: +compiler_lex_clean: +compiler_clean: + diff --git a/global.pri b/global.pri index 70f77b0476..f6200042fb 100644 --- a/global.pri +++ b/global.pri @@ -27,7 +27,6 @@ DEFINES += OFX_SUPPORTS_DIALOG #for QString(const char*) assumes ASCII strings, we may run into troubles DEFINES += QT_NO_CAST_FROM_ASCII - # Uncomment to run Natron without Python functionnalities (for debug purposes) #DEFINES += NATRON_RUN_WITHOUT_PYTHON