diff --git a/src/Mod/Raytracing/App/PovTools.cpp b/src/Mod/Raytracing/App/PovTools.cpp index dee18dd27..0c2c84ab7 100644 --- a/src/Mod/Raytracing/App/PovTools.cpp +++ b/src/Mod/Raytracing/App/PovTools.cpp @@ -80,13 +80,7 @@ std::string PovTools::getCamera(const CamDef& Cam) << " look_at cam_look_at" << endl << " sky cam_sky" << endl << " angle cam_angle " << endl - << "}"<< endl - // default light - << "//default light" << endl - << "light_source {" << endl - << " cam_location + cam_angle * 100 // light's position" << endl - << " color rgb <10, 10, 10> // light's color" << endl - << "}" << endl ; + << "}"<< endl; return out.str(); } diff --git a/src/Mod/Raytracing/App/RayProject.cpp b/src/Mod/Raytracing/App/RayProject.cpp index 66aa3229f..d806160d2 100644 --- a/src/Mod/Raytracing/App/RayProject.cpp +++ b/src/Mod/Raytracing/App/RayProject.cpp @@ -71,18 +71,22 @@ App::DocumentObjectExecReturn *RayProject::execute(void) // copy the input of the resource file while (!file.eof()) { getline (file,line); - ofile << line << endl; - } - - ofile << Camera.getValue(); - - // get through the children and collect all the views - const std::vector &Grp = Group.getValues(); - for (std::vector::const_iterator It= Grp.begin();It!=Grp.end();++It) { - if ((*It)->getTypeId().isDerivedFrom(Raytracing::RayFeature::getClassTypeId())) { - Raytracing::RayFeature *View = dynamic_cast(*It); - ofile << View->Result.getValue(); - ofile << endl << endl << endl; + // check if the marker in the template is found + if(line.find("//RaytracingContent") == string::npos) + // if not - write through + ofile << line << endl; + else { + ofile << Camera.getValue(); + + // get through the children and collect all the views + const std::vector &Grp = Group.getValues(); + for (std::vector::const_iterator It= Grp.begin();It!=Grp.end();++It) { + if ((*It)->getTypeId().isDerivedFrom(Raytracing::RayFeature::getClassTypeId())) { + Raytracing::RayFeature *View = dynamic_cast(*It); + ofile << View->Result.getValue(); + ofile << endl << endl << endl; + } + } } } diff --git a/src/Mod/Raytracing/Templates/ProjectStd.pov b/src/Mod/Raytracing/Templates/ProjectStd.pov index 631d81135..d952a9614 100644 --- a/src/Mod/Raytracing/Templates/ProjectStd.pov +++ b/src/Mod/Raytracing/Templates/ProjectStd.pov @@ -43,3 +43,11 @@ plane { //#declare StdFinish = finish { crand 0.5 phong 0.9}; #declare StdFinish = finish { ambient 0.01 diffuse 0.9 phong 1.0 phong_size 70 metallic brilliance 1.5} ; +//RaytracingContent + +//default light +light_source { + cam_location + cam_angle * 100 + color rgb <10, 10, 10> +} +