mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-02-08 06:42:47 +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);
|
EditorGUI.PropertyField(meshFieldRect, mesh, GUIContent.none);
|
||||||
|
|
||||||
var sourceMesh =
|
Mesh sourceMesh = null, localMesh = null;
|
||||||
(targets.Length == 1 ? target as ModularAvatarBlendshapeSync : null)?.Bindings[index]
|
if (targets.Length == 1)
|
||||||
.ReferenceMesh.Get((Component) target)
|
{
|
||||||
?.GetComponent<SkinnedMeshRenderer>()
|
var targetMeshObject = (target as ModularAvatarBlendshapeSync)
|
||||||
?.sharedMesh;
|
?.Bindings[index]
|
||||||
DrawBlendshapePopup(sourceMesh, baseShapeNameRect, sourceBlendshape);
|
.ReferenceMesh
|
||||||
|
?.Get((Component) target);
|
||||||
|
if (targetMeshObject != null)
|
||||||
|
{
|
||||||
|
sourceMesh = targetMeshObject.GetComponent<SkinnedMeshRenderer>()
|
||||||
|
?.sharedMesh;
|
||||||
|
}
|
||||||
|
|
||||||
var localMesh =
|
localMesh =
|
||||||
(targets.Length == 1 ? target as ModularAvatarBlendshapeSync : null)?
|
(target as ModularAvatarBlendshapeSync)
|
||||||
.GetComponent<SkinnedMeshRenderer>()
|
?.GetComponent<SkinnedMeshRenderer>()
|
||||||
?.sharedMesh;
|
?.sharedMesh;
|
||||||
|
}
|
||||||
|
|
||||||
|
DrawBlendshapePopup(sourceMesh, baseShapeNameRect, sourceBlendshape);
|
||||||
|
|
||||||
DrawBlendshapePopup(localMesh, targetShapeNameRect, localBlendshape, sourceBlendshape.stringValue);
|
DrawBlendshapePopup(localMesh, targetShapeNameRect, localBlendshape, sourceBlendshape.stringValue);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user