Avoid sceneViewer.selectGeometry() break running ?
1505
2
0
jerry7
Member
629 posts
Joined: 11月 2013
Offline
2020年2月12日 10:06
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 - 2020年2月12日 10:06:57
Ondrej
スタッフ
1072 posts
Joined: 7月 2005
Offline
2020年2月13日 10:42
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
629 posts
Joined: 11月 2013
Offline
2020年2月13日 18:20
Hi Ondrej, It is just my need. Thank you very much!