Raytracing: Yield error when creating a Luxrender view of a shape with no faces - fixes #2685
This commit is contained in:
parent
11952d2062
commit
1a0efaa491
|
@ -34,6 +34,8 @@
|
||||||
#include "LuxFeature.h"
|
#include "LuxFeature.h"
|
||||||
#include "LuxTools.h"
|
#include "LuxTools.h"
|
||||||
|
|
||||||
|
#include <ShapeAnalysis_ShapeContents.hxx>
|
||||||
|
|
||||||
|
|
||||||
using namespace Raytracing;
|
using namespace Raytracing;
|
||||||
|
|
||||||
|
@ -64,6 +66,11 @@ App::DocumentObjectExecReturn *LuxFeature::execute(void)
|
||||||
std::string Name(std::string("Lux_")+static_cast<Part::Feature*>(link)->getNameInDocument());
|
std::string Name(std::string("Lux_")+static_cast<Part::Feature*>(link)->getNameInDocument());
|
||||||
if (shape.IsNull())
|
if (shape.IsNull())
|
||||||
return new App::DocumentObjectExecReturn("Linked shape object is empty");
|
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
|
// write a material entry
|
||||||
// This must not be done in LuxTools::writeShape!
|
// This must not be done in LuxTools::writeShape!
|
||||||
|
|
Loading…
Reference in New Issue
Block a user