mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-20 01:37:59 -05:00
fix importer / exporter
This commit is contained in:
parent
64c73b7f8c
commit
cc304f3b90
|
|
@ -0,0 +1,18 @@
|
|||
namespace UniVRM10
|
||||
{
|
||||
public static class Vrm10ConstraintUtil
|
||||
{
|
||||
/// <summary>
|
||||
/// 右手系と左手系を相互に変換する
|
||||
/// </summary>
|
||||
public static UniGLTF.Extensions.VRMC_node_constraint.AimAxis ReverseX(UniGLTF.Extensions.VRMC_node_constraint.AimAxis src)
|
||||
{
|
||||
switch (src)
|
||||
{
|
||||
case UniGLTF.Extensions.VRMC_node_constraint.AimAxis.PositiveX: return UniGLTF.Extensions.VRMC_node_constraint.AimAxis.NegativeX;
|
||||
case UniGLTF.Extensions.VRMC_node_constraint.AimAxis.NegativeX: return UniGLTF.Extensions.VRMC_node_constraint.AimAxis.PositiveX;
|
||||
default: return src;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e2c7b76ebe42e9543ac52153ea9f2728
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -430,7 +430,7 @@ namespace UniVRM10
|
|||
{
|
||||
Source = model.Nodes.IndexOf(converter.Nodes[aimConstraint.Source.gameObject]),
|
||||
Weight = aimConstraint.Weight,
|
||||
AimAxis = aimConstraint.AimAxis,
|
||||
AimAxis = Vrm10ConstraintUtil.ReverseX(aimConstraint.AimAxis),
|
||||
};
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -701,7 +701,7 @@ namespace UniVRM10
|
|||
var component = node.gameObject.AddComponent<Vrm10AimConstraint>();
|
||||
component.Source = Nodes[aim.Source.Value]; // required
|
||||
component.Weight = aim.Weight.GetValueOrDefault(1.0f);
|
||||
component.AimAxis = aim.AimAxis; // required
|
||||
component.AimAxis = Vrm10ConstraintUtil.ReverseX(aim.AimAxis); // required
|
||||
}
|
||||
else if (constraint.Rotation != null)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user