Jump to content

Is there a shorthand way to refer to the incoming node in expressions?


Recommended Posts

http://www.sidefx.com/docs/houdini12.0/expressions/_custom

Make your own. We used to have a shorthand.

opin(0)

opin(1)

etc.

But as a "houdini master" you should be able to type 'opinputpath(".", 0)' in half a second flat, with your hands tied behind your back and heavily sedated..

Edited by ChristianW
Link to comment
Share on other sites

I know I could do a custom expression but then it creates a problem to distribute them, right? Like if you send the scene to someone else, they will also need to have your expressions.

Typing it once is fine but when I need it for multiple nodes, I get lazy :)

Link to comment
Share on other sites

I find the opinputpath to be a little long to use while prototyping ideas quickly. Is there a short hand syntax like

point(".", 0, "P", 0)

to refer to the incoming geometry/node?

SideFX agrees that writing long function names is time consuming. That's why they added aliases.

From the Edit menu select "Aliases and Variables".

The first tab, "Aliases" allows you to define an alternate name for hscript commands. So you could shorten "opinputpath" to "opi", and you could shorten "point" to "p". That would allow you to type

p(opi(".",0),0,"P",0)

You can also add your own pnt() expression that would run

point(opinputpath(".", 0), $PT, "P", 0)

The aliases and expressions are stored in hou.Session, a Python module that is saved with the HIP file. So there is no problem sharing the HIP file with other people.

You can also store Python functions and classes in the current session. For example you could add hou.session.foobar() and use it in Python expressions for parameters.

To edit the Python source code for the current session. Select "Windows" then "Python Source Editor" from the menu. In the popup Python editor make sure "hou.session module" is selected as the source file drop down option.

All of this is saved in the current HIP file. Allowing you to quickly prototype, etc.. etc..

You can also save a HIP file in the Houdini folder (somewhere under some kind of name), and every time you start a new scene you can get a default set of session stuff preset.

Edited by hopbin9
  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...