diff --git a/src/Mod/Raytracing/App/RayFeature.cpp b/src/Mod/Raytracing/App/RayFeature.cpp index b66eeb97b..4f249772a 100644 --- a/src/Mod/Raytracing/App/RayFeature.cpp +++ b/src/Mod/Raytracing/App/RayFeature.cpp @@ -47,6 +47,7 @@ RayFeature::RayFeature(void) { ADD_PROPERTY(Source,(0)); ADD_PROPERTY(Color,(App::Color(0.5f,0.5f,0.5f))); + ADD_PROPERTY(Transparency,(0)); } App::DocumentObjectExecReturn *RayFeature::execute(void) @@ -67,12 +68,19 @@ App::DocumentObjectExecReturn *RayFeature::execute(void) PovTools::writeShape(result,Name.c_str(),shape); // This must not be done in PovTools::writeShape! + long t = Transparency.getValue(); const App::Color& c = Color.getValue(); result << "// instance to render" << endl << "object {" << Name << endl - << " texture {" << endl - << " pigment {color rgb <"<}" << endl - << " finish {StdFinish } //definition on top of the project" << endl + << " texture {" << endl; + if (t == 0) { + result << " pigment {color rgb <"<}" << endl; + } + else { + float trans = t/100.0f; + result << " pigment {color rgb <"< transmit "<getNameInDocument()); doCommand(Doc,"App.activeDocument().%s.Color = Gui.activeDocument().%s.ShapeColor",FeatName.c_str(),(*it)->getNameInDocument()); + doCommand(Doc,"App.activeDocument().%s.Transparency = Gui.activeDocument().%s.Transparency",FeatName.c_str(),(*it)->getNameInDocument()); doCommand(Doc,"App.activeDocument().%s.addObject(App.activeDocument().%s)",ProjName.c_str(), FeatName.c_str()); } updateActive();