[Sidefx-houdini-list] execute external python script

Francois-Xavier Boussard b.fx at free.fr
Wed Dec 5 06:00:30 EST 2007


Hello,

I'm looking after an easy way to run python script from arbitrary directories on
disk. I mean to pick it with a file selector UI.

Sound simple, i end up with an hscript callback button from an hda... Is it
possible to do that from a shelf ?

Menu File-> Run Script: only allow hscript, why ?

A shelf tool with a python script hou.ui.selectFile() return unexpanded variable
as $HOME (linux) that are wrong with execfile(). Is there a way to expand those
variable with the houdini python tools ?

A shelf tool with an hscript. How do i pass the result of an hou.ui.selecFile()
to an hscript variable ?
  set foo = `run('python -c "hou.ui.selectFile(file_type=hou.fileType.Any)"')
  echo $foo
return blank

An HDA with a file button and a callback script:
how to access the $script_value from a python script ?
It works with a hscript callback:
  python -c "execfile('${script_value}')"
It is not that nice, using an hda plus hscript...

Did i miss an obvious way to do it ?

thanks
francois






More information about the Sidefx-houdini-list mailing list