Creating Unity Prefab Instances and Geometry in one HDA

   2357   2   1
User Avatar
Member
21 posts
Joined: April 2018
Offline
Hello,

I’m trying to create an HDA which creates Prefabs in Unity (that are still prefabs) and, at the same time, creates regular geometry.
The only way that I found so far to instantiate Prefabs in Unity is by using the point attribute “unity_instance” and setting the path of the prefab as a string value.
This works quite good itself, but the problem is that the same HDA also needs to create geometry.

Weird things are happening then in Unity: no geometry is created, every Prefabs is instantiated 2 times (in the scene root and in the HDA itself), and the “Instance Inputs”-Sections shows 2 outputs.
I assume that is because the geometry (after the merge) gets the point attribute too (initialized with an empty string).
Am I overseeing something? What’s the best way to instantiate Prefabs and create geometry within one HDA?

Attachments:
PrefabInstancerTest.jpg (320.1 KB)

User Avatar
Member
571 posts
Joined: May 2017
Offline
Use a SOP subnetwork to generate multiple geometries. One geometry can be for your instances, and another for regular geometry.
User Avatar
Member
21 posts
Joined: April 2018
Offline
Works like a charm, thank you!
  • Quick Links