VRM 0.x の仕様に反する変換 Export は throw する

This commit is contained in:
Masataka SUMI
2021-10-22 20:31:28 +09:00
parent 2a01ef551b
commit d2e2f8403e

View File

@@ -10,6 +10,8 @@ namespace VRM
{
public class VRMExporter : gltfExporter
{
public const Axes VrmSpecificationInverseAxis = Axes.Z;
protected override IMaterialExporter CreateMaterialExporter()
{
return new VRMMaterialExporter();
@@ -30,6 +32,11 @@ namespace VRM
public VRMExporter(glTF gltf, GltfExportSettings exportSettings) : base(gltf, exportSettings)
{
if (exportSettings == null || exportSettings.InverseAxis != VrmSpecificationInverseAxis)
{
throw new Exception( $"VRM specification requires InverseAxis settings as {VrmSpecificationInverseAxis}");
}
gltf.extensionsUsed.Add(glTF_VRM_extensions.ExtensionName);
}