Interupting a Python SOP?

   5388   8   1
User Avatar
Member
7025 posts
Joined: July 2005
Offline
Hi,

Is there any way to add interrupt code to a Python SOP? I'm writing this email waiting for a loooong cook on a Python SOP with no (apparent) way to interrupt it.

In the HDK I'd add the interrupt detection code and Esc would work!

Cheers,

Peter B
User Avatar
Member
1908 posts
Joined: Nov. 2006
Online
What you want is hou.updateProgressAndCheckForInterrupt(). It returns True when an interrupt is detected and takes an optional percentage value.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
7025 posts
Joined: July 2005
Offline
Sweet thanks!
User Avatar
Member
7025 posts
Joined: July 2005
Offline
Hmm, I do not find it in the docs anywhere…
User Avatar
Member
1908 posts
Joined: Nov. 2006
Online
It's not documented in 10.0…
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
401 posts
Joined:
Offline
hou.updateProgressAndCheckForInterrupt()

sounds like a made up function name …
this is not a science fair.
User Avatar
Member
4140 posts
Joined: July 2005
Offline
It's a trap!

J.C.
John Coldrick
User Avatar
Member
7025 posts
Joined: July 2005
Offline
Yeah, I tried using it in my code… and it erased my hard drive

Then spammed my whole email list. Sorry guys…

Cheers,

Peter B

p.s. just kidding
User Avatar
Staff
4168 posts
Joined: Sept. 2007
Offline
I know this thread is an older one, but I found it while looking to interrupt Python SOPs. The above method has been deprecated, and replace with hou.InterruptableOperation()

http://www.sidefx.com/docs/houdini12.0/hom/hou/InterruptableOperation [sidefx.com]

The docs have some usage.

Cheers!
I'm o.d.d.
  • Quick Links