Adam Ferestad Posted May 3, 2016 Share Posted May 3, 2016 I am writing a node that will output some data that I am calculating as a mapped PNG file. The file takes a minute to execute, and it will only be getting worse as I increase its complexity, so I am wanting to set up the node so that I can trigger the code when I want it to run. I tried calling the function in the callback on the button, which is how I would expect it to work, but it doesn't apparently. I have looked around and found several people talking about hitting buttons automatically in the script, which is really not what I am looking for. So what am I missing in using a button in a UI? Quote Link to comment Share on other sites More sharing options...
anim Posted May 3, 2016 Share Posted May 3, 2016 7 minutes ago, Adam Ferestad said: ... So what am I missing in using a button in a UI? you are missing a file or any description of what exactly you are doing parameter callback should really be all you need: http://www.sidefx.com/docs/houdini14.0/hom/assetscripts#parameter_callback_scripts Quote Link to comment Share on other sites More sharing options...
Adam Ferestad Posted May 3, 2016 Author Share Posted May 3, 2016 The node I am working on is op:obj/Solar_Occlusion_1/occlusion_Calculations/write_to_file I am trying to call the processPoints() function using a button from the interface instead of calling it in the script itself in an effort to speed up the process by not having it run constantly. occlusionPassesDev.0.1.4.hipnc Quote Link to comment Share on other sites More sharing options...
anim Posted May 3, 2016 Share Posted May 3, 2016 Python SOP executes the code every time the node cooks as it is usually used to change the geometry since you don't use it to change geometry you don't need to use Python SOP at all just create digital asset, store your code in it's python module and call from the interface here is the file with included HDA, which contains mentioned changes (you can continue work on your code in HDA's python module) occlusionPassesDev.0.1.4_mod.hipnc 1 Quote Link to comment Share on other sites More sharing options...
Adam Ferestad Posted May 5, 2016 Author Share Posted May 5, 2016 Thank you so much anim, that is exactly what I was looking for. One quick question though, where do my print commands go now? I am still working with the script and I am needing to debug a few things to get it working right, but my print commands don't seem to be going anywhere. I am running the file in Windows right now, but I will try it in Linux to see if they will dump into the shell when I am finished with my pyro sim that I am running in the background. I would really prefer to dev in windows though, since I can use Notepad++ as my preferred IDE. Quote Link to comment Share on other sites More sharing options...
anim Posted May 5, 2016 Share Posted May 5, 2016 I'm on Win7 and all prints go to Houdini Console Window, which if not open pops up automatically when something tries to print 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.