loputils - looking for the popup menu like selectPrimsInParm

   3236   2   0
User Avatar
Member
39 posts
Joined: Jan. 2012
Offline
I am looking for something in loptoolutils/loputils to allow a selection of prims in a toolscript.

The selectPrimsInParm() menu is what I am looking for, but it requires a parmtuple in the kwargs dict.

Can I build this menu passing in a hou.LopNode, and get the return as a list of primpaths?

Cheers,
Aaron.
www.aaronauty.com
User Avatar
Staff
4521 posts
Joined: July 2005
Offline
The functions in loputils are designed to follow common patterns of behavior, specifically from the "reselect" button to the right of a LOP Primitive Pattern (or Primitive Path) parameter. They allow you to select from the viewport, if a LOP viewer is available, otherwise they pop up a dialog. The result of the selection is put into the specified parameter (rather than being returned from the function).

If you want to follow these standard behaviors, these are the functions to call. Otherwise you'll have to pick and choose the bits of functionality you want to mimic from these functions and copy the code into your own function. There is also the _getSelectedPrimsForTool method which is used by the Edit Selected Primitives shelf tool. Again, it may or may not behave the way you want...

If you're just talking about bringing up a popup window for choosing a prim, that's done with the husdui.dialogs.primpicker module (which is used by all these functions if the scene viewer can't be used for the selection).
User Avatar
Member
39 posts
Joined: Jan. 2012
Offline
mtucker
If you're just talking about bringing up a popup window for choosing a prim, that's done with the husdui.dialogs.primpicker module (which is used by all these functions if the scene viewer can't be used for the selection).

Just what I was after, cheers.
www.aaronauty.com
  • Quick Links