Hello!
I'm currently finishing the model and Baked as Optimized (I just skipped the regular Bake and just when directly on the Optimized), not sure if that's actually relevant, but after testing out the character in-game, I tried to get back to the AP Editor and started getting this error when I try to load it:
NullReferenceException: Object reference not set to an instance of an object
AnyPortrait.apAnimTimelineLayer.Link (AnyPortrait.apAnimClip animClip, AnyPortrait.apAnimTimeline timeline) (at Assets/AnyPortrait/Assets/Scripts/Animation/apAnimTimelineLayer.cs:222)
AnyPortrait.apAnimTimeline.Link (AnyPortrait.apAnimClip animClip) (at Assets/AnyPortrait/Assets/Scripts/Animation/apAnimTimeline.cs:145)
AnyPortrait.apAnimClip.LinkEditor (AnyPortrait.apPortrait portrait) (at Assets/AnyPortrait/Assets/Scripts/BasicObjects/apAnimClip.cs:242)
AnyPortrait.apPortrait.LinkAndRefreshInEditor (System.Boolean isResetLink, AnyPortrait.apUtil+LinkRefreshRequest linkRefreshRequest) (at Assets/AnyPortrait/Assets/Scripts/apPortrait.cs:8335)
AnyPortrait.apMeshGroup.ResetRenderUnits (AnyPortrait.apUtil+LinkRefreshRequest linkRefreshRequest) (at Assets/AnyPortrait/Assets/Scripts/BasicObjects/apMeshGroup.cs:1216)
AnyPortrait.apMeshGroup.UpdateAllRenderUnits (System.Single tDelta, System.Boolean isUpdateVertAlways, System.Boolean isDepthChanged, AnyPortrait.apUtil+LinkRefreshRequest linkRefreshRequest) (at Assets/AnyPortrait/Assets/Scripts/BasicObjects/apMeshGroup.cs:399)
AnyPortrait.apMeshGroup.RefreshForce (System.Boolean isDepthChanged, System.Single tDelta, AnyPortrait.apUtil+LinkRefreshRequest linkRefreshRequest) (at Assets/AnyPortrait/Assets/Scripts/BasicObjects/apMeshGroup.cs:367)
AnyPortrait.apPortrait.ReadyToEdit_Step6 () (at Assets/AnyPortrait/Assets/Scripts/apPortrait.cs:7108)
AnyPortrait.apEditor+<Crt_LoadingPortraitAsync>d__750.MoveNext () (at Assets/AnyPortrait/Editor/Scripts/apEditor.cs:14748)
AnyPortrait.apEditor.ExecuteCoroutine_LoadingPortraitAsync () (at Assets/AnyPortrait/Editor/Scripts/apEditor.cs:14685)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <4e64905d831f4883a53259ef37fb023b>:0)
I was able to load the backup but and after restarting the Unity, I managed to load the character but it deleted the main Mesh Group, so it's all gone haha I'm still able to use the backup file as I didn't lost much, just wanted to bring this to you guys attention.
I'm currently using Unity 2021.3.11f and AP version 1.41
Thanks for your time!
Hi!
We leave this comment because there are improvements related to this problem in the updated AnyPortrait v1.4.2.
We haven't been able to pinpoint the cause of this issue, but we've improved the editor's code to handle similar errors if they occur for any reason.
Details on the latest version can be found on this page:
Thanks!
Hi!
First of all, we are very sorry for any inconvenience this issue has caused you.
We have confirmed that this issue occurs when opening a character with the editor while the connection between the Animation Clip and the Mesh Group is broken.
However, it was not possible to determine whether it was caused by Optimized Bake or by some other action.
We tried Optimized Bake, but as we expected, it had no effect.
It is believed that an undo or some other action, such as creating a Prefab, deleting, or restoring process was causing the problem, but we were unable to pinpoint the exact cause as we were unable to reproduce the problem.
There are so many cases that cause this or similar problems, it will not be easy for us to fix.
Nevertheless, we will improve the code so that it can operate safely for problems related to data connection as in this case.
And if we pinpoint the cause of this problem, our team will fix it as well.
Once again, we deeply apologize for the inconvenience caused to you.
Also, thank you so much for reporting the problem to us in detail.
If you encounter similar issues again, please feel free to let us know.
Thank you.