From 1a0efaa491038a53faa7d7237d3dbe668ff930df Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Sun, 4 Sep 2016 23:12:53 -0300 Subject: [PATCH] Raytracing: Yield error when creating a Luxrender view of a shape with no faces - fixes #2685 --- src/Mod/Raytracing/App/LuxFeature.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Mod/Raytracing/App/LuxFeature.cpp b/src/Mod/Raytracing/App/LuxFeature.cpp index 094b443012f0..9a963768d419 100644 --- a/src/Mod/Raytracing/App/LuxFeature.cpp +++ b/src/Mod/Raytracing/App/LuxFeature.cpp @@ -34,6 +34,8 @@ #include "LuxFeature.h" #include "LuxTools.h" +#include + using namespace Raytracing; @@ -64,7 +66,12 @@ App::DocumentObjectExecReturn *LuxFeature::execute(void) std::string Name(std::string("Lux_")+static_cast(link)->getNameInDocument()); if (shape.IsNull()) return new App::DocumentObjectExecReturn("Linked shape object is empty"); - + ShapeAnalysis_ShapeContents test; + test.Clear(); + test.Perform(shape); + if (test.NbFaces() < 1) + return new App::DocumentObjectExecReturn("Shape contains no face to render"); + // write a material entry // This must not be done in LuxTools::writeShape! const App::Color& c = Color.getValue();