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

   1075   8   1
User Avatar
Member
402 posts
Joined: 2月 2013
Offline
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
スタッフ
146 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
スタッフ
146 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
402 posts
Joined: 2月 2013
Offline
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
スタッフ
146 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
User Avatar
Member
402 posts
Joined: 2月 2013
Offline
juliap
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.
- Sorry but I don't really understand what you are saying there.

juliap
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.
- Not entirely sure I get this either.

juliap
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) ?
- Yes.

juliap
Or once we provide such UI, that there is no visual feedback on the asset node and that it's all hidden on the component nodes)?
- In Maya I would expect a button with similar function to Houdini's group node group parameter action button. It would take you to Maya's component selection mode on the previously specified geo and preset the selection if there was one already. Confirm by pressing the same button, another button or pressing enter (up to you).

juliap
That the syntax for component selection is Maya syntax and not houdini syntax?
- That could be expected but whatever it is, it should be clearly explained in the Maya Houdin Engine docs (with examples).

juliap
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?
- Not sure what you are referring to. Is there a good documentation on this?

juliap
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.
Maya's component selection looks something like:
select -d pCylinder1.f pCylinder1.f ;
select -add pCylinder1.f pCylinder1.f ;
select -tgl pCube1.f ;
select -tgl pCylinder1.e ;
In other words, each component has a unique identifier. Just use Maya's internal systems and translate something like pCylinder1.e to something that Houdini would understand. It would not care about merges or order or whatever.

juliap
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
- Personally, I would make one input with all of objects that have been detected in all component selection parameters. The objects would have a name attribute that has the value of their original Maya name.
For each component selection parameter, for each detected component selection in it, we generate a group of the corresponding type (faces/primitive, points, vertices, edges) and the name of the group is the name of the component selection parameter.
Does that make sense?
User Avatar
スタッフ
146 posts
Joined: 10月 2017
Offline
OK, to summarise,I will modify the setToSelection when you hit the setToSelection button if there are mesh components selected (faces or vertices), there will be a primitive group called inputPrimitiveComponent and/or a point group called inputPointComponent
Edge and vertex-face selection not supported for now, until we get support for edge and vertex groups in HAPI.

There won't be any architectural changes to the plugin, just UI at this point, after that we can respond to feedback about whether it's usable as is - so component selection representation or functionality will not change, and there should be no backward or forward compatibility issues.

Note that there was a slight issue with setting the component list by hand - you needed to dgdirty afterwards to make sure that the input was updated - that will be fixed shorty.

I've created an RFE saying that component selection should be more easily accessible, we can add more stuff to that once you've had a chance to test what's already there. I will update the thread when the changes are committed (after the coming production build is out)

I will respond to some of the issues that you've raised above when I've had the change to think about them a little more.
User Avatar
Member
402 posts
Joined: 2月 2013
Offline
Thank you, that sounds really good!
User Avatar
スタッフ
146 posts
Joined: 10月 2017
Offline
The basic fix should be in 17.5.374. If you select mesh components (vertex and face) when doing
setToSelection on an asset's input The selected components will be added to the inputPrimitiveComponent or inputPointComponent groups. Your asset needs to look at these groups in order to access the selection. To avoid creating sets for these groups on output, turn off the outputGeometryGroups option on the asset.

One further change I was considering was to add some attributes on the houdiniInputGeometry to specify the group names to use.
  • Quick Links