You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, I am currently not able to change group overrides from script if multiple assets are loaded (actually I can change override for the first group, but not for later ones). If only one asset is loaded all works without issues. Also it works completely fine in the GUI with multiple assets.
This is how I am doing the override now (maybe there is a better / more correct way?):
List<GroupAssetReference> groupAssetReferences = hairInstance.strandGroupSettings[0].groupAssetReferences;
groupAssetReferences.Clear();
//strandBasedHairProfileOverride.groups stores the groups to be selected to override
foreach (int groupIndex in strandBasedHairProfileOverride.groups)
{
GroupAssetReference groupAssetReference = new GroupAssetReference();
groupAssetReference.hairAssetGroupIndex = groupIndex;
//not sure about this one here: tried both, always assigning the main asset, or assigning the other assets
groupAssetReference.hairAsset = groupIndex==1 && prefab1!=null ? prefab1 : groupIndex==2 && prefab2!=null? prefab2 : prefab0
groupAssetReferences.Add(groupAssetReference);
}
The text was updated successfully, but these errors were encountered:
Hey, I am currently not able to change group overrides from script if multiple assets are loaded (actually I can change override for the first group, but not for later ones). If only one asset is loaded all works without issues. Also it works completely fine in the GUI with multiple assets.
This is how I am doing the override now (maybe there is a better / more correct way?):
The text was updated successfully, but these errors were encountered: