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

Luca Zappala luca at cinesite.co.uk
Tue May 1 11:59:55 EDT 2007


Hi Ammon,

I'm referring to python script. Is there a reason why I should promote 
"opparm -c %s cache_execute\n" % object instead of strings operations?

This is the current script (not working):
command = "opparm -c "+node+" "+param+"\n"
phpscript = os.popen("hscript ........../filename.hip","w")
phpscript.write(command)


Luca

Ammon Riley wrote:
> 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
> _______________________________________________
> 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