mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-04 13:45:04 +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
|
namespace nadena.dev.modular_avatar.core
|
||||||
{
|
{
|
||||||
[ExecuteInEditMode]
|
[ExecuteInEditMode]
|
||||||
//[AddComponentMenu("")]
|
[AddComponentMenu("")]
|
||||||
[RequireComponent(typeof(SkinnedMeshRenderer))]
|
[RequireComponent(typeof(SkinnedMeshRenderer))]
|
||||||
internal class ScaleAdjusterRenderer : MonoBehaviour, IEditorOnly
|
internal class ScaleAdjusterRenderer : MonoBehaviour, IEditorOnly
|
||||||
{
|
{
|
||||||
@ -120,11 +120,14 @@ namespace nadena.dev.modular_avatar.core
|
|||||||
myRenderer.motionVectorGenerationMode = parentRenderer.motionVectorGenerationMode;
|
myRenderer.motionVectorGenerationMode = parentRenderer.motionVectorGenerationMode;
|
||||||
myRenderer.allowOcclusionWhenDynamic = parentRenderer.allowOcclusionWhenDynamic;
|
myRenderer.allowOcclusionWhenDynamic = parentRenderer.allowOcclusionWhenDynamic;
|
||||||
|
|
||||||
var blendShapeCount = myRenderer.sharedMesh.blendShapeCount;
|
if (myRenderer.sharedMesh != null)
|
||||||
|
|
||||||
for (int i = 0; i < blendShapeCount; i++)
|
|
||||||
{
|
{
|
||||||
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();
|
ClearAllOverrides();
|
||||||
|
Loading…
Reference in New Issue
Block a user