mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-04-11 23:19:00 +08:00
Merge remote-tracking branch 'bd/main' into enhancement/AddSubMenuCreatorModule
# Conflicts: # Packages/nadena.dev.modular-avatar/Editor/Inspector/MenuInstallerEditor.cs
This commit is contained in:
commit
6b96546c0e
@ -94,7 +94,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
_bindingMappings[srcBinding] = dstBindings;
|
||||
}
|
||||
|
||||
dstBindings.Add(new SummaryBinding(targetObj, binding.Blendshape));
|
||||
dstBindings.Add(new SummaryBinding(targetObj, binding.LocalBlendshape));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -335,27 +335,6 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool IsMenuReachable(VRCAvatarDescriptor avatar, ModularAvatarSubMenuCreator creator, HashSet<ModularAvatarSubMenuCreator> session)
|
||||
{
|
||||
if (avatar == null) return true;
|
||||
if (this._menuFolderCreators == null) return true;
|
||||
|
||||
if (session.Contains(creator)) return false;
|
||||
if (!this._menuFolderCreators.Contains(creator)) return false;
|
||||
|
||||
if (!creator.enabled) return false;
|
||||
session.Add(creator);
|
||||
switch (creator.installTargetType)
|
||||
{
|
||||
case InstallTargetType.VRCExpressionMenu:
|
||||
return creator.installTargetMenu == null || this.IsMenuReachable(avatar, creator.installTargetMenu);
|
||||
case InstallTargetType.FolderCreator:
|
||||
return creator.installTargetCreator == null || this.IsMenuReachable(avatar, creator.installTargetCreator, session);
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
}
|
||||
|
||||
private static ValidateExpressionMenuIconResult ValidateExpressionMenuIcon(VRCExpressionsMenu menu, HashSet<VRCExpressionsMenu> visitedMenus = null)
|
||||
{
|
||||
|
@ -102,21 +102,27 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
for (int i = 0; i < nSources; i++)
|
||||
{
|
||||
var source = constraint.GetSource(i);
|
||||
if (source.sourceTransform == null) continue;
|
||||
if (!BoneRemappings.TryGetValue(source.sourceTransform, out var remap)) continue;
|
||||
var retarget = BoneDatabase.GetRetargetedBone(remap);
|
||||
|
||||
if (retarget != null)
|
||||
{
|
||||
source.sourceTransform = retarget;
|
||||
}
|
||||
else
|
||||
{
|
||||
source.sourceTransform = remap;
|
||||
}
|
||||
|
||||
source.sourceTransform = MapConstraintSource(source.sourceTransform);
|
||||
constraint.SetSource(i, source);
|
||||
}
|
||||
|
||||
if (constraint is AimConstraint aimConstraint)
|
||||
{
|
||||
aimConstraint.worldUpObject = MapConstraintSource(aimConstraint.worldUpObject);
|
||||
}
|
||||
|
||||
if (constraint is LookAtConstraint lookAtConstraint)
|
||||
{
|
||||
lookAtConstraint.worldUpObject = MapConstraintSource(lookAtConstraint.worldUpObject);
|
||||
}
|
||||
}
|
||||
|
||||
private Transform MapConstraintSource(Transform transform)
|
||||
{
|
||||
if (transform == null) return null;
|
||||
if (!BoneRemappings.TryGetValue(transform, out var remap)) return transform;
|
||||
var retarget = BoneDatabase.GetRetargetedBone(remap);
|
||||
return retarget != null ? retarget : remap;
|
||||
}
|
||||
|
||||
private void UpdateBoneReferences(Component c, Retargetable retargetable = Retargetable.Disable)
|
||||
@ -321,6 +327,9 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
transformPath = RuntimeUtil.AvatarRootPath(newParent),
|
||||
path = srcPath
|
||||
});
|
||||
// The new merged leaf (if it's retained below) can break parent bone physbones. Add a PB Blocker
|
||||
// to prevent this becoming an issue.
|
||||
mergedSrcBone.GetOrAddComponent<ModularAvatarPBBlocker>();
|
||||
}
|
||||
|
||||
BoneRemappings[src.transform] = mergedSrcBone.transform;
|
||||
@ -397,4 +406,4 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "2.2.0",
|
||||
"@tsconfig/docusaurus": "^1.0.5",
|
||||
"typescript": "^4.8.4"
|
||||
"typescript": "^4.9.4"
|
||||
},
|
||||
"resolutions": {
|
||||
"trim": "1.0.1",
|
||||
|
@ -7039,10 +7039,10 @@ typedarray-to-buffer@^3.1.5:
|
||||
dependencies:
|
||||
is-typedarray "^1.0.0"
|
||||
|
||||
typescript@^4.8.4:
|
||||
version "4.9.3"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.3.tgz#3aea307c1746b8c384435d8ac36b8a2e580d85db"
|
||||
integrity sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==
|
||||
typescript@^4.9.4:
|
||||
version "4.9.4"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78"
|
||||
integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==
|
||||
|
||||
ua-parser-js@^0.7.30:
|
||||
version "0.7.32"
|
||||
|
Loading…
x
Reference in New Issue
Block a user