Shalinar Posted February 3, 2017 Share Posted February 3, 2017 Has anyone else encountered an issue with an hda python module where the OnInputChanged evaluates twice? I'm not sure what's causing it... Even simple code in the module triggers it -- eg: node = kwargs['node'] print node ^ I get two printouts of the node each time i change the input connection. I originally noticed this when I was trying to query the connected input. When I did node = kwargs['node'] input = node.inputs()[0] print input I would get an error saying the index was out of the tuple range, followed by a correct printout of the first input connection. The first eval seems to trigger before the connection is actually made, hence why it errors the first time through. Then the second eval triggers once it's connected. This is bizarre, and I haven't yet figured out what's causing it. Surely this isn't standard behavior. Anyone else seen this or have ideas as to what's causing it? Thanks, Chris Quote Link to comment Share on other sites More sharing options...
Atom Posted February 4, 2017 Share Posted February 4, 2017 You can file a bug report to support@sidefx.com. Or just protect against it. try: node = kwargs['node'] input = node.inputs()[0] can_continue = True except: can_continue = False if can_continue: print input Quote Link to comment Share on other sites More sharing options...
Shalinar Posted February 4, 2017 Author Share Posted February 4, 2017 1 hour ago, Atom said: Or just protect against it. try: node = kwargs['node'] input = node.inputs()[0] can_continue = True except: can_continue = False if can_continue: print input Thanks for getting back to me Try/except is exactly what I ended up doing Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.