Jump to content
Sign in to follow this  
renderfan

EventCallbackProblem

Recommended Posts

Hello all!

I have Python Sop and inside node I have function to split some polygons. But because splitting takes long time I want to do it only if geometry of input does change. I tried to use hou.Node.addEventCallback but it does not work for me. What I have so far is code below:


event_types = (hou.nodeEventType.InputDataChanged, hou.nodeEventType.InputRewired)
def split_polygons(geo):
"do some splitting"
return polygons
def onchange(**kwargs):
node_in = kwargs["node"]
geo_in = node_in.geometry()
split_polygons(geo_in)

node.addEventCallback(event_types, onchange)
polygons = split_polygons(geo)
"do something with polygons"
[/CODE]

This does not work because I do not know how I can get the polygons which are returned by function only if input change.

Thank you in advance!!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×