mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-02-01 03:02:56 +08:00
fix: NPE in blendshape sync editor
This commit is contained in:
parent
21b45935a2
commit
2a8c2ec3ce
@ -126,17 +126,26 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
{
|
||||
EditorGUI.PropertyField(meshFieldRect, mesh, GUIContent.none);
|
||||
|
||||
var sourceMesh =
|
||||
(targets.Length == 1 ? target as ModularAvatarBlendshapeSync : null)?.Bindings[index]
|
||||
.ReferenceMesh.Get((Component) target)
|
||||
?.GetComponent<SkinnedMeshRenderer>()
|
||||
?.sharedMesh;
|
||||
DrawBlendshapePopup(sourceMesh, baseShapeNameRect, sourceBlendshape);
|
||||
Mesh sourceMesh = null, localMesh = null;
|
||||
if (targets.Length == 1)
|
||||
{
|
||||
var targetMeshObject = (target as ModularAvatarBlendshapeSync)
|
||||
?.Bindings[index]
|
||||
.ReferenceMesh
|
||||
?.Get((Component) target);
|
||||
if (targetMeshObject != null)
|
||||
{
|
||||
sourceMesh = targetMeshObject.GetComponent<SkinnedMeshRenderer>()
|
||||
?.sharedMesh;
|
||||
}
|
||||
|
||||
var localMesh =
|
||||
(targets.Length == 1 ? target as ModularAvatarBlendshapeSync : null)?
|
||||
.GetComponent<SkinnedMeshRenderer>()
|
||||
?.sharedMesh;
|
||||
localMesh =
|
||||
(target as ModularAvatarBlendshapeSync)
|
||||
?.GetComponent<SkinnedMeshRenderer>()
|
||||
?.sharedMesh;
|
||||
}
|
||||
|
||||
DrawBlendshapePopup(sourceMesh, baseShapeNameRect, sourceBlendshape);
|
||||
|
||||
DrawBlendshapePopup(localMesh, targetShapeNameRect, localBlendshape, sourceBlendshape.stringValue);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user