how the python otl node initial?how to add initial script?

   1709   2   0
User Avatar
Member
13 posts
Joined: 10月 2012
Offline
I'm learning python hom and I tried to create a python otl node that can detect the inputRewired event.So I get the hou.Node.addEventCallback function and test it working fine in python shell.But here comes the problem,I have to manully run this code to make it work.Can I make the python otl node run the addEventCallback by itself when it's created just like some inital_script?
appreciate for your reply.
User Avatar
Member
1908 posts
Joined: 11月 2006
Online
You can add a node event callback from the OnCreated event handler section.

http://www.sidefx.com/docs/houdini12.1/hom/assetscripts [sidefx.com]

There is also an OnInputChanged event handler which you could also use.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
13 posts
Joined: 10月 2012
Offline
thanks graham,sorry for my overdue reply.
the script tab looks great.but I still have some question.
the event list have an arrow ‘up’ button on the left side,does it means that the order of these event callbacks I've created had to been taken carefully?
I put a ‘get geo’s attribute' code on the OnInputChanged but it didn't get the attribute the python node just update,it return the previous one that it disconnected.why?
  • Quick Links