diff --git a/instancer_hda/ROP_VPT_Instance.cpp b/instancer_hda/ROP_VPT_Instance.cpp index 5eab595..4c8e072 100644 --- a/instancer_hda/ROP_VPT_Instance.cpp +++ b/instancer_hda/ROP_VPT_Instance.cpp @@ -52,7 +52,7 @@ static PRM_Default theFileDefault(0, "$HIP/Outputs/VPT/defgeo.ins"); PRM_Template VPT_INS_ROP::myTemplateList[] = { PRM_Template(PRM_FILE_E, 1, &names[0], &theFileDefault , 0, 0 , 0 , &PRM_SpareData::fileChooserModeWrite), // file Output PRM_Template(PRM_STRING, PRM_TYPE_DYNAMIC_PATH, 1, &names[1], 0, 0, 0, 0, &PRM_SpareData::sopPath), // sop path - PRM_Template(PRM_TOGGLE, 0, &names[2], PRMzeroDefaults), // render Light instance + PRM_Template(PRM_TOGGLE, 1, &names[2], PRMzeroDefaults), // render Light instance PRM_Template() // placeholder }; @@ -162,9 +162,9 @@ ROP_RENDER_CODE VPT_INS_ROP::renderFrame(fpreal time, UT_Interrupt *) SOP_Node *sop; UT_String soppath, savepath, name; - bool render_light; OUTPUT(savepath, time); + bool render_light = LIGHT(); if (!executePreFrameScript(time)) return ROP_ABORT_RENDER; @@ -215,9 +215,7 @@ ROP_RENDER_CODE VPT_INS_ROP::renderFrame(fpreal time, UT_Interrupt *) if (evalInt("mkpath", 0, 0)) { ROP_Node::makeFilePathDirs(savepath); } - - render_light = LIGHT(); - + if (render_light) light_save(gdp, (const char*)savepath); else file_save(gdp, (const char *)savepath); diff --git a/instancer_hda/ROP_VPT_Instance.h b/instancer_hda/ROP_VPT_Instance.h index 9855551..480e418 100644 --- a/instancer_hda/ROP_VPT_Instance.h +++ b/instancer_hda/ROP_VPT_Instance.h @@ -131,7 +131,7 @@ namespace vpt_instance { virtual ROP_RENDER_CODE endRender(); private: - int LIGHT() { return evalInt("render_light", 0 , 0 ); } + bool LIGHT() { return evalInt("render_light", 0 , 0 ); } void OUTPUT(UT_String &str, fpreal t) { return evalString(str, "outputFile", 0, t); } void SOPPATH(UT_String &str, fpreal t) { return evalString(str, "soppath", 0, t); } int INITSIM() { return evalInt("initsim", 0, 0); } diff --git a/instancer_hda/file_IO.cpp b/instancer_hda/file_IO.cpp index e0d402c..b2c7240 100644 --- a/instancer_hda/file_IO.cpp +++ b/instancer_hda/file_IO.cpp @@ -195,10 +195,9 @@ namespace vpt_instance { GA_ROHandleV3 Cd_h(gdp, GA_ATTRIB_POINT, "Cd"); GA_ROHandleF power_h(gdp, GA_ATTRIB_POINT, "power"); - file << "light" << std::endl; file << gdp->getNumPoints() << std::endl; - + GA_Offset lcl_start, lcl_end, ptoff; for (GA_Iterator lcl_it(gdp->getPointRange()); lcl_it.blockAdvance(lcl_start, lcl_end); ) { for (ptoff = lcl_start; ptoff < lcl_end; ++ptoff) {