I'm a bit confused about why Houdini has two shell interfaces. Textport and Python shell look like the same thing, just for different languages.
Can everything done in Textport be done in Python shell? If so is there any reason to learn HScript? Or should I just use Python only?
Textport vs Python shell
2109 3 0-
- raincole
- Member
- 696 posts
- Joined: Aug. 2019
- Offline
-
- jsmack
- Member
- 8184 posts
- Joined: Sept. 2011
- Offline
They're both important, although hscript is pretty rare to use for actual scripting. It comes in handy once in a while though as python doesn't have full coverage. For example, python used to not be able to configure viewport settings or change the scene timeline range. Where hscript is used most is for parameter expressions, and the shell is useful for testing or getting syntax help on a function. You can evaluate an expression with echo in the Textport.
-
- raincole
- Member
- 696 posts
- Joined: Aug. 2019
- Offline
jsmack
They're both important, although hscript is pretty rare to use for actual scripting. It comes in handy once in a while though as python doesn't have full coverage. For example, python used to not be able to configure viewport settings or change the scene timeline range. Where hscript is used most is for parameter expressions, and the shell is useful for testing or getting syntax help on a function. You can evaluate an expression with echo in the Textport.
Is there a way to find Python equivalents of commands on this page https://www.sidefx.com/docs/houdini/commands/index.html [www.sidefx.com] ? Or they simply don't exist and the standard way to use these in Python is just
hou.hscript(command)
-
- jsmack
- Member
- 8184 posts
- Joined: Sept. 2011
- Offline
raincolejsmack
They're both important, although hscript is pretty rare to use for actual scripting. It comes in handy once in a while though as python doesn't have full coverage. For example, python used to not be able to configure viewport settings or change the scene timeline range. Where hscript is used most is for parameter expressions, and the shell is useful for testing or getting syntax help on a function. You can evaluate an expression with echo in the Textport.
Is there a way to find Python equivalents of commands on this page https://www.sidefx.com/docs/houdini/commands/index.html [www.sidefx.com] ? Or they simply don't exist and the standard way to use these in Python is just?hou.hscript(command)
If you go to the page for the command, it usually shows the python equivalent. Many of the commands don't have direct analogs in python, even if they are implemented in the hom. Translating one to the other isn't straightforward.
-
- Quick Links

