PeteNics Posted June 10, 2021 Share Posted June 10, 2021 (edited) Hi. I'm making a tool that uses alot of instancing to assemble a level in Unity. I've come up against some issues with the way Houdini engine overrides lots of properties on each instance that you may not want. You can control a few overrides via the Unity attributes but lots of other attributes will also be overridden. Instead I found it better to revert all the overrides that occur with the instancing so that each prefab can be set correctly upfront. To do this I attach a script via the Unity script attribute which looks a bit like this: private void GetInstancedOverrides() { InstancedObjs.Clear(); foreach (var childTransform in GetComponentsInChildren<Transform>()) { if (childTransform.gameObject.name.Contains("Instance")) { InstancedObjs.Add(childTransform); } } FixedInstancedOverrides(); } private void FixedInstancedOverrides() { foreach (var childTransform in InstancedObjs) { #if UNITY_EDITOR PrefabUtility.RevertPrefabInstance(childTransform.gameObject, InteractionMode.UserAction); #endif } Debug.Log("Fixup fired"); } The issue is this fires to early and breaks rebuilds or recooking of the HDA. i used editor coroutines to delay running these functions which does work but I wanted to ask if there was a good way to latch onto the event of the HDA to say the cook or rebuild had finished? Edited June 10, 2021 by PeteNics Can i get this moved to the Games area instead of the Tools please i feel it is more appropriate there Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.