View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001580 | FreeCAD | Feature | public | 2014-06-12 08:47 | 2014-06-14 12:48 |
Reporter | user123 | Assigned To | wmayer | ||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Summary | 0001580: Adding transparency to povray output | ||||
Description | Adding transparency to povray's output probably just needs a patch for: src/Mod/Raytracing/App/RayFeature.cpp I'm not familiar with the source code, so I just wrote down basic concept of what it should do. It needs to be adapted at the TODO marks, but I think it should be fairly quick, at least I hope :) --- RayFeature.cpp 2014-06-12 02:46:21.406185671 +0100 +++ RayFeature_new.cpp 2014-06-12 02:49:12.419194188 +0100 @@ -67,14 +67,21 @@ PovTools::writeShape(result,Name.c_str(),shape); // This must not be done in PovTools::writeShape! + const App::PropertyPercent& t = Transparency.getValue(); // TODO: please replace with correct type. const App::Color& c = Color.getValue(); result << "// instance to render" << endl - << "object {" << Name << endl - << " texture {" << endl - << " pigment {color rgb <"<<c.r<<","<<c.g<<","<<c.b<<">}" << endl - << " finish {StdFinish } //definition on top of the project" << endl - << " }" << endl - << "}" << endl ; + << "object {" << Name << endl + << " texture {" << endl; + if (*t == 0) { + result << " pigment {color rgb <"<<c.r<<","<<c.g<<","<<c.b<<">}" << endl; + } else { + float trans = *t/100.0f; // TODO: this needs fixing, probably to format 0.xx or so; + result << " pigment {color rgb <"<<c.r<<","<<c.g<<","<<c.b<<"> transmit "<<t<<"<<}" << endl; + }: + result << " finish {StdFinish } //definition on top of the project" << endl + << " }" << endl + << "}" << endl ; + // Apply the resulting fragment Result.setValue(result.str().c_str()); | ||||
Tags | No tags attached. | ||||
FreeCAD Information | |||||