Hello,
I've searched the forum but I did not manage to find information about that.
I can add Unity prefabs for the scatter/placement tool:
but after the bake I get game objects that are not link to the original prefab:
which makes it complicated to work with when prefab changes.
Is it possible to instantiate prefabs and maintain the link to the original?
Same way the PrefabUtility.InstantiatePrefab method does that when used in Unity C# scripts?
I'd appreciate pointing me in the right direction and information if that's doable or do I have to add workaround scripts inside Unity.
Cheers,
ST
HDA instancing prefabs question
2614 2 1- staszek-c
- Member
- 12 posts
- Joined: May 2017
- Offline
- seelan
- Member
- 571 posts
- Joined: May 2017
- Offline
This is because of how you are supplying the input object. The input object in this case has its geometry uploaded into Houdini, processed during cook, and then output as a separate object. As its a separate and new object, there is no prefab connection to the original. To work around this and if you don't need to change the input object, then you can simply use instancing via the asset path name. The simplest way to do this is to output points only and set string attribute with name “unity_instance”.
See attribute info here: https://www.sidefx.com/docs/unity/_instancing.html#ObjectInstancers_Attribute [www.sidefx.com]
If you do need to change the input object and create a new object, then I suggest you break the HDA into 2 HDAs. First one takes in an input object and generates a prefab object. Second one generates points with path to the prefab. This will maintain the prefab link even after baking, as long you always update the same prefab using your first HDA.
See attribute info here: https://www.sidefx.com/docs/unity/_instancing.html#ObjectInstancers_Attribute [www.sidefx.com]
If you do need to change the input object and create a new object, then I suggest you break the HDA into 2 HDAs. First one takes in an input object and generates a prefab object. Second one generates points with path to the prefab. This will maintain the prefab link even after baking, as long you always update the same prefab using your first HDA.
- staszek-c
- Member
- 12 posts
- Joined: May 2017
- Offline
-
- Quick Links