Skip to content

Commit

Permalink
hack: null check AvatarDescriptors before ndmf is aware of environments
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikoga committed Dec 30, 2023
1 parent 494a753 commit d78e97d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Editor/Animation/AnimationDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ internal void OnActivate(ndmf.BuildContext context)
#if MA_VRCSDK3_AVATARS
var avatarDescriptor = context.AvatarDescriptor;

if (!avatarDescriptor) return;

foreach (var layer in avatarDescriptor.baseAnimationLayers)
{
BootstrapLayer(layer);
Expand Down
7 changes: 5 additions & 2 deletions Editor/Animation/AnimationUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@ internal static void CloneAllControllers(BuildContext context)
// This helps reduce the risk that we'll accidentally modify the original assets.

#if MA_VRCSDK3_AVATARS
context.AvatarDescriptor.baseAnimationLayers =
var avatarDescriptor = context.AvatarDescriptor;
if (!avatarDescriptor) return;

avatarDescriptor.baseAnimationLayers =
CloneLayers(context, context.AvatarDescriptor.baseAnimationLayers);
context.AvatarDescriptor.specialAnimationLayers =
avatarDescriptor.specialAnimationLayers =
CloneLayers(context, context.AvatarDescriptor.specialAnimationLayers);
#endif
}
Expand Down

0 comments on commit d78e97d

Please sign in to comment.