Group Selection in HDA

   5573   9   2
User Avatar
Member
23 posts
Joined: 8月 2014
オフライン
Hi,

I am trying to build a HDA to orient and copy some geometry to a selection of faces. It works “somewhat” but I cannot get the group selection button to work.

I have no knowledge of python scripting, and the closes solutions I could find did not work out for me.

I would be thankful for a solution or some information what I should look up.

My five cents: Group selection in custom HDA´s should be easy. Perhaps it is

Thank you for considering.

Attachments:
Orient.hiplc (158.9 KB)
GroupSelectError.PNG (198.6 KB)

User Avatar
Member
23 posts
Joined: 8月 2014
オフライン
Hi there,
Is more information needed? I would really like to implement that.
Greetings, Christian
User Avatar
Member
802 posts
Joined: 2月 2017
オフライン
Hey Christian,

Im not in front of a Maschine right now. But you need to expose some of the other group node parameters, too. I cant recall exactly which one but add them till it works like group type and create ordered and so on.

Cheers
CYTE
User Avatar
Member
9372 posts
Joined: 7月 2007
オフライン
you could expose "grouptype" as your action button expression is looking for it

but if you know that ou will always want to select primitives you can change your action button script to this
import soputils
kwargs['geometrytype'] = hou.geometryType.Primitives
kwargs['inputindex'] = 0
soputils.selectGroupParm(kwargs)

Attachments:
Orient_fix.hipnc (173.4 KB)

Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
23 posts
Joined: 8月 2014
オフライン
That did the job. Thank you CYTE and tamte for helping me out. I will study this further as I think it´s usefull in building my tools.

Cheers
Schmauch
User Avatar
Member
1175 posts
Joined: 4月 2017
オフライン
Hmmm... I've use that python script in my hda but on some assets (not all), it doesn't group what I select in the viewport. Instead, it groups a bunch of primitives everywhere on the model.

When I use the rubber toy and group its front-left arm, I get this group:

1533-1628 1674-1776 1885-1928
etc.
(the result doesn't look like what I had selected in the viewport. its all messed up)

When I dive inside the hda and select from the group sop to make the same selection, I get this:
2189-2955
(and it works. I get the front-left arm)

Why would the selection give a different result whether I'm using the hda parameters or using the group sop directly from inside the hda?
User Avatar
Member
1175 posts
Joined: 4月 2017
オフライン
Ok, I did another HDA (super simple, just a group sop inside and a null). Everything works but if I add a sort sop before the group and set it to change the primitive order by X, the group selection from the hda doesnt work.

I get the feeling that using a group in an HDA will display the input geo to let you select on it instead of displaying the geo as it is right before the group sop. I'll try to have my groups at the top of the sop chain in my HDA...

**I moved the groups at the very top of the sop chain and it fixed my problems!
Edited by olivierth - 2023年3月16日 14:22:44
User Avatar
Member
9372 posts
Joined: 7月 2007
オフライン
yes, that selector is by default looking at the input geo
so if invoked on internal Group SOP it will allow you to select on geo of the Sort SOP
if invoked on HDA it looks at the input of HDA which has obviously original prim order

but once HDA is locked, you can't really enter selector on any internal node so you can't point it to Sort SOP as you may get some permission errors, so yes, definitely a good idea to have your group SOPs working directly with geometry from input
Edited by tamte - 2023年3月16日 14:21:02
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
2 posts
Joined: 5月 2019
オフライン
Question about this:

I'd like to make a similar multiparm HDA to do two things.
1. select a group of geos
2. give this group a color

This wrangle does the job but when I try to put these group and color params inside a Multiparm Block they don't work anymore, so I'm missing some knowledge about how these need to be treated in a loop in the HDA or something else.

Edited by Groom_Hodor - 2025年2月12日 14:19:35

Attachments:
aw.png (36.8 KB)

User Avatar
Member
75 posts
Joined: 4月 2020
オフライン
Groom_Hodor
job but when I try to put these group and color params inside a Multiparm Block they don't work anymore, so I'm missing some knowledge about how these need to be treated in a loop in the HDA or something else.

when a variable is in a multiparm block, it'll get a number appended to the name for each variable you create when you click the + button.

for example in this script of mine, you see i have a var called 'Points To Slide' and to read them you can't read chs("../Points_To_Slide"), you need to read chs("../Points_To_Slide1") or 2 or 3 for however many you have. thus i'm appending the number afterwards.

Edited by indigosm - 2025年5月14日 15:24:31

Attachments:
multiparmBlock.png (236.9 KB)

  • Quick Links