Can I plug geometry selections into Houdini Engine (without sets)? [Maya 2019.1]

   184   4   0
User Avatar
Member
391 posts
Joined: 2月 2013
Online
I want to do a workflow where I first plug in a mesh and then specify one or more faces (or vertices) on that mesh to guide the HDA.
Ideally I would have the additional face selection as separate inputs of some kind in a multiparm and they would not require the use of sets.
Has anyone done such a setup? How did you do it?

On a somewhat related note, can anyone give an example of how they use string parameters?
User Avatar
スタッフ
141 posts
Joined: 10月 2017
Offline
You can do this if you're using the asset as a history asset - the limitation is that history assets only do the interesting stuff for their first input - but if you only need one mesh input, that's OK.

If you select faces or verts on a mesh, and select the asset, and do addAssetAsMeshHistory from the menu, then the asset is connected as construction history (i.e. upstream from the mesh, with the mesh's previous history connected to the houdiniInputGeometry node, and the selected components set on the inputGeometryNode's inputComponents attribute (the same way that a native maya history node handles input components)

e.g. getAttr houdiniInputGeometry1.inputComponents;
// Result: f[24:29] f[45:51] f[65:71] f[85:92] f[105:113] f[125:134] f[147:150] f[152:156] f[169:170] f[173:176] f[193:196] f[213:216] f[232:237] f[253:257] //

If there is a component list present, when the houdiniInputGeometry creates the geo, the corresponding primitives are added to either the inputPrimitiveComponent or inputPointComponent group. So your asset has to know about those named groups.
Edited by juliap - 2019年8月15日 11:43:13
User Avatar
スタッフ
141 posts
Joined: 10月 2017
Offline
The UI only lets you set the inputComponents for a history asset at the moment. But you can set the inputComponents by hand for other assets as well. We'd still need to modify the script used in setToSelection to get it to work for all assets. Is this worth doing sooner rather than later?
User Avatar
Member
391 posts
Joined: 2月 2013
Online
It seems like one of the most essential parts of developing tools for Maya, is that you can easily make geometry selections and the tool picks them up.
I was hoping that I can use a string parameter that way and have that in a multiparm. The important part is, that the geo selection relates to the parameters in the multiparm.
Do you need an RFE for that?
User Avatar
スタッフ
141 posts
Joined: 10月 2017
Offline
The selection is already a component list attribute on the houdiniInputGeometry. Which is effectively a string attribute except that you do a “setAttr -type componentList” instead (which really just validates the syntax). And that way it looks just like any other Maya mesh history node. And we can use MFnComponentListData instead of parsing it ourselves when trying to get groups.

When you do setToSelection on an asset node, the parm isn't a string attribute either, There's a multi of int attributes, and we're passing the node id of the input nulls, or merges or the outputs of upstream assets. The input field in the attribute editor isn't an attribute either - we walk the inputs to find the connected nodes and display the unique partial paths of all the upstream geos or assets.

Is your concern with specifying component selection on the inputGeometryNode just that we haven't provided convenient UI for setting component selection (except for history assets) ? Or once we provide such UI, that there is no visual feedback on the asset node ant that it's all hidden on the component nodes)That the syntax for component selection is Maya syntax and not houdini syntax? That we create a an explicit group (especiall with a hardcoded name) rather than being to pass the selection directly to some group specification on some node in your asset?

Putting the component selection on the houdiniAsset node would be problematic because the asset node doesn't have access to the mesh data directly and you can have multiple meshes coming in though a merge. The asset has no knowledge of the ordering of the inputs and the merged geo is not accessible in maya so then there isn't a straighforward way to build a houdini-style selection specification with the component indexing remapped to the merged mesh.

How about it we modify the scripts used by the setToSelection buttons to recognise component selection, and set up the component lists on the houdiniInputGeometry nodes. We could display the component list in the attribute editor for on the houdiniInputGeometry node (It's hidden right now), and provide some kind of feedback in the assetNode's input field in the AE that an input has component selection. We could add an attribute for a user-specified group name as well, if the hard coded group name is a problem
  • Quick Links