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

Ammon Riley ammon.riley at gmail.com
Tue May 1 11:34:37 EDT 2007


On 5/1/07, Luca Zappala <luca at cinesite.co.uk> wrote:
> I've got a question about the pipe python implementation:
> how do I pass both strings and variables into phpscript.write("""put
> variable in here""") ?

Are the variables are in python, or in hscript? If they're in python, then
you just use normal python methods for getting your variable into a
string, and pass the complete string to hscript:

    object = "/obj/geoTest"
    command = "opparm -c %s cache_execute\n" % object
    phpscript.write(command)

For more info on that, see:
    http://docs.python.org/tut/node5.html#SECTION005120000000000000000
    http://docs.python.org/lib/typesseq-strings.html

If the variables are in hscript, then you can just use the exact same
command as you'd type into hscript:

    phpscript.write("set object = /obj/geoTest\n")
    phpscript.write("opparm -c $object cache_execute\n")

> and what does bye stand for?

The "bye" command, I think, exits hscript (I don't have houdini in front of me
at the moment, so I can't check to be sure). Rather than using "bye", however,
I'd just close the pipe.

> Also I had a look at the ref page you sent but I get an error using
> writeline (object has not attribute writeline).

That email was written in 1999. No doubt, you're using a more recent version
of python. :)

Cheers,
Ammon



More information about the Sidefx-houdini-list mailing list