Search - User list
Full Version: Command line process PDG with custom input
Root » PDG/TOPs » Command line process PDG with custom input
danwnewlands
Hey,

Are there any examples of how you would run a PDG script from terminal or an external program via python, with a defined input file.

I my head I'm imagining something like opening a terminal (linux) and doing a command like: houdinipdg -pathtograph /path/to/pdgnetwork/network.hip -inputfile /path/to/file/file.abc

..and then the pdg network would use that file path as an input to the graph to create a turntable for instance

Any tutorial links or examples would be appreciated to get me going
tpetrick
You can cook a TOP network from the command line using Hython or HBatch -- there are some examples here: https://www.sidefx.com/docs/houdini/tops/cooking.html#cookcommandline [www.sidefx.com]

Input files would need to be sent as environment variables, not as extra command line arguments, and then referenced in the .hip file as such.
danwnewlands
tpetrick
You can cook a TOP network from the command line using Hython or HBatch -- there are some examples here: https://www.sidefx.com/docs/houdini/tops/cooking.html#cookcommandline [www.sidefx.com]

Input files would need to be sent as environment variables, not as extra command line arguments, and then referenced in the .hip file as such.

Perfect, this got me where I needed to go! Thanks pal
danwnewlands
tpetrick
You can cook a TOP network from the command line using Hython or HBatch -- there are some examples here: https://www.sidefx.com/docs/houdini/tops/cooking.html#cookcommandline [www.sidefx.com]

Input files would need to be sent as environment variables, not as extra command line arguments, and then referenced in the .hip file as such.

So just coming back to this, I've got things working in terms of launching a script and executing a network with the various commands etc but I need to define custom variables at launch for instance $FOO = "bar" so that I can use $FOO in my script and expect a value to be supplied.

Usually we would `export FOO="bar"` I guess but I cant seem to find anything in the docs to do this with hbatch.

Cheers!
tpetrick
Environment variables you set in your shell should be inherited by the hbatch session. From within hbatch you can set them using the set command: https://www.sidefx.com/docs/houdini/commands/set.html [www.sidefx.com]
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB