Jump to content

Message And Timer For A Long Cook


Recommended Posts

My SOP node is cooking long time.

I think it'd be great to add a dialog about what is happening and ability to interrupt it, but I can't get how to do that.

I've tried to redefine OP_Node::getCookTimerLabel() and use start/stopCookTimer() inside my cook method, but dialog still doesn't appear...

And, as an ability to interrupt cooking process, I should periodically check wasInterrupted() function, right?

Link to comment
Share on other sites

take a look at this sop

uv uniform

It uses the cooking dialog and interrupts from UT_Interrupt.h

UT_Interrupt		  *boss;

//check for user interrupts
  boss = UTgetInterrupt();

  boss->setEnabled(1, 0);
  boss->setAppTitle("UVuniform");
  boss->setLongOpText("Fetching uvs");
  boss->setLongPercent(0);
  boss->setInterruptable(1);

  boss->setLongOpText("smoothing grid");
  boss->setLongPercent(0.1);
  test = boss->opInterrupt(5);

Edited by sibarrick
Link to comment
Share on other sites

Thanks, that helped a lot!

take a look at this sop

uv uniform

It uses the cooking dialog and interrupts from UT_Interrupt.h

UT_Interrupt		  *boss;

//check for user interrupts
  boss = UTgetInterrupt();

  boss->setEnabled(1, 0);
  boss->setAppTitle("UVuniform");
  boss->setLongOpText("Fetching uvs");
  boss->setLongPercent(0);
  boss->setInterruptable(1);

  boss->setLongOpText("smoothing grid");
  boss->setLongPercent(0.1);
  test = boss->opInterrupt(5);

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...