Merge pull request #1624 from ousttrue/fix10/constraint_nullable

constraint の nullable 項目のインポート対応。
This commit is contained in:
ousttrue 2022-04-21 13:37:52 +09:00 committed by GitHub
commit 0eb7259dc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -686,24 +686,24 @@ namespace UniVRM10
{
var roll = constraint.Roll;
var component = node.gameObject.AddComponent<Vrm10RollConstraint>();
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<Vrm10AimConstraint>();
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<Vrm10RotationConstraint>();
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
{