Multiple curves input

   4657   6   2
User Avatar
Member
897 posts
Joined: July 2018
Offline
Any plan to support multiple curves as inputs? There's no combine function for them in Maya so this is a fairly big limitation for us.
B.Henriksson, DICE
User Avatar
Member
818 posts
Joined: Sept. 2013
Offline
There's a way to do it right now. It's not very robust, but it might give you what you want.

There's some support for using Maya's hair system, the hairSystem node. This is done by connecting hairSystem.outputHair into a utility node called houdiniCurveMeshInput. This utility node is then connected to the houdiniAsset node. Take a look at the attached Maya scene file to see how the network is setup.

You're probably not using Maya's hair system, but you could still make use of the houdiniCurveMeshInput node. The houdiniCurveMeshInput node doesn't actually require the hairSystem node. So what you could do is:
1. Manually create the houdiniCurveMeshInput node
2. Connect your curves to houdiniCurveMeshInput.inputCurves attribute
3. Connect houdiniCurveMeshInput.outputObjectMetaData to the houdiniAsset.input.inputGeo

A limitation is that all the curves have to have the same periodicity. If the number of curves need to change, you also have to manually adjust the houdiniCurveMeshInput.inputCurves connections.

Attachments:
test_hair.mb (153.2 KB)
test_sweep.hda (3.3 KB)

Andrew / アンドリュー
User Avatar
Member
897 posts
Joined: July 2018
Offline
Great. I think I can wrap this with a maya script to a decent workflow.

Out of curiosity, is there any plans to allow for multiple objects as import. (Like treating the group as a merge node)
B.Henriksson, DICE
User Avatar
Member
818 posts
Joined: Sept. 2013
Offline
It's definitely a popular request. For meshes, one way is to use the “Mesh -> Combine” tool to combine the meshes into one mesh, and use the result as an input. This uses the polyUnite node behind the scene, so it's also fairly possible to script this.

However, one issue with this approach is that the transformation for each object is lost, because all the meshes are essentially baked into one. Depending on the usage, this may or may not be acceptable. Another issue is that if the number of objects changes, the connections need to be updated.

Instead of relying on attribute connections for getting geometries, maybe another way is to setup hooks to monitor node changes directly. But since this bypasses the DG, it feels like it'd be quite tricky to have things update correctly at the right time.

Maybe just using the polyUnite node is enough to satisfy most cases.
Andrew / アンドリュー
User Avatar
Member
33 posts
Joined: Sept. 2014
Offline
I have the same problem and I really want some good and useful way to make multiple input((
maybe is there chance to make some script with python that allow you to add multiple objects into one string text with dot or commas and in houdini make python node or wrangle that take this string text, separate by commas and add each to merge object node… i dont know if it works out) its just an idea, but it would be great and better than advice from Awong
User Avatar
Member
897 posts
Joined: July 2018
Offline
Looking more deeply at this it seems that what's passed from the hairsystem to Engine is not the original curve but the rebuilt “Output curve”. In the picture the dark blue curve is the input and the light blue curve is the output. As you see the output is not a correct representation of the original.

In my book this is a big limitation. Many, if not most, tools is built on spline inputs.




and from engines script that handles the connections we can see it's the output curve that gets passed to Engine:

string $outputHairs = `listAttr -multi ($object + “.outputHair”)`;

int $iInput = 0;
for ($outputHair in $outputHairs)
{
string $follicleShapes =
`listConnections ($object + “.” + $outputHair)`;

for ($follicleShape in $follicleShapes)
{
string $inputPlug =
`format -s $inputNode -s $iInput "^1s.inputCurves“`;

connectAttr ($follicleShape + ”.outCurve") $inputPlug;
}

$iInput += 1;
}
B.Henriksson, DICE
User Avatar
Member
818 posts
Joined: Sept. 2013
Offline
kahuna031
Looking more deeply at this it seems that what's passed from the hairsystem to Engine is not the original curve but the rebuilt “Output curve”. In the picture the dark blue curve is the input and the light blue curve is the output. As you see the output is not a correct representation of the original.

Have you tried the other method that I mentioned in an earlier post?

awong
The houdiniCurveMeshInput node doesn't actually require the hairSystem node. So what you could do is:
1. Manually create the houdiniCurveMeshInput node
2. Connect your curves to houdiniCurveMeshInput.inputCurves attribute
3. Connect houdiniCurveMeshInput.outputObjectMetaData to the houdiniAsset.input.inputGeo

A limitation is that all the curves have to have the same periodicity. If the number of curves need to change, you also have to manually adjust the houdiniCurveMeshInput.inputCurves connections.

This would avoid using Maya's hairsystem entirely. It's a bit of manual setup, but it's completely scriptable.
Andrew / アンドリュー
  • Quick Links