HoudiniUserInterfaceTips: Difference between revisions

From cgwiki
Jump to: navigation, search
No edit summary
Line 177: Line 177:

* Karabiner lets you do this on OSX: https://pqrs.org/osx/karabiner/ (once its running, search for 'command middle', and enable 'Command_R to MiddleClick'
* Karabiner lets you do this on OSX: https://pqrs.org/osx/karabiner/ (once its running, search for 'command middle', and enable 'Command_R to MiddleClick'
* Autohotkey lets you do this on windows: https://autohotkey.com/  I have a .ahk file in my startup folder with the mapping "AppsKey::MButton"
* Autohotkey lets you do this on windows: https://autohotkey.com/  I have a .ahk file in my startup folder with the mapping "AppsKey::MButton", or on my G73 its "RAlt::MButton"

Revision as of 19:25, 15 January 2018

hda otl asset stuff

opdef paths

All relevant info here: http://www.sidefx.com/docs/houdini/ref/windows/optype#access_contents


mplay for comparing sequences

I must admit I don't use mplay much these days, we have RV at work, and if I need robust playback elsewhere I'd probably use DJV, nice open source tool. Still, its handy to know that mplay can do more playback tricks than people expect. I vaguely recalled it could compare sequences, but before I could work it out, JeffLMnT from the discord chat explained it all, here's a summary:

  • After you load your first flipbook, go to view>layout and choose any number of columns or rows. In the same spot uncheck "hide blank viewports"
  • Click the blank viewport that pops up, you'll see a green highlight move to the new viewport
  • Click the New Sequence button (or menu render>new sequence) and do another flipbook, you should have two flipbooks side by side
  • You can do this for up to 17 renders, perfect when wedging sims and comparing them

Wiping between them is quite easy, every flipbook names the caches with ip_<timestamp>, all you need to do is click the new sequence button and render a new flipbook. If you look in the image menu you can see the flipbook being listed with the time stamps. In the same menu there is a compare images tickbox, that should activate the compare dialog. The little tool left of the slider lets you switch between different wipes, and even ask mplay to highlight differences.

Thanks Jeff!

customise right click menus

Parm defaults.gif

Houdini's right click menus can be customised through xml files dropped in your houdini preferences folder. Matt Ebb a while ago shared this rather neat trick to auto create channels in wrangles, which after he wrote it up became a feature sidefx added as standard.

Someone in the houdini discord chat mentioned it'd be handy to have the create-channels button also set default values. Armed with Matt's example and the handy menurefresh texport command, I got a rough proof of concept going.

The functionality itself is done using houdini's python module, which means its pretty easy to pull apart and learn if you know a bit of python already. Here's me copying Matt's PARMmenu.xml file locally, and replacing his code with this:

 1 import re
 2 parm = kwargs['parms'][0]
 4 n = parm.node()
 5 snippet = parm.unexpandedString()
 7 for l in snippet.split('\n'):
 8     r = re.findall('chf.+$',l)
 9     if r:
10         r = r[0]
11         p,default = r.split('//')
12         p = re.findall("chf\(\"(\w+)\"", l)[0]
13         default = float(default.strip())
14         t = hou.FloatParmTemplate(p, p.title(), 1,default_value=([default]))
15         n.addSpareParmTuple(t)

What's going on? Glad you asked:

  1. import the regex module
  2. get the reference to the parameter that was right clicked
  3. derive the node name from the parm
  4. get the vex wrangle code from the parm
  5. for each line in the vex wrangle code:
  6. find 'chf(' in the line, copy from there until the end of the line
  7. if that text search worked:
  8. get the first element (re.findall always returns a list of results rather than a single string)
  9. split that result on the // bit, so we get the chf call stored as 'p', and the stuff after the // as 'default'
  10. take the chf bit, find the word inside the double quotes, so chf("foo") becomes 'foo'
  11. take the comment, strip out any whitespace, and convert to a float
  12. make a new parameter template using the name we extracted and default value we extracted (note that the default value has to be an array in a tuple, weird)
  13. add that parameter to the node

This is a super rough proof of concept (it only works with chf, only support double quotes), but its interesting. Go do more things with this!

the 9 group list hotkey (aka the joy of se(le)ct(ion))

9 hotkey tricks.gif

