[Sidefx-houdini-list] call opparm from outside houdini

b.fx at free.fr b.fx at free.fr
Wed Apr 25 14:36:41 EDT 2007


Hello,

Looking toward python it is like that

for Sean example:
# test set temp example
import os, sys
phscript = os.popen('hscript ./filename.hip','w')
phscript.write("""opcd /obj
set temp = `execute("opls")`
echo $temp
bye""")

and should be

# test cache_execute
import os, sys
phscript = os.popen('hscript ./filename.hip','w')
phscript.write("""opparm -c /obj/geoTest cache_execute
bye""")

there is some example here:
http://mail.python.org/pipermail/python-list/1999-November/015201.html

françois

Selon Ammon Riley <ammon.riley at gmail.com>:

> On 4/25/07, Luca Zappala <luca at cinesite.co.uk> wrote:
> > hscript filename.hip -run "opparm -c /obj/geoTest cache_execute"
>
> In addition to the already mentioned "put your command in a file"
> methods, I'll also point out that since hscript reads input from stdin,
> you can just pipe your commands to it with "echo" (or whatever else
> you like):
>
>     echo "opparm -c /obj/geoTest cache_execute" | hscript filename.hip
>
> That way, if your command isn't static, you don't have to dump out a
> file for every single command you want to run:
>
>     # figure out opparm based on directory of hip
>     if (`dirname $hipfile | grep -ic /test/` == 0) then
>         set object = 'geoFinal'
>     else
>         set object = 'geoTest'
>     endif
>     echo "opparm -c /obj/$object cache_execute" | hscript filename.hip
>
> Hscript will terminate after it detects the end of input, which, in this
> case,
> is the single opparm command.
>
> If the implications of that aren't immediately obvious, beyond the example
> above, essentially what that provides is a method for interactive control
> over
> hscript that you can't get by using the "commands-in-a-file" approach. If
> you're using a more feature-rich programming language than shell scripts
> (okay, you can do it with shell scripts, too, but it's more painful), you can
> open a pipe to hscript. For example, in perl:
>
>     open HSCRIPT, "| hscript filename.hip" or die $!;
>     print HSCRIPT "opparm -c /obj/geoTest cache_execute\n";
>     close HSCRIPT;
>
> Once that pipe is open, you can feed in whatever hscript commands you
> like, and, if you're adventurous enough to delve into interprocess
> communication, read the responses from hscript, too, using that information
> to figure out more commands to send to hscript.
>
> Cheers,
> Ammon
> _______________________________________________
> Sidefx-houdini-list mailing list
> Sidefx-houdini-list at sidefx.com
> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>





More information about the Sidefx-houdini-list mailing list