mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-04-12 23:48:59 +08:00
Merge 88ee50977b4ee571c906ef2e9aecefb29cd6ca73 into 07b648dcc1256ed490356e2e4cebe976555f98ba
This commit is contained in:
commit
aeae448eca
@ -159,6 +159,8 @@ namespace nadena.dev.modular_avatar.animation
|
|||||||
#if MA_VRCSDK3_AVATARS
|
#if MA_VRCSDK3_AVATARS
|
||||||
var avatarDescriptor = context.AvatarDescriptor;
|
var avatarDescriptor = context.AvatarDescriptor;
|
||||||
|
|
||||||
|
if (!avatarDescriptor) return;
|
||||||
|
|
||||||
foreach (var layer in avatarDescriptor.baseAnimationLayers)
|
foreach (var layer in avatarDescriptor.baseAnimationLayers)
|
||||||
{
|
{
|
||||||
BootstrapLayer(layer);
|
BootstrapLayer(layer);
|
||||||
|
@ -53,9 +53,12 @@ namespace nadena.dev.modular_avatar.animation
|
|||||||
// This helps reduce the risk that we'll accidentally modify the original assets.
|
// This helps reduce the risk that we'll accidentally modify the original assets.
|
||||||
|
|
||||||
#if MA_VRCSDK3_AVATARS
|
#if MA_VRCSDK3_AVATARS
|
||||||
context.AvatarDescriptor.baseAnimationLayers =
|
var avatarDescriptor = context.AvatarDescriptor;
|
||||||
|
if (!avatarDescriptor) return;
|
||||||
|
|
||||||
|
avatarDescriptor.baseAnimationLayers =
|
||||||
CloneLayers(context, context.AvatarDescriptor.baseAnimationLayers);
|
CloneLayers(context, context.AvatarDescriptor.baseAnimationLayers);
|
||||||
context.AvatarDescriptor.specialAnimationLayers =
|
avatarDescriptor.specialAnimationLayers =
|
||||||
CloneLayers(context, context.AvatarDescriptor.specialAnimationLayers);
|
CloneLayers(context, context.AvatarDescriptor.specialAnimationLayers);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,8 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
|
|
||||||
internal static void FixupExpressionsMenu(BuildContext context)
|
internal static void FixupExpressionsMenu(BuildContext context)
|
||||||
{
|
{
|
||||||
|
if (!context.AvatarDescriptor) return;
|
||||||
|
|
||||||
context.AvatarDescriptor.customExpressions = true;
|
context.AvatarDescriptor.customExpressions = true;
|
||||||
|
|
||||||
var expressionsMenu = context.AvatarDescriptor.expressionsMenu;
|
var expressionsMenu = context.AvatarDescriptor.expressionsMenu;
|
||||||
|
@ -65,6 +65,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
mergeSessions.Clear();
|
mergeSessions.Clear();
|
||||||
|
|
||||||
var descriptor = avatarGameObject.GetComponent<VRCAvatarDescriptor>();
|
var descriptor = avatarGameObject.GetComponent<VRCAvatarDescriptor>();
|
||||||
|
if (!descriptor) return;
|
||||||
|
|
||||||
if (descriptor.baseAnimationLayers != null) InitSessions(descriptor.baseAnimationLayers);
|
if (descriptor.baseAnimationLayers != null) InitSessions(descriptor.baseAnimationLayers);
|
||||||
if (descriptor.specialAnimationLayers != null) InitSessions(descriptor.specialAnimationLayers);
|
if (descriptor.specialAnimationLayers != null) InitSessions(descriptor.specialAnimationLayers);
|
||||||
|
@ -36,6 +36,15 @@ using nadena.dev.modular_avatar.editor.ErrorReporting;
|
|||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Animations;
|
using UnityEngine.Animations;
|
||||||
|
|
||||||
|
#if MA_VRM0
|
||||||
|
using VRM;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if MA_VRM1
|
||||||
|
using UniVRM10;
|
||||||
|
#endif
|
||||||
|
|
||||||
using Object = UnityEngine.Object;
|
using Object = UnityEngine.Object;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -112,6 +121,35 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
RetainBoneReferences(c);
|
RetainBoneReferences(c);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if MA_VRM0
|
||||||
|
foreach (var c in avatarGameObject.transform.GetComponentsInChildren<VRMSpringBone>(true))
|
||||||
|
{
|
||||||
|
RetainBoneReferences(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var c in avatarGameObject.transform.GetComponentsInChildren<VRMSpringBoneColliderGroup>(true))
|
||||||
|
{
|
||||||
|
RetainBoneReferences(c);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if MA_VRM1
|
||||||
|
foreach (var c in avatarGameObject.transform.GetComponentsInChildren<VRM10SpringBoneJoint>(true))
|
||||||
|
{
|
||||||
|
RetainBoneReferences(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var c in avatarGameObject.transform.GetComponentsInChildren<VRM10SpringBoneCollider>(true))
|
||||||
|
{
|
||||||
|
RetainBoneReferences(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var c in avatarGameObject.transform.GetComponentsInChildren<VRM10SpringBoneColliderGroup>(true))
|
||||||
|
{
|
||||||
|
RetainBoneReferences(c);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
foreach (var c in avatarGameObject.transform.GetComponentsInChildren<IConstraint>(true))
|
foreach (var c in avatarGameObject.transform.GetComponentsInChildren<IConstraint>(true))
|
||||||
{
|
{
|
||||||
RetainBoneReferences(c as Component);
|
RetainBoneReferences(c as Component);
|
||||||
@ -480,5 +518,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// TODO - deduplicate VRM0/1 SpringBone components... doesn't break avatars either
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -7,6 +7,10 @@ using Object = UnityEngine.Object;
|
|||||||
using VRC.SDK3.Dynamics.PhysBone.Components;
|
using VRC.SDK3.Dynamics.PhysBone.Components;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if MA_VRM0
|
||||||
|
using VRM;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace nadena.dev.modular_avatar.core.editor
|
namespace nadena.dev.modular_avatar.core.editor
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -66,6 +70,13 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if MA_VRM0
|
||||||
|
case VRMSpringBone sb:
|
||||||
|
MarkObject(obj);
|
||||||
|
MarkSpringBone(sb);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case AvatarTagComponent _:
|
case AvatarTagComponent _:
|
||||||
// Tag components will not be retained at runtime, so pretend they're not there.
|
// Tag components will not be retained at runtime, so pretend they're not there.
|
||||||
break;
|
break;
|
||||||
@ -147,6 +158,22 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if MA_VRM0
|
||||||
|
private void MarkSpringBone(VRMSpringBone sb)
|
||||||
|
{
|
||||||
|
foreach (var rootBone in sb.RootBones)
|
||||||
|
{
|
||||||
|
foreach (var obj in GameObjects(rootBone.gameObject))
|
||||||
|
{
|
||||||
|
MarkObject(obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mark etc
|
||||||
|
MarkAllReferencedObjects(sb);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
private void MarkAllReferencedObjects(Component component)
|
private void MarkAllReferencedObjects(Component component)
|
||||||
{
|
{
|
||||||
var so = new SerializedObject(component);
|
var so = new SerializedObject(component);
|
||||||
|
@ -9,6 +9,8 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
{
|
{
|
||||||
protected override void Execute(ndmf.BuildContext context)
|
protected override void Execute(ndmf.BuildContext context)
|
||||||
{
|
{
|
||||||
|
if (!context.AvatarDescriptor) return;
|
||||||
|
|
||||||
var expParams = context.AvatarDescriptor.expressionParameters;
|
var expParams = context.AvatarDescriptor.expressionParameters;
|
||||||
if (expParams != null && context.IsTemporaryAsset(expParams))
|
if (expParams != null && context.IsTemporaryAsset(expParams))
|
||||||
{
|
{
|
||||||
|
@ -182,6 +182,8 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
.ToImmutableDictionary();
|
.ToImmutableDictionary();
|
||||||
|
|
||||||
var avatar = avatarRoot.GetComponent<VRCAvatarDescriptor>();
|
var avatar = avatarRoot.GetComponent<VRCAvatarDescriptor>();
|
||||||
|
if (!avatar) return;
|
||||||
|
|
||||||
var expParams = avatar.expressionParameters;
|
var expParams = avatar.expressionParameters;
|
||||||
|
|
||||||
if (expParams == null)
|
if (expParams == null)
|
||||||
|
@ -7,6 +7,9 @@
|
|||||||
"VRC.SDKBase",
|
"VRC.SDKBase",
|
||||||
"nadena.dev.ndmf",
|
"nadena.dev.ndmf",
|
||||||
"nadena.dev.ndmf.vrchat",
|
"nadena.dev.ndmf.vrchat",
|
||||||
|
"VRM",
|
||||||
|
"VRM10",
|
||||||
|
"nadena.dev.ndmf.reactive-query.core",
|
||||||
"nadena.dev.ndmf.runtime",
|
"nadena.dev.ndmf.runtime",
|
||||||
"VRC.SDK3A.Editor",
|
"VRC.SDK3A.Editor",
|
||||||
"Unity.Burst"
|
"Unity.Burst"
|
||||||
@ -44,6 +47,16 @@
|
|||||||
"expression": "",
|
"expression": "",
|
||||||
"define": "MA_VRCSDK3_AVATARS"
|
"define": "MA_VRCSDK3_AVATARS"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "com.vrmc.univrm",
|
||||||
|
"expression": "",
|
||||||
|
"define": "MA_VRM0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "com.vrmc.vrm",
|
||||||
|
"expression": "",
|
||||||
|
"define": "MA_VRM1"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "com.vrchat.avatars",
|
"name": "com.vrchat.avatars",
|
||||||
"expression": "3.5.2",
|
"expression": "3.5.2",
|
||||||
|
@ -1,59 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "nadena.dev.modular-avatar.core.editor",
|
|
||||||
"rootNamespace": "",
|
|
||||||
"references": [
|
|
||||||
"nadena.dev.modular-avatar.core",
|
|
||||||
"VRC.SDK3A",
|
|
||||||
"VRC.SDKBase",
|
|
||||||
"nadena.dev.ndmf",
|
|
||||||
"nadena.dev.ndmf.vrchat",
|
|
||||||
"nadena.dev.ndmf.runtime",
|
|
||||||
"VRC.SDK3A.Editor",
|
|
||||||
"Unity.Burst"
|
|
||||||
],
|
|
||||||
"includePlatforms": [
|
|
||||||
"Editor"
|
|
||||||
],
|
|
||||||
"excludePlatforms": [],
|
|
||||||
"allowUnsafeCode": false,
|
|
||||||
"overrideReferences": true,
|
|
||||||
"precompiledReferences": [
|
|
||||||
"Newtonsoft.Json.dll",
|
|
||||||
"System.Collections.Immutable.dll",
|
|
||||||
"VRCSDKBase.dll",
|
|
||||||
"VRCSDKBase-Editor.dll",
|
|
||||||
"VRCSDK3A.dll",
|
|
||||||
"VRCSDK3A-Editor.dll",
|
|
||||||
"VRC.Dynamics.dll",
|
|
||||||
"VRC.SDK3.Dynamics.Contact.dll",
|
|
||||||
"VRC.SDK3.Dynamics.Contact.Editor.dll",
|
|
||||||
"VRC.SDK3.Dynamics.PhysBone.dll",
|
|
||||||
"VRC.SDK3.Dynamics.PhysBone.Editor.dll",
|
|
||||||
"VRCCore-Editor.dll"
|
|
||||||
],
|
|
||||||
"autoReferenced": false,
|
|
||||||
"defineConstraints": [],
|
|
||||||
"versionDefines": [
|
|
||||||
{
|
|
||||||
"name": "com.anatawa12.avatar-optimizer",
|
|
||||||
"expression": "(,1.5.0-rc.8)",
|
|
||||||
"define": "LEGACY_AVATAR_OPTIMIZER"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "com.vrchat.avatars",
|
|
||||||
"expression": "",
|
|
||||||
"define": "MA_VRCSDK3_AVATARS"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "com.vrchat.avatars",
|
|
||||||
"expression": "3.5.2",
|
|
||||||
"define": "MA_VRCSDK3_AVATARS_3_5_2_OR_NEWER"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "com.vrchat.avatars",
|
|
||||||
"expression": "3.7.0-beta.2",
|
|
||||||
"define": "MA_VRCSDK3_AVATARS_3_7_0_OR_NEWER"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"noEngineReferences": false
|
|
||||||
}
|
|
@ -24,6 +24,16 @@
|
|||||||
"name": "com.vrchat.avatars",
|
"name": "com.vrchat.avatars",
|
||||||
"expression": "",
|
"expression": "",
|
||||||
"define": "MA_VRCSDK3_AVATARS"
|
"define": "MA_VRCSDK3_AVATARS"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "com.vrmc.univrm",
|
||||||
|
"expression": "",
|
||||||
|
"define": "MA_VRM0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "com.vrmc.vrm",
|
||||||
|
"expression": "",
|
||||||
|
"define": "MA_VRM1"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"noEngineReferences": false
|
"noEngineReferences": false
|
||||||
|
@ -31,6 +31,16 @@
|
|||||||
"expression": "",
|
"expression": "",
|
||||||
"define": "MA_VRCSDK3_AVATARS"
|
"define": "MA_VRCSDK3_AVATARS"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "com.vrmc.univrm",
|
||||||
|
"expression": "",
|
||||||
|
"define": "MA_VRM0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "com.vrmc.vrm",
|
||||||
|
"expression": "",
|
||||||
|
"define": "MA_VRM1"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "com.vrchat.avatars",
|
"name": "com.vrchat.avatars",
|
||||||
"expression": "3.5.2",
|
"expression": "3.5.2",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user