Avoid sceneViewer.selectGeometry() break running ?
1515
2
0
jerry7
Member
631 posts
Joined: Nov. 2013
Offline
Feb. 12, 2020 10:06 a.m.
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
Ondrej
Staff
1072 posts
Joined: July 2005
Offline
Feb. 13, 2020 10:42 a.m.
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"
jerry7
Member
631 posts
Joined: Nov. 2013
Offline
Feb. 13, 2020 6:20 p.m.
Hi Ondrej, It is just my need. Thank you very much!