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
When I have defined LinearMixerTransition field, add new clips, assign a clip, and then I delete one of those clip assets from project, the asset (in my case scriptable object with LinearMixerTransition field) is broken after selection and inspector for it will no longer work, thus, I cannot even change the destroyed clip or remove it.
Please note, this appears to be issue only when using Odin Inspector, so not sure if it will be possible to still fix this, event though odin is not part of animancer package, it would be nice if we could support it and avoid this issue :)
The text was updated successfully, but these errors were encountered:
Replace the TryGetLength method in ITransitionDetailed.cs with this:
public static bool TryGetLength(object motionOrTransition, out float length)
{
if (motionOrTransition is AnimationClip clip)
{
if (clip != null)
{
length = clip.length;
return true;
}
}
else if (TryGetWrappedObject(motionOrTransition, out ITransitionDetailed transition))
{
length = transition.MaximumDuration;
return true;
}
length = 0;
return false;
}
That first if would still pass if the object is an AnimationClip which has already been destroyed so we need to add an explicit null check to make sure it isn't destroyed.
Same for TryGetIsLooping above it:
public static bool TryGetIsLooping(object motionOrTransition, out bool isLooping)
{
if (motionOrTransition is Motion motion)
{
if (motion != null)
{
isLooping = motion.isLooping;
return true;
}
}
else if (TryGetWrappedObject(motionOrTransition, out ITransitionDetailed transition))
{
isLooping = transition.IsLooping;
return true;
}
isLooping = false;
return false;
}
When I have defined LinearMixerTransition field, add new clips, assign a clip, and then I delete one of those clip assets from project, the asset (in my case scriptable object with LinearMixerTransition field) is broken after selection and inspector for it will no longer work, thus, I cannot even change the destroyed clip or remove it.
Please note, this appears to be issue only when using Odin Inspector, so not sure if it will be possible to still fix this, event though odin is not part of animancer package, it would be nice if we could support it and avoid this issue :)
The text was updated successfully, but these errors were encountered: