mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-29 18:55:06 +08:00
fix(visible-head-accessory): workaround unity crash
Reported-By: Momishiro
This commit is contained in:
parent
d6ab6c676f
commit
85617735e9
@ -165,7 +165,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
new MenuInstallHook().OnPreprocessAvatar(avatarGameObject, context);
|
||||
new MergeArmatureHook().OnPreprocessAvatar(context, avatarGameObject);
|
||||
new BoneProxyProcessor().OnPreprocessAvatar(avatarGameObject);
|
||||
new VisibleHeadAccessoryProcessor(vrcAvatarDescriptor).Process();
|
||||
new VisibleHeadAccessoryProcessor(vrcAvatarDescriptor).Process(context);
|
||||
new RemapAnimationPass(vrcAvatarDescriptor).Process(context.AnimationDatabase);
|
||||
new BlendshapeSyncAnimationProcessor().OnPreprocessAvatar(avatarGameObject, context);
|
||||
PhysboneBlockerPass.Process(avatarGameObject);
|
||||
|
@ -33,14 +33,14 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
return _renderer.bones.Any(_visibleBones.Contains) && _renderer.bones.Any(b => !_visibleBones.Contains(b));
|
||||
}
|
||||
|
||||
public void Retarget()
|
||||
public void Retarget(BuildContext context)
|
||||
{
|
||||
if (!NeedsRetargeting()) return;
|
||||
|
||||
bool anyVisible = false;
|
||||
var originalMesh = _renderer.sharedMesh;
|
||||
var newMesh = Object.Instantiate(originalMesh);
|
||||
AssetDatabase.CreateAsset(newMesh, Util.GenerateAssetPath());
|
||||
context.SaveAsset(newMesh);
|
||||
|
||||
// Identify the manifolds which need to be retargeted. Generally, we define a manifold as the maximal set of
|
||||
// points which are connected by primitives. If this manifold contains both visible and retargeted bones,
|
||||
|
@ -55,7 +55,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
}
|
||||
}
|
||||
|
||||
public void Process()
|
||||
public void Process(BuildContext context)
|
||||
{
|
||||
bool didWork = false;
|
||||
|
||||
@ -70,7 +70,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
// Process meshes
|
||||
foreach (var smr in _avatar.GetComponentsInChildren<SkinnedMeshRenderer>(true))
|
||||
{
|
||||
new VisibleHeadAccessoryMeshProcessor(smr, _visibleBones, _proxyHead).Retarget();
|
||||
new VisibleHeadAccessoryMeshProcessor(smr, _visibleBones, _proxyHead).Retarget(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user