Avoid sceneViewer.selectGeometry() break running ?

   1492   2   0
User Avatar
Member
620 posts
Joined: Nov. 2013
Offline
Hi,

In the following code. We can't get “finish” output if the current selection is break ( Change to other tool ).

import toolutils
view = toolutils.sceneViewer()
view.selectGeometry() # if the selectint are break, we can't get "finish" result.
print "finish"

I need do some clear work for user break the selection. How to catch this?

Thanks!
Edited by jerry7 - Feb. 12, 2020 10:06:57
User Avatar
Staff
1072 posts
Joined: July 2005
Offline
The hou.SceneViewer.selectGeometry() call should be raising an hou.OperationInterrupted exception when it is interrupted, so you can do something like the following.

try:
    view.selectGeometry()
    print "finish"
except hou.OperationInterrupted:
    print "interrupted"
User Avatar
Member
620 posts
Joined: Nov. 2013
Offline
Hi Ondrej, It is just my need. Thank you very much!
  • Quick Links