mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-29 18:55:06 +08:00
fix: ScaleAdjuster causes console errors when a mesh is missing (#706)
* fix: ScaleAdjuster causes console errors when a mesh is missing * chore: hide ScaleAdjusterRenderer component
This commit is contained in:
parent
e7b09fd787
commit
e0c8061a8d
@ -11,7 +11,7 @@ using VRC.SDKBase;
|
||||
namespace nadena.dev.modular_avatar.core
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
//[AddComponentMenu("")]
|
||||
[AddComponentMenu("")]
|
||||
[RequireComponent(typeof(SkinnedMeshRenderer))]
|
||||
internal class ScaleAdjusterRenderer : MonoBehaviour, IEditorOnly
|
||||
{
|
||||
@ -120,11 +120,14 @@ namespace nadena.dev.modular_avatar.core
|
||||
myRenderer.motionVectorGenerationMode = parentRenderer.motionVectorGenerationMode;
|
||||
myRenderer.allowOcclusionWhenDynamic = parentRenderer.allowOcclusionWhenDynamic;
|
||||
|
||||
var blendShapeCount = myRenderer.sharedMesh.blendShapeCount;
|
||||
|
||||
for (int i = 0; i < blendShapeCount; i++)
|
||||
if (myRenderer.sharedMesh != null)
|
||||
{
|
||||
myRenderer.SetBlendShapeWeight(i, parentRenderer.GetBlendShapeWeight(i));
|
||||
var blendShapeCount = myRenderer.sharedMesh.blendShapeCount;
|
||||
|
||||
for (int i = 0; i < blendShapeCount; i++)
|
||||
{
|
||||
myRenderer.SetBlendShapeWeight(i, parentRenderer.GetBlendShapeWeight(i));
|
||||
}
|
||||
}
|
||||
|
||||
ClearAllOverrides();
|
||||
|
Loading…
Reference in New Issue
Block a user