Animators outside of VRC avatar descriptor do not get obfuscated causing them to break
Closed this issue · 9 comments
Hi Esska,
Animators outside of the VRC avatar descriptor do not get obfuscated. This means they will no longer work after obfuscation. The controller/animations inside do not get updated with the obfuscated gameobject paths etc. causing them to show as missing.
A good example of this is with the Among Us prefab by HFCred. It uses its own Animator on a gameobject to make the among us character have running animations etc. After obfuscation this breaks. Would be nice if there was a way for the system to scan the heriachy for all animators and include them in the obfuscation process, thank you <3
Hi SouljaVR
Yes, it should be possible to find all animators in the hiearchy and obfuscate them too. I will add this feature until end of week.
Animators found in hierarchy should be obfuscated now. The parameters in these animators will also be listed in the parameter selection. Can you give me feedback, if it works for you?
This probably happens, when there is an Animator on a GameObject, but no Controller assigned to the Animator. I will add a null check.
Hi Esska - This worked, thank you very much. However it seems in the case of some prefabs the obfuscation still causes things to break. This is being caused by other factors however. You can try this prefab on an avatar to see exactly what I mean, its free and quick to apply:
https://github.com/hfcRed/Among-Us-Follower
It seems the obfuscation specifically breaks the cull detection which a few prefabs rely on to work correctly. I have noticed that the 'Avatar'/armature of any nested Animator components does not get obfuscated. This causes any animations targeting the humanoid movement of the follower to break.
Also on the prefab there is a 'Run' gameobject with an animator on it. This aniamtor turns on/off depending if the follower is moving or not based on cull detection and an animated behaviour on the 'Idle' gameobject. It seems this behaviour breaks too but I am not sure why exactly. Basically this all means the follower mostly works, however the walking animations etc. of the follower break completely. Sorry I cannot be of more help.
Hi SouljaVR
I forgot to obfuscate the avatar on these additional animators - I have to check, if this can be obfuscated too.
In meantime, I installed the among us follower package and after obfuscation, the walk animation breaks for me too. For the default astronaut, the avatar is missing:
As I can see on your screenshot, you have probably a custom model and a custom avatar. Theoretically, this should work after the avatar is obfuscated too.
After some deeper analysis, my conclusion is that it is a bad idea to allow obfuscation of sub animators. Especially when they have a similar structure to the main avatar. In an animation clip, all is referenced as a path relative to its animator (Armature/Hips/Spine...). During obfuscation, I have to find the obfuscated path of it. But now, they can be many and in the animation, you have no reference to the animator in which this clip runs (it could be also many, if there are more than one among us follower). Technically, it is not imposible to solve thia problem, but it would need a redesign of the tool, which I wont not do.
I will rollback this feature and add a error message to the user, that an avatar can not be obfuscated, if it has sub animators on it.
As workaround, you could obfuscate the among us follower separately and make a prefab of it. Then drop this obfuscated prefab into the obfuscated avatar.
The rollback is done and a new error message appears, when an animator is found below hierarchy.
I tried also a workaround:
Add an empty game object to you avatar and toggle it with an animation, when needed. Obfuscate the avatar without among us follower inside it. After, put the among us follower prefab into that obfuscated empty game object. This way, you can still toggle it. This setup works without any issues.
I tried to obfuscate the among us follower itself. This is impossible, because you need am avatar descriptor and one animator on the root game object. Instead I added an avatar descriptor and obfuscator component to the "Run" gameobject. This part can be obfuscated and reintegrated into the unpacked rest. The first obfuscated game object can be renamed to "Run" again (remove the original before). This setup can then be used for a new prefab, which can be added the same way descriped on top.
But also with this solution, the walking animation breaks. In the animators, there will be a constant switch between "Run On" and "Run Off". And this is the part where I do not anymore understand, how this cull detection exacly works. So, I have no solution for this.
In my opinion - it's a public and free prefab. Keeping it not obfuscated should probably be ok.
Thank you so much for the detailed explanation and your work Ess-ka, makes sense to me!