That grid of points has a @cluster attribute, a random attrib called @noise, and some @path string attributes.

  1. Hit the 9 hotkey, you see a list of groups (make sure you're in the appropriate selection mode, so 2 hotkey for points, 3 for edges, 4 for prims)
  2. Select an entry in the list
  3. While your mouse is in the viewport, tab in a blast node. It will be created, and the group field will be filled out
  4. remove the blast, back to the viewport, this time go down to attributes. Here I select the cluster attrib which I made earlier
  5. can see the cluster listed and colour coded. You can hover over the list to see them highlighted, or hover over a point, and all points with the same cluster attrib will highlight
  6. put down a blast node, this time the group field will be pre filled out with the attrib syntax; @cluster=3
  7. remove blast again, this time shift select nodes in the viewport, blast node, it'll be filled out with the multiple cluster attribs
  8. remove blast, switch to displaying the path attrib
  9. blast again, there it is. super handy for material assignments!

d hotkey is context sensitive

'd' over the viewport brings up display options, while over the network view it brings up different options. Easy to miss.

use d viewport menu to change point display size

default is 3 pixels, but you can make them super tiny if they get in the way, or giant. d in the viewport, geometry tab, 'point size' slider in the lower left.

d hotkey will hide the display options too

all the time i was closing the window manually like a chump. just hit 'd' again, it'll go away.

tab menu auto completes on initials

Trying to put down a point wrangle sop? You don't have to type '<tab>p o i n t w' to find it; just type the first letter of each word, ie, '<tab> p w'. The tab auto complete is very optimistic in its matching, so you can even type the first few characters of the first word, then the first letter of the second, and it'll find it, eg '<tab>p o i w' will also directly find the point wrangle.

tab menu shift-enter will auto drop and append to current selection

In theory this is awesome, but it also moves the network view, which I hate. You might love it though!

This now works as expected in H16, it's pretty sweet.

viewport got doubled up geo? try making a new scene view

The houdini viewport is generally pretty good, but sometimes (especially when you're first learning it for some reason), some geo will be duplicated in the view, and won't go away. Its easy to think its something you've done wrong, but if you catch yourself in time, just make a new scene view (little plus button in the tabs above the viewport, scene view), see if the view is ok again

w hotkey

  • shift-w in the viewport to toggle wireframe overlay
  • w in the viewport to toggle solid/wire
  • shift-w in network view to open outliner

p hotkey

  • p in the network view toggles the parameters in the corner
  • p in the viewport toggles a floating parameter pane (but its behavior is strange; eg when inside a dopnet, pops up paraters for the dopnet itself)
  • alt-p toggles the timeline to swap between panes
  • alt-shift-p pops open a python prompt
  • ctrl-p in the viewport creates a sticky note

visually adjust pivot of transform sop

The pivot for a transform is normally at the origin; you can tap the insert key to move the pivot (its the same as keying in values for the pivot channels, but all visual n stuff)

1 and 2 to update display and render flags

I use this all the time, I think a hangover from using nuke too much. With the current node selected, hit 1 to set its display flag to here, 2 to set its render flag. This is often much faster than trying to hit that tiny blue rectangle.

Hitting 1 repeatedly cycles between the selected node and the last created node, handy for doing a quick comparisons (analogous to nuke and setting 1 to a node, 2 to another, and tapping 1 2 1 2 to compare them)

In H16 these 1 and 2 hotkeys have been replaced with R and E.

colour correction toolbar in viewport

Viewport cc.gif

Mentioned elsewhere on the wiki, very handy. Viewport top-right menus (where it usually says persp1 or cam1), 'correction toolbar'.

understanding viewport selection and point display

I remember this really frustrated me when I first used Houdini, doesn't bother me at all now. When you're in sops, its the maya equivalent of being in component mode all the time (ie, like you've hit F8). Thing is Houdini doesn't shout at you the way maya does, and you can be in sops and have selection disabled, which can be more confusing. So here's what to look for:

  • s hotkey in viewport enables selection mode
  • esc hotkey quits this mode and normally puts you into view mode. so if I consciously want to get out of select and back again, i'll be going s, esc, s, esc
  • in select mode, 1 2 3 4 choose obj, point, edge, face respectively. 1 will kick you up a level into /obj context which is annoying, but just hitting 2 or 3 or 4 will drop you back down again
  • in view mode, 1 2 3 4 choose the persp/top/front/right view. As before, normally I don't want or expect this, so I'll swear, hit 1 to go back to the persp camera, hit s, then 2 to choose points
  • the toolbar at the top of the viewport tells you what mode your in. in view mode, its blank. in select mode, you see icons for point/edge/face, with one of them highlighted for the current mode.
  • if you can see blue points, you're either in point mode, OR you've enabled 'display points' with the toolbar on the right of the viewport.
  • most of the time i want to stay in select mode, but not clutter my view with points. i've found the simplest way is to hit '4' to get into face mode, the viewport looks clean, but i can jump back to points whenever I want
  • another shortcut to swap to persp/top/front/right is to hold down spacebar and press 1/2/3/4.

the frustration of seeing blue points when you don't want them, or not seeing them when you do, drove me crazy for the first week or so. Keep an eye on the toolbar, all makes more sense.

geometry spreadsheet

Always have this open. ALWAYS. It should be a force of habit to see what attributes are on your geometry, otherwise you're flying blind.

The view dropdown menu on the geo spreadsheet is handy; put it into 'only show selected', then choose some points, its much easier to inspect data, get their point numbers and so forth.

If you have lots of point attributes, use the view menu, 'hide all attributes', then just enable the ones you want.

You can also use the attributes filter (the text entro to the right of the view menu. Eg, make it *id to only show attribs ending in 'id'. If you have lots of groups, you can hide them in the geo spreadsheet by using ^group* in the attributes filter.

You can sort by any column by clicking its title.

precise editing of keyframes in the animation editor

Anim keyframe edit.gif

Say you want to move a lot of keys 10 frames later. Select them all in the animation editor, and in the 'frame' field at the bottom, type +10. This also works for the value field too. Explained in more detail here:


Houdini on a laptop, middle mouse button

It's nearly impossible to use Houdini without a middle mouse button. If you're a lazy slob like me who likes to mess around with houdini on a laptop while on the couch, this presents a problem.

My solution has been to map a key I rarely use to be a middle mouse button. On a Mac I use the right clover-key, on Windows I map the context menu key (the one between alt and ctrl on the right of the spacebar).

  • Karabiner lets you do this on OSX: https://pqrs.org/osx/karabiner/ (once its running, search for 'command middle', and enable 'Command_R to MiddleClick'
  • Autohotkey lets you do this on windows: https://autohotkey.com/ I have a .ahk file in my startup folder with the mapping "AppsKey::MButton", or on my G73 its "RAlt::MButton"