diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index 504532ab0e..eb71a731c7 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -1235,6 +1235,7 @@ void View3DInventorViewer::renderToFramebuffer(QGLFramebufferObject* fbo) glDepthRange(0.1,1.0); SoGLRenderAction gl(SbViewportRegion(width, height)); + gl.setTransparencyType(SoGLRenderAction::SORTED_OBJECT_SORTED_TRIANGLE_BLEND); gl.apply(this->backgroundroot); gl.apply(this->getSoRenderManager()->getSceneGraph()); gl.apply(this->foregroundroot); diff --git a/src/Gui/View3DPy.cpp b/src/Gui/View3DPy.cpp index c9a61a3204..63d7143854 100644 --- a/src/Gui/View3DPy.cpp +++ b/src/Gui/View3DPy.cpp @@ -658,7 +658,10 @@ Py::Object View3DInventorPy::isAnimationEnabled(const Py::Tuple& args) void View3DInventorPy::createImageFromFramebuffer(int width, int height, const QColor& bgcolor, QImage& img) { - QGLFramebufferObject fbo(width, height, QGLFramebufferObject::Depth); + QGLFramebufferObjectFormat format; + format.setSamples(8); + format.setAttachment(QGLFramebufferObject::Depth); + QGLFramebufferObject fbo(width, height, format); const QColor col = _view->getViewer()->backgroundColor(); bool on = _view->getViewer()->hasGradientBackground(); @@ -683,7 +686,7 @@ Py::Object View3DInventorPy::saveImage(const Py::Tuple& args) QColor bg; QString colname = QString::fromLatin1(cColor); - if (colname.compare(QLatin1String("Current"), Qt::CaseInsensitive)) + if (colname.compare(QLatin1String("Current"), Qt::CaseInsensitive) == 0) bg = QColor(); // assign an invalid color here else bg.setNamedColor(colname); @@ -743,7 +746,7 @@ Py::Object View3DInventorPy::saveVectorGraphic(const Py::Tuple& args) QColor bg; QString colname = QString::fromLatin1(name); - if (colname.compare(QLatin1String("Current"), Qt::CaseInsensitive)) + if (colname.compare(QLatin1String("Current"), Qt::CaseInsensitive) == 0) bg = _view->getViewer()->backgroundColor(); else bg.setNamedColor(colname);