diff --git a/Assets/VRM10/Runtime/IO/ExpressionExtensions.cs b/Assets/VRM10/Runtime/IO/ExpressionExtensions.cs index e9cb156a2..efba8431b 100644 --- a/Assets/VRM10/Runtime/IO/ExpressionExtensions.cs +++ b/Assets/VRM10/Runtime/IO/ExpressionExtensions.cs @@ -50,13 +50,15 @@ namespace UniVRM10 var binding = default(UniVRM10.MaterialUVBinding?); if (material != null) { + var (scale, offset) = UniGLTF.TextureTransform.VerticalFlipScaleOffset(new Vector2(bind.Scale[0], bind.Scale[1]), new Vector2(bind.Offset[0], bind.Offset[1])); + try { binding = new UniVRM10.MaterialUVBinding { MaterialName = material.name, // 名前で持つべき - Scaling = new Vector2(bind.Scale[0], bind.Scale[1]), - Offset = new Vector2(bind.Offset[0], bind.Offset[1]), + Scaling = scale, + Offset = offset, }; } catch (Exception) diff --git a/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs b/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs index 34e6ba50c..87b870501 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs @@ -550,11 +550,12 @@ namespace UniVRM10 UniGLTF.Extensions.VRMC_vrm.TextureTransformBind ExportTextureTransformBinding(MaterialUVBinding binding, Func getIndex) { + var (scale, offset) = TextureTransform.VerticalFlipScaleOffset(binding.Scaling, binding.Offset); return new UniGLTF.Extensions.VRMC_vrm.TextureTransformBind { Material = getIndex(binding.MaterialName), - Offset = new float[] { binding.Offset.x, binding.Offset.y }, - Scale = new float[] { binding.Scaling.x, binding.Scaling.y }, + Offset = new float[] { offset.x, offset.y }, + Scale = new float[] { scale.x, scale.y }, }; }