Menu Scripts, in operator type properties, seem to only support hscript. Is there an hscript/Python buttom I'm not seeing somewhere?
Thanks,
Jens
menuscripts and HOM
3440 3 1- anakin78z
- Member
- 80 posts
- Joined: July 2005
- Offline
- mark
- Staff
- 2591 posts
- Joined: July 2005
- Offline
anakin78z
Menu Scripts, in operator type properties, seem to only support hscript. Is there an hscript/Python buttom I'm not seeing somewhere?
Thanks,
Jens
I also ran into that short-coming…
To work around it, you can try the pythonexprs() expression function in hscript…
This is used in SOHO to parse the FBrender menu (as a stop-gap)
menureplace {
}
P.S… That shouldn't be word-wrapped… The echo and `` expression should be on the same line.
- old_school
- Staff
- 2540 posts
- Joined: July 2005
- Offline
All the scripts (on created, before first create, etc.) in HDA's for H9.0
only support hscript. In order to run python, you need to use the python -c
option which allows you to pass in a program to python (note: this option
terminates any option list):
python -c “hou.node('$arg1').hdaModule().onCreated(hou.node('$arg1')”
Here's another variant for an OnCreated Script:
cd $arg1 # or whatever
python -c “hou.pwd().hdaModule().onCreated()”
This also works in any parameter Callback Scripts:
python -c “hou.ui.displayMessage('hello world')”
Parameters automatically import hou.
only support hscript. In order to run python, you need to use the python -c
option which allows you to pass in a program to python (note: this option
terminates any option list):
python -c “hou.node('$arg1').hdaModule().onCreated(hou.node('$arg1')”
Here's another variant for an OnCreated Script:
cd $arg1 # or whatever
python -c “hou.pwd().hdaModule().onCreated()”
This also works in any parameter Callback Scripts:
python -c “hou.ui.displayMessage('hello world')”
Parameters automatically import hou.
There's at least one school like the old school!
- anakin78z
- Member
- 80 posts
- Joined: July 2005
- Offline
Ok, so now I'm using hscript to call expressions which call python… :roll: my head is spinning. I'm assuming this shortcoming will be fixed in 9.1? Possibly backported to 9?
Thanks for the help Mark and Jeff. I think I can make it work.
-z
Edit: and we're right back to the problem of quotes not being transfered correctly. Lovely. What combination of single, double, escaped quotes do I need to use to make this work now? :evil:
Thanks for the help Mark and Jeff. I think I can make it work.
-z
Edit: and we're right back to the problem of quotes not being transfered correctly. Lovely. What combination of single, double, escaped quotes do I need to use to make this work now? :evil:
-
- Quick Links