Multiple geometries as one input.

   356   9   1
User Avatar
Member
19 posts
Joined: March 2015
Offline
Hello there,

I'm working on HDA, that is used in Maya where multiple geometries are feed as one input.
I want to be able to iterate through every geo later on.
There are few ways I could make it work but it's always requires few extra steps.

I'm looking for a solution where it's done with one action.

According to documentation if multiple geometries are set to one input the Merge sop is used in Houdini side to join them together and then Merge SOP is connected to the asset.
Considering this I ended up using Object Merge SOP inside HDA as it allows to pack geos before merging which gives me the access to every piece, and as an expression for objpath1 I've used python expression that reads input of my HDA which is supposed to be Merge SOP, reads out the inputs of the Merge SOP and returns its paths as result.
It works in Houdini, but it doesn't work in maya for some reason.

I wonder what else could be done to solve it.

Thanks for any help!
Edited by mikhail s - Oct. 8, 2020 23:27:12

Attachments:
hda_mult_geo_test.hdalc (6.4 KB)

User Avatar
Staff
99 posts
Joined: Aug. 2019
Offline
Hi Mikhail,

You don't need to use an object merge inside your HDA. Just wire the input into a pack node, and the pack node into the copy node. The object merge is created for you outside of the HDA. This can be seen by selecting the asset node in Maya and going to Houdini Engine>Debugging>View Assets in Houdini.

It seems to work for me. What exactly isn't working?

Attachments:
hda_mult_geo_test.png (63.6 KB)

User Avatar
Member
19 posts
Joined: March 2015
Offline
Hi John,
Thanks for your reply!
I’m sorry for being unclear.
My main goal is to get an access to every geo i send to the single input.
For example if it’s two objects: cylinder and cube, i want to be able to manipulate their attributes separately without any extra actions from user side.

If you load this hda in Houdini or just open the file i provided you’ll see it can get an access to the position of every geo that is connected to merge sop via wrangle node. Thanks to “pack before merge” option. But not in houdini engine plugin.
What it does instead it sees it is as a single object.

I can do extra steps like promoting Object Merge parameter “number of objects” and press + button every time i want to add another object. In this case it works perfectly. But i want to automate it as much as i can.

Thanks !!
User Avatar
Staff
99 posts
Joined: Aug. 2019
Offline
I'm still not sure if I follow. Each input object is partitioned into its own group in Houdini if you don't use the object merge. You can use these groups to modify the attributes of that object.
User Avatar
Member
19 posts
Joined: March 2015
Offline
Oh i didn't know that. I'm not sure it's in the docs.
Should I use group names in order to be able to manipulate each object's attribute? If so what are those names?
Edited by mikhail s - Oct. 9, 2020 14:04:59
User Avatar
Staff
99 posts
Joined: Aug. 2019
Offline
Here is one way you can achieve that. A name attribute is added, so we can use the “For Each Named Primitive” node to loop through each object. In the attached file, I have also created a meta import node so that I can extract the loop index and use that to drive the color and intensity of the mountain height parm.

Attachments:
hda_mult_geo_test.hda (13.7 KB)
hda_mult_geo_test_network.png (31.0 KB)
hda_mult_geo_test_result.png (64.8 KB)

User Avatar
Member
19 posts
Joined: March 2015
Offline
Thanks for your time, John, really appreciate it.
I believe you added name attribute outside of hda, correct? If so how can it be used with houdini engine plugin for maya?
User Avatar
Staff
99 posts
Joined: Aug. 2019
Offline
The name attribute is created for you when you provide multiple pieces of geometry from Maya into the input.
Edited by johnmather - Oct. 9, 2020 15:47:54
User Avatar
Member
19 posts
Joined: March 2015
Offline
oh wooow, it works !!!

Is it(name attribute) documented somewhere?? I haven't seen it there.

Thank you very much, John!
User Avatar
Staff
99 posts
Joined: Aug. 2019
Offline
The name concept is documented here: https://www.sidefx.com/docs/houdini/nodes/sop/name.html [www.sidefx.com]

It doesn't seem like it's mentioned within the Maya plugin documentation. I'll add it.
  • Quick Links