Skip to content

Commit

Permalink
make toggle active
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeneren committed Jan 5, 2020
1 parent 6df9b6f commit 8b8ef1c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
8 changes: 3 additions & 5 deletions instancer_hda/ROP_VPT_Instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion instancer_hda/ROP_VPT_Instance.h
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
Expand Down
3 changes: 1 addition & 2 deletions instancer_hda/file_IO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8b8ef1c

Please sign in to comment.