mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-04-25 07:28:51 -05:00
axis の複数形は、axes
not axises
This commit is contained in:
parent
0e9bc3ae7f
commit
22cb1372be
|
|
@ -8,7 +8,7 @@ namespace UniGLTF
|
|||
{
|
||||
public GameObject Root { get; set; }
|
||||
|
||||
public Axises InverseAxis;
|
||||
public Axes InverseAxis;
|
||||
|
||||
[Header("MorphTarget(BlendShape)")]
|
||||
public bool Sparse;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace UniGLTF
|
|||
public class GlbScriptedImporter : ScriptedImporter
|
||||
{
|
||||
[SerializeField]
|
||||
Axises m_reverseAxis;
|
||||
Axes m_reverseAxis;
|
||||
|
||||
public override void OnImportAsset(AssetImportContext ctx)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace UniGLTF
|
|||
public class GltfScriptedImporter : ScriptedImporter
|
||||
{
|
||||
[SerializeField]
|
||||
Axises m_reverseAxis = default;
|
||||
Axes m_reverseAxis = default;
|
||||
|
||||
public override void OnImportAsset(AssetImportContext ctx)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace UniGLTF
|
|||
/// <param name="scriptedImporter"></param>
|
||||
/// <param name="context"></param>
|
||||
/// <param name="reverseAxis"></param>
|
||||
public static void Import(ScriptedImporter scriptedImporter, AssetImportContext context, Axises reverseAxis)
|
||||
public static void Import(ScriptedImporter scriptedImporter, AssetImportContext context, Axes reverseAxis)
|
||||
{
|
||||
#if VRM_DEVELOP
|
||||
Debug.Log("OnImportAsset to " + scriptedImporter.assetPath);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace UniGLTF
|
|||
EditorGUILayout.HelpBox($"Custom editor language setting", MessageType.Info, true);
|
||||
|
||||
// default axis
|
||||
GltfIOAxis = (Axises)EditorGUILayout.EnumPopup("Default Invert axis", GltfIOAxis);
|
||||
GltfIOAxis = (Axes)EditorGUILayout.EnumPopup("Default Invert axis", GltfIOAxis);
|
||||
EditorGUILayout.HelpBox($"Default invert axis when glb/gltf import/export", MessageType.Info, true);
|
||||
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
|
|
@ -26,8 +26,8 @@ namespace UniGLTF
|
|||
}
|
||||
|
||||
const string AXIS_KEY = "UNIGLTF_IO_AXIS";
|
||||
static Axises? s_axis;
|
||||
public static Axises GltfIOAxis
|
||||
static Axes? s_axis;
|
||||
public static Axes GltfIOAxis
|
||||
{
|
||||
set
|
||||
{
|
||||
|
|
@ -38,14 +38,14 @@ namespace UniGLTF
|
|||
{
|
||||
if (!s_axis.HasValue)
|
||||
{
|
||||
var value = EditorPrefs.GetString(AXIS_KEY, default(Axises).ToString());
|
||||
if (Enum.TryParse<Axises>(value, out Axises parsed))
|
||||
var value = EditorPrefs.GetString(AXIS_KEY, default(Axes).ToString());
|
||||
if (Enum.TryParse<Axes>(value, out Axes parsed))
|
||||
{
|
||||
s_axis = parsed;
|
||||
}
|
||||
else
|
||||
{
|
||||
s_axis = default(Axises);
|
||||
s_axis = default(Axes);
|
||||
}
|
||||
}
|
||||
return s_axis.Value;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ using UnityEngine;
|
|||
|
||||
namespace UniGLTF
|
||||
{
|
||||
public enum Axises
|
||||
public enum Axes
|
||||
{
|
||||
Z,
|
||||
X,
|
||||
|
|
@ -65,12 +65,12 @@ namespace UniGLTF
|
|||
|
||||
public static class AxisesExtensions
|
||||
{
|
||||
public static IAxisInverter Create(this Axises axis)
|
||||
public static IAxisInverter Create(this Axes axis)
|
||||
{
|
||||
switch (axis)
|
||||
{
|
||||
case Axises.Z: return new ReverseZ();
|
||||
case Axises.X: return new ReverseX();
|
||||
case Axes.Z: return new ReverseZ();
|
||||
case Axes.X: return new ReverseX();
|
||||
default: throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5b3b7b9629a4da242bacf52f5ca0fd80
|
||||
guid: ec65074bc74907c4580348aa0b159411
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
|
@ -5,6 +5,6 @@ namespace UniGLTF
|
|||
{
|
||||
public interface IAnimationImporter
|
||||
{
|
||||
List<AnimationClip> Import(glTF gltf, GameObject root, List<Transform> nodes, List<AnimationClip> clips, Axises invertAxis);
|
||||
List<AnimationClip> Import(glTF gltf, GameObject root, List<Transform> nodes, List<AnimationClip> clips, Axes invertAxis);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ namespace UniGLTF
|
|||
/// <summary>
|
||||
/// GLTF から Unity に変換するときに反転させる軸
|
||||
/// </summary>
|
||||
public Axises InvertAxis = Axises.Z;
|
||||
public Axes InvertAxis = Axes.Z;
|
||||
|
||||
public static List<string> UnsupportedExtensions = new List<string>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ namespace UniGLTF
|
|||
{
|
||||
public sealed class RootAnimationImporter : IAnimationImporter
|
||||
{
|
||||
public List<AnimationClip> Import(glTF gltf, GameObject root, List<Transform> _nodes, List<AnimationClip> _clips, Axises invertAxis)
|
||||
public List<AnimationClip> Import(glTF gltf, GameObject root, List<Transform> _nodes, List<AnimationClip> _clips, Axes invertAxis)
|
||||
{
|
||||
var animationClips = new List<AnimationClip>();
|
||||
if (gltf.animations != null && gltf.animations.Any())
|
||||
|
|
@ -26,7 +26,7 @@ namespace UniGLTF
|
|||
return animationClips;
|
||||
}
|
||||
|
||||
private IEnumerable<AnimationClip> ImportAnimationClips(glTF gltf, Axises invertAxis)
|
||||
private IEnumerable<AnimationClip> ImportAnimationClips(glTF gltf, Axes invertAxis)
|
||||
{
|
||||
for (var i = 0; i < gltf.animations.Count; ++i)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ namespace UniGLTF
|
|||
|
||||
IAxisInverter m_axisInverter;
|
||||
|
||||
public gltfExporter(glTF gltf, Axises invertAxis = Axises.Z)
|
||||
public gltfExporter(glTF gltf, Axes invertAxis = Axes.Z)
|
||||
{
|
||||
glTF = gltf;
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ namespace UniGLTF
|
|||
{
|
||||
DivideVertexBuffer = false
|
||||
};
|
||||
var axisInverter = Axises.X.Create();
|
||||
var axisInverter = Axes.X.Create();
|
||||
|
||||
var (gltfMesh, blendShapeIndexMap) = MeshExporter.ExportMesh(glTF, bufferIndex, new MeshWithRenderer(go.transform), Materials, meshExportSettings, axisInverter);
|
||||
|
||||
|
|
@ -176,7 +176,7 @@ namespace UniGLTF
|
|||
{
|
||||
DivideVertexBuffer = true
|
||||
};
|
||||
var axisInverter = Axises.X.Create();
|
||||
var axisInverter = Axes.X.Create();
|
||||
|
||||
var (gltfMesh, blendShapeIndexMap) = MeshExporter.ExportMesh(glTF, bufferIndex, new MeshWithRenderer(go.transform), Materials, meshExportSettings, axisInverter);
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ namespace VRM
|
|||
|
||||
public readonly VRM.glTF_VRM_extensions VRM = new glTF_VRM_extensions();
|
||||
|
||||
public VRMExporter(glTF gltf) : base(gltf, Axises.Z)
|
||||
public VRMExporter(glTF gltf) : base(gltf, Axes.Z)
|
||||
{
|
||||
gltf.extensionsUsed.Add(glTF_VRM_extensions.ExtensionName);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user