How to create a subnet with one input and one output but multiple geometries?

   3599   5   1
User Avatar
Member
32 posts
Joined: Nov. 2017
Offline
I have a subnet with 6 geometries, each with a material attached (from a material subnet with relative refs).
I'd like that subnet to have just one output (so I can use it as an HDA).
I'm new to Houdini but I figure there must be some node I can just wire all the objects into and it will merge them into one object or container or something. No?
I tried to use a “merge” node but I can't even create a merge node in this subnet (it doesn't appear in the TAB menu).
I tried the “Combine” modify operator but it totally changed my subnet and removed the materials.
Is there a simple way to merge objects so the subnet just has one output?
User Avatar
Member
7733 posts
Joined: Sept. 2011
Online
Objects don't need to be merged, and cannot be merged. When you render your Subnet HDA object, It can be specified in either the force objects list or candidate objects list. Under candidate, all displayed objects inside the subnet will be rendered. If the subnet is listed under force, then all objects within will be rendered regardless of their display flags.

Subnet/HDA objects always only have one output, which is a transform. The source of the transform can be specified from one of the contained objects or any input object's transform.
Edited by jsmack - March 25, 2019 01:26:20
User Avatar
Member
32 posts
Joined: Nov. 2017
Offline
Thanks – that's helpful. It confirms why I've been having so much trouble.
The only reason I'm trying to make an HDA is to “package” the object (with its materials etc.) so I can instance it using CopyToPoints or Instance. I'm still having trouble doing that. I can make CopyToPoints work fine with a simple object like a sphere, but not with my complex one.
I'll keep trying other ways.
User Avatar
Member
7733 posts
Joined: Sept. 2011
Online
Ah, I see now why you wanted to merge them. As of now there is not a way to instance entire hierarchies that way.

Something I have done in the past to allow instancing of hierarchies is to export the objects to alembic. Alembic files can be read into sops as packed primitives, which allow for instancing onto points. You may need to redo shader assignments, however.
User Avatar
Member
8513 posts
Joined: July 2007
Offline
you can also just have your 6 “geometries” (whatever they are, packed disks, alembics, etc., but preferably packed) in the same geometry object and assign materials using Material SOP instead of object level
then merge them and instance
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
1 posts
Joined: Oct. 2019
Offline
Switch geometry node
Switches between network branches based on an expression or keyframe animation.
https://www.sidefx.com/docs/houdini/nodes/sop/switch.html [www.sidefx.com]
  • Quick Links