From ce22c6e8edb485027e16cc257df0a646de190fbf Mon Sep 17 00:00:00 2001 From: ousttrue Date: Thu, 21 Apr 2022 12:46:54 +0900 Subject: [PATCH] fix weight nullable --- Assets/VRM10/Runtime/IO/Vrm10Importer.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs index fbb241a5b..45eec0bbc 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs @@ -686,24 +686,24 @@ namespace UniVRM10 { var roll = constraint.Roll; var component = node.gameObject.AddComponent(); - component.Source = Nodes[roll.Source.Value]; - component.Weight = roll.Weight.Value; - component.RollAxis = roll.RollAxis; + component.Source = Nodes[roll.Source.Value]; // required + component.Weight = roll.Weight.GetValueOrDefault(1.0f); + component.RollAxis = roll.RollAxis; // required } else if (constraint.Aim != null) { var aim = constraint.Aim; var component = node.gameObject.AddComponent(); - component.Source = Nodes[aim.Source.Value]; - component.Weight = aim.Weight.Value; - component.AimAxis = aim.AimAxis; + component.Source = Nodes[aim.Source.Value]; // required + component.Weight = aim.Weight.GetValueOrDefault(1.0f); + component.AimAxis = aim.AimAxis; // required } else if (constraint.Rotation != null) { var rotation = constraint.Rotation; var component = node.gameObject.AddComponent(); - component.Source = Nodes[rotation.Source.Value]; - component.Weight = rotation.Weight.Value; + component.Source = Nodes[rotation.Source.Value]; // required + component.Weight = rotation.Weight.GetValueOrDefault(1.0f); } else {