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
Command line process PDG with custom input
2286 4 0- danwnewlands
- Member
- 41 posts
- Joined: Dec. 2017
- Offline
- tpetrick
- Staff
- 586 posts
- Joined: May 2014
- Offline
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.
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
- Member
- 41 posts
- Joined: Dec. 2017
- Offline
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
- Member
- 41 posts
- Joined: Dec. 2017
- Offline
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!
Edited by danwnewlands - March 23, 2021 13:33:22
- tpetrick
- Staff
- 586 posts
- Joined: May 2014
- Offline
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]
-
- Quick Links