Mzigaib Posted March 20, 2013 Share Posted March 20, 2013 I an trying to use this on a callback script fot a button: foreach nodes (`run("opfind -n mynodes*")`) opparm $nodes scale 0.1 end Can anybody tell me why? Thanks. Quote Link to comment Share on other sites More sharing options...
lukeiamyourfather Posted March 20, 2013 Share Posted March 20, 2013 One word: Python. If you'd like an example I'd be happy to oblige. Quote Link to comment Share on other sites More sharing options...
Mzigaib Posted March 20, 2013 Author Share Posted March 20, 2013 Thanks! I am still not a phyton guy so far hscript solved all the problems for me but yeah any help would welcome Quote Link to comment Share on other sites More sharing options...
Mzigaib Posted March 20, 2013 Author Share Posted March 20, 2013 (edited) I can do with hscript what I want in a shelf button but the same doesn't work on the callback script button, I think there's something to do with splitlines. Edited March 20, 2013 by Mzigaib Quote Link to comment Share on other sites More sharing options...
lukeiamyourfather Posted March 20, 2013 Share Posted March 20, 2013 Attached is a scene with buttons that call a Python script. The buttons are on the "BUTTON_HERE" null in /obj/geo1. The script is in the "Python Source Editor" window. The same script could just as easily be on a shelf button but if it's for a one off scene I'd just do it in the scene itself like shown in the example. pythonButtonExample.hip Quote Link to comment Share on other sites More sharing options...
Mzigaib Posted March 21, 2013 Author Share Posted March 21, 2013 Thanks Man! You are awesome! Now I'll have to get a hang of phyton, but I am already inspired I Still I would like to know how to do it with hscript in a callback. Cheers! Quote Link to comment Share on other sites More sharing options...
lukeiamyourfather Posted March 21, 2013 Share Posted March 21, 2013 I Still I would like to know how to do it with hscript in a callback. I don't know much hscript, barely any really so I can't help you there. If the issue is multiple lines then use Alt + E to bring up an external editor. When you close the editor be sure to save it and Houdini will import the contents of that save into the text field (including multiple lines). Quote Link to comment Share on other sites More sharing options...
Mzigaib Posted March 21, 2013 Author Share Posted March 21, 2013 Yeah but it seems that in the case of the callback you can only use one line, but I can b wrong. Quote Link to comment Share on other sites More sharing options...
lukeiamyourfather Posted March 21, 2013 Share Posted March 21, 2013 Yeah but it seems that in the case of the callback you can only use one line, but I can b wrong. Instead of using Python and hou.session you could use the "Aliases and Variables" window (on the expressions tab) to create custom functions with hscript. Then call those from the callback. I haven't tried it but it's the hscript equivalent of hou.session which would allow multiple lines. I think there are other places to stuff hscript if that doesn't work, hopefully an hscript expert will chime in. I'd still use Python personally. Quote Link to comment Share on other sites More sharing options...
Mzigaib Posted March 21, 2013 Author Share Posted March 21, 2013 Thanks, I'll try that. 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.