mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-04-04 19:49:02 +08:00
fix: compiler warnings
This commit is contained in:
parent
34deac5681
commit
afafb982c8
@ -63,10 +63,12 @@ namespace nadena.dev.modular_avatar.animation
|
|||||||
|
|
||||||
foreach (var layer in fx.Layers)
|
foreach (var layer in fx.Layers)
|
||||||
{
|
{
|
||||||
|
if (layer.StateMachine == null) continue;
|
||||||
|
|
||||||
var rootMMDModeBehaviors = layer.StateMachine.Behaviours
|
var rootMMDModeBehaviors = layer.StateMachine.Behaviours
|
||||||
.OfType<ModularAvatarMMDLayerControl>()
|
.OfType<ModularAvatarMMDLayerControl>()
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
if (rootMMDModeBehaviors.Count == 0) continue;
|
if (rootMMDModeBehaviors.Count == 0) continue;
|
||||||
if (rootMMDModeBehaviors.Count > 1)
|
if (rootMMDModeBehaviors.Count > 1)
|
||||||
{
|
{
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#region
|
#region
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using nadena.dev.ndmf;
|
using nadena.dev.ndmf;
|
||||||
using nadena.dev.ndmf.animator;
|
using nadena.dev.ndmf.animator;
|
||||||
@ -9,6 +10,7 @@ using UnityEditor;
|
|||||||
using UnityEditor.Animations;
|
using UnityEditor.Animations;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using VRC.SDK3.Avatars.Components;
|
using VRC.SDK3.Avatars.Components;
|
||||||
|
using Object = UnityEngine.Object;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -83,8 +85,6 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
string basePath = null;
|
|
||||||
|
|
||||||
var rootBlend = GetRootBlendTree();
|
var rootBlend = GetRootBlendTree();
|
||||||
|
|
||||||
rootBlend.Children = rootBlend.Children.Add(new()
|
rootBlend.Children = rootBlend.Children.Add(new()
|
||||||
@ -136,6 +136,10 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
var fx = _asc.ControllerContext.Controllers[VRCAvatarDescriptor.AnimLayerType.FX];
|
var fx = _asc.ControllerContext.Controllers[VRCAvatarDescriptor.AnimLayerType.FX];
|
||||||
var controller = fx.AddLayer(new LayerPriority(int.MinValue), BlendTreeLayerName);
|
var controller = fx.AddLayer(new LayerPriority(int.MinValue), BlendTreeLayerName);
|
||||||
var stateMachine = controller.StateMachine;
|
var stateMachine = controller.StateMachine;
|
||||||
|
if (fx == null)
|
||||||
|
{
|
||||||
|
throw new Exception("FX layer not found");
|
||||||
|
}
|
||||||
|
|
||||||
_rootBlendTree = VirtualBlendTree.Create("Root");
|
_rootBlendTree = VirtualBlendTree.Create("Root");
|
||||||
var state = stateMachine.AddState("State", _rootBlendTree);
|
var state = stateMachine.AddState("State", _rootBlendTree);
|
||||||
|
@ -89,8 +89,8 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
public Task<IRenderFilterNode> Refresh(IEnumerable<(Renderer, Renderer)> proxyPairs, ComputeContext context,
|
public Task<IRenderFilterNode> Refresh(IEnumerable<(Renderer, Renderer)> proxyPairs, ComputeContext context,
|
||||||
RenderAspects updatedAspects)
|
RenderAspects updatedAspects)
|
||||||
{
|
{
|
||||||
if (updatedAspects.HasFlag(RenderAspects.Mesh)) return Task.FromResult<IRenderFilterNode>(null);
|
if (updatedAspects.HasFlag(RenderAspects.Mesh)) return Task.FromResult<IRenderFilterNode>(null!);
|
||||||
if (_theMesh == null) return Task.FromResult<IRenderFilterNode>(null);
|
if (_theMesh == null) return Task.FromResult<IRenderFilterNode>(null!);
|
||||||
|
|
||||||
return Task.FromResult<IRenderFilterNode>(this);
|
return Task.FromResult<IRenderFilterNode>(this);
|
||||||
}
|
}
|
||||||
|
@ -52,13 +52,14 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
|
|
||||||
var constraintGameObjects = context.AvatarRootObject.GetComponentsInChildren<IConstraint>(true)
|
var constraintGameObjects = context.AvatarRootObject.GetComponentsInChildren<IConstraint>(true)
|
||||||
.Select(c => (c as Component)?.gameObject)
|
.Select(c => (c as Component)?.gameObject)
|
||||||
|
.Where(go => go != null)
|
||||||
.Distinct()
|
.Distinct()
|
||||||
.Where(go => go.GetComponentsInParent<ModularAvatarConvertConstraints>(true)
|
.Where(go => go!.GetComponentsInParent<ModularAvatarConvertConstraints>(true)
|
||||||
.Select(c => c.gameObject)
|
.Select(c => c.gameObject)
|
||||||
.Any(converters.Contains)
|
.Any(converters.Contains)
|
||||||
).ToArray();
|
).ToArray();
|
||||||
var targetConstraintComponents =
|
var targetConstraintComponents =
|
||||||
constraintGameObjects.SelectMany(go => go.GetComponents<IConstraint>()).ToArray();
|
constraintGameObjects.SelectMany(go => go!.GetComponents<IConstraint>()).ToArray();
|
||||||
|
|
||||||
AvatarDynamicsSetup.DoConvertUnityConstraints(targetConstraintComponents, null, false);
|
AvatarDynamicsSetup.DoConvertUnityConstraints(targetConstraintComponents, null, false);
|
||||||
|
|
||||||
@ -72,7 +73,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
|
|
||||||
var targetPaths = constraintGameObjects
|
var targetPaths = constraintGameObjects
|
||||||
.Union(existingVRCConstraints)
|
.Union(existingVRCConstraints)
|
||||||
.Select(c => asc.ObjectPathRemapper.GetVirtualPathForObject(c))
|
.Select(c => asc.ObjectPathRemapper.GetVirtualPathForObject(c!))
|
||||||
.ToHashSet();
|
.ToHashSet();
|
||||||
|
|
||||||
// Update animation clips
|
// Update animation clips
|
||||||
|
@ -156,7 +156,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
|
|
||||||
case ModularAvatarMergeBlendTree mergeBlendTree:
|
case ModularAvatarMergeBlendTree mergeBlendTree:
|
||||||
{
|
{
|
||||||
WalkBlendTree(parameters, mergeBlendTree.BlendTree as BlendTree);
|
WalkBlendTree(parameters, mergeBlendTree.Motion as BlendTree);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
using System;
|
#nullable enable
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Object = UnityEngine.Object;
|
using Object = UnityEngine.Object;
|
||||||
@ -34,7 +36,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
TargetProp.Equals(other.TargetProp);
|
TargetProp.Equals(other.TargetProp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object? obj)
|
||||||
{
|
{
|
||||||
if (obj is null) return false;
|
if (obj is null) return false;
|
||||||
if (ReferenceEquals(this, obj)) return true;
|
if (ReferenceEquals(this, obj)) return true;
|
||||||
|
@ -49,7 +49,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
var obj = new GameObject("MA SC Defaults");
|
var obj = new GameObject("MA SC Defaults");
|
||||||
obj.transform.SetParent(context.AvatarRootTransform);
|
obj.transform.SetParent(context.AvatarRootTransform);
|
||||||
var mambt = obj.AddComponent<ModularAvatarMergeBlendTree>();
|
var mambt = obj.AddComponent<ModularAvatarMergeBlendTree>();
|
||||||
mambt.BlendTree = bt;
|
mambt.Motion = bt;
|
||||||
mambt.PathMode = MergeAnimatorPathMode.Absolute;
|
mambt.PathMode = MergeAnimatorPathMode.Absolute;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,8 +16,6 @@ namespace nadena.dev.modular_avatar.core
|
|||||||
[HelpURL("https://modular-avatar.nadena.dev/docs/reference/move-independently?lang=auto")]
|
[HelpURL("https://modular-avatar.nadena.dev/docs/reference/move-independently?lang=auto")]
|
||||||
class MAMoveIndependently : MonoBehaviour, IEditorOnly
|
class MAMoveIndependently : MonoBehaviour, IEditorOnly
|
||||||
{
|
{
|
||||||
private float EPSILON = 0.0000001f;
|
|
||||||
|
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private GameObject[] m_groupedBones;
|
private GameObject[] m_groupedBones;
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ namespace nadena.dev.modular_avatar.core
|
|||||||
set => animator = value;
|
set => animator = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
string IVirtualizeAnimatorController.GetMotionBasePath(object ndmfBuildContext, bool clearPath = true)
|
string IVirtualizeAnimatorController.GetMotionBasePath(object ndmfBuildContext, bool clearPath)
|
||||||
{
|
{
|
||||||
var path = GetMotionBasePathCallback(this, ndmfBuildContext);
|
var path = GetMotionBasePathCallback(this, ndmfBuildContext);
|
||||||
if (clearPath) pathMode = MergeAnimatorPathMode.Absolute;
|
if (clearPath) pathMode = MergeAnimatorPathMode.Absolute;
|
||||||
|
@ -39,11 +39,13 @@ namespace nadena.dev.modular_avatar.core
|
|||||||
|
|
||||||
Motion IVirtualizeMotion.Motion
|
Motion IVirtualizeMotion.Motion
|
||||||
{
|
{
|
||||||
|
#pragma warning disable CS0618 // Type or member is obsolete
|
||||||
get => (Motion)BlendTree;
|
get => (Motion)BlendTree;
|
||||||
set => BlendTree = value;
|
set => BlendTree = value;
|
||||||
|
#pragma warning restore CS0618 // Type or member is obsolete
|
||||||
}
|
}
|
||||||
|
|
||||||
string IVirtualizeMotion.GetMotionBasePath(object ndmfBuildContext, bool clearPath = true)
|
string IVirtualizeMotion.GetMotionBasePath(object ndmfBuildContext, bool clearPath)
|
||||||
{
|
{
|
||||||
var path = GetMotionBasePathCallback(this, ndmfBuildContext);
|
var path = GetMotionBasePathCallback(this, ndmfBuildContext);
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ using UnityEditor.Animations;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using VRC.SDK3.Avatars.Components;
|
using VRC.SDK3.Avatars.Components;
|
||||||
using AvatarProcessor = nadena.dev.ndmf.AvatarProcessor;
|
using AvatarProcessor = nadena.dev.ndmf.AvatarProcessor;
|
||||||
|
#pragma warning disable CS0618 // Type or member is obsolete
|
||||||
|
|
||||||
namespace modular_avatar_tests
|
namespace modular_avatar_tests
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user