diff --git a/Assets/VRM/Runtime/IO/VRMExporter.cs b/Assets/VRM/Runtime/IO/VRMExporter.cs index 907b1aad9..edcdde0ef 100644 --- a/Assets/VRM/Runtime/IO/VRMExporter.cs +++ b/Assets/VRM/Runtime/IO/VRMExporter.cs @@ -28,10 +28,15 @@ namespace VRM public VRMExporter(ExportingGltfData data, GltfExportSettings exportSettings, IAnimationExporter animationExporter = null) : base( data, exportSettings, animationExporter: animationExporter) { - if (exportSettings == null || exportSettings.InverseAxis != Vrm0xSpecificationInverseAxis) + if (exportSettings == null) { throw new Exception($"VRM specification requires InverseAxis settings as {Vrm0xSpecificationInverseAxis}"); } + if (exportSettings.InverseAxis != Vrm0xSpecificationInverseAxis) + { + // migration 用に reverseX を許す + Debug.LogWarning($"VRM specification requires InverseAxis settings as {Vrm0xSpecificationInverseAxis}"); + } _gltf.extensionsUsed.Add(glTF_VRM_extensions.ExtensionName); } diff --git a/Assets/VRM10/Runtime/Components/VRM10Object/VRM10ObjectMeta.cs b/Assets/VRM10/Runtime/Components/VRM10Object/VRM10ObjectMeta.cs index 17c0e0c28..c9e5d55c5 100644 --- a/Assets/VRM10/Runtime/Components/VRM10Object/VRM10ObjectMeta.cs +++ b/Assets/VRM10/Runtime/Components/VRM10Object/VRM10ObjectMeta.cs @@ -70,7 +70,7 @@ namespace UniVRM10 public string OtherLicenseUrl; #endregion - public IEnumerable Validate(GameObject _) + public IEnumerable Validate(GameObject _ = null) { if (string.IsNullOrEmpty(Name)) { @@ -103,7 +103,7 @@ namespace UniVRM10 } dst.ContactInformation = ContactInformation; dst.References = References; - dst.ThirdPartyLicenses = ThirdPartyLicenses; + dst.ThirdPartyLicenses = ThirdPartyLicenses; dst.Thumbnail = Thumbnail; dst.AvatarPermission = AvatarPermission; dst.ViolentUsage = ViolentUsage; diff --git a/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs b/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs index e93cbcbf1..270966a4a 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs @@ -672,7 +672,7 @@ namespace UniVRM10 }; } - static int? ExportMeta(UniGLTF.Extensions.VRMC_vrm.VRMC_vrm vrm, VRM10ObjectMeta meta, ITextureExporter textureExporter) + public static int? ExportMeta(UniGLTF.Extensions.VRMC_vrm.VRMC_vrm vrm, VRM10ObjectMeta meta, ITextureExporter textureExporter) { vrm.Meta.Name = meta.Name; vrm.Meta.Version = meta.Version; diff --git a/Assets/VRM10/Runtime/Migration/MigrationVrm.cs b/Assets/VRM10/Runtime/Migration/MigrationVrm.cs index b4bc5e288..a368818ae 100644 --- a/Assets/VRM10/Runtime/Migration/MigrationVrm.cs +++ b/Assets/VRM10/Runtime/Migration/MigrationVrm.cs @@ -15,11 +15,11 @@ namespace UniVRM10 /// static internal class MigrationVrm { - public static byte[] Migrate(byte[] src) + public static byte[] Migrate(byte[] vrm0bytes, VRM10ObjectMeta meta = null) { - using (var data = new GlbBinaryParser(src, "migration").Parse()) + using (var data = new GlbBinaryParser(vrm0bytes, "migration").Parse()) { - return Migrate(data); + return Migrate(data, meta); } } @@ -35,7 +35,10 @@ namespace UniVRM10 return (min, max); } - public static byte[] Migrate(GltfData data) + /// vrm0 をパースしたデータ + /// migration 時に合成するライセンス情報 + /// + public static byte[] Migrate(GltfData data, VRM10ObjectMeta meta = null) { // VRM0 -> Unity var model = ModelReader.Read(data, VrmLib.Coordinates.Vrm0); @@ -51,7 +54,7 @@ namespace UniVRM10 gltf.extensionsUsed.Remove("VRM"); } - return MigrateVrm(gltf, bin, data.Json.ParseAsJson()["extensions"]["VRM"]); + return MigrateVrm(gltf, bin, data.Json.ParseAsJson()["extensions"]["VRM"], meta); } /// @@ -68,7 +71,7 @@ namespace UniVRM10 } } - static byte[] MigrateVrm(glTF gltf, ArraySegment bin, JsonNode vrm0) + static byte[] MigrateVrm(glTF gltf, ArraySegment bin, JsonNode vrm0, VRM10ObjectMeta meta) { var meshToNode = CreateMeshToNode(gltf); @@ -80,8 +83,24 @@ namespace UniVRM10 }; gltf.extensionsUsed.Add(UniGLTF.Extensions.VRMC_vrm.VRMC_vrm.ExtensionName); - // meta (required) - vrm1.Meta = MigrationVrmMeta.Migrate(gltf, vrm0["meta"]); + if (meta == null) + { + // migrate from vrm-0.x + vrm1.Meta = MigrationVrmMeta.Migrate(gltf, vrm0["meta"]); + } + else + { + // inject from arg + vrm1.Meta = new UniGLTF.Extensions.VRMC_vrm.Meta + { + LicenseUrl = Vrm10Exporter.LICENSE_URL_JA, + AllowExcessivelySexualUsage = false, + AllowExcessivelyViolentUsage = false, + AllowPoliticalOrReligiousUsage = false, + AllowRedistribution = false, + }; + Vrm10Exporter.ExportMeta(vrm1, meta, null); + } // humanoid (required) vrm1.Humanoid = MigrationVrmHumanoid.Migrate(vrm0["humanoid"]); diff --git a/Assets/VRM10/Runtime/Migration/Migrator.cs b/Assets/VRM10/Runtime/Migration/Migrator.cs new file mode 100644 index 000000000..241a9c11c --- /dev/null +++ b/Assets/VRM10/Runtime/Migration/Migrator.cs @@ -0,0 +1,31 @@ +using System; + +namespace UniVRM10 +{ + public static class Migrator + { + /// + /// マイグレーションの公開API + /// + /// MigrationVrm とその関連実装は、internal で runtime import 専用 + /// + /// + /// (必須)外部から供給されるライセンス情報 + /// + public static byte[] Migrate(byte[] vrm0bytes, VRM10ObjectMeta meta) + { + if (meta == null) + { + throw new ArgumentNullException("meta"); + } + foreach (var validation in meta.Validate()) + { + if (!validation.CanExport) + { + throw new ArgumentException(validation.Message); + } + } + return MigrationVrm.Migrate(vrm0bytes, meta); + } + } +} \ No newline at end of file diff --git a/Assets/VRM10/Runtime/Migration/Migrator.cs.meta b/Assets/VRM10/Runtime/Migration/Migrator.cs.meta new file mode 100644 index 000000000..ddc6160ae --- /dev/null +++ b/Assets/VRM10/Runtime/Migration/Migrator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: db393ac50cf8db343a6cf58ed69687f6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRM10/Runtime/Migration/Vrm0Meta.cs b/Assets/VRM10/Runtime/Migration/Vrm0Meta.cs index b3e9dcb22..8cc99fbee 100644 --- a/Assets/VRM10/Runtime/Migration/Vrm0Meta.cs +++ b/Assets/VRM10/Runtime/Migration/Vrm0Meta.cs @@ -23,7 +23,7 @@ namespace UniVRM10.Migration Other } - public enum UssageLicense + public enum UsageLicense { Disallow, Allow, diff --git a/Assets/VRM_0x_and_10_Samples.meta b/Assets/VRM_0x_and_10_Samples.meta new file mode 100644 index 000000000..f9712c65b --- /dev/null +++ b/Assets/VRM_0x_and_10_Samples.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9dfe30e374f23714098e680b42e58326 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRM_0x_and_10_Samples/MigrateExporter.meta b/Assets/VRM_0x_and_10_Samples/MigrateExporter.meta new file mode 100644 index 000000000..d58306d74 --- /dev/null +++ b/Assets/VRM_0x_and_10_Samples/MigrateExporter.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 158a2cd31973b9a4faba49afbbb8bbc6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRM_0x_and_10_Samples/MigrateExporter/MigrateExporter.asmdef b/Assets/VRM_0x_and_10_Samples/MigrateExporter/MigrateExporter.asmdef new file mode 100644 index 000000000..a1997ee6f --- /dev/null +++ b/Assets/VRM_0x_and_10_Samples/MigrateExporter/MigrateExporter.asmdef @@ -0,0 +1,19 @@ +{ + "name": "MigrateExporter", + "rootNamespace": "", + "references": [ + "GUID:05dd262a0c0a2f841b8252c8c3815582", + "GUID:e47c917724578cc43b5506c17a27e9a0", + "GUID:8d76e605759c3f64a957d63ef96ada7c", + "GUID:da3e51d19d51a544fa14d43fee843098" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/VRM_0x_and_10_Samples/MigrateExporter/MigrateExporter.asmdef.meta b/Assets/VRM_0x_and_10_Samples/MigrateExporter/MigrateExporter.asmdef.meta new file mode 100644 index 000000000..66e172362 --- /dev/null +++ b/Assets/VRM_0x_and_10_Samples/MigrateExporter/MigrateExporter.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f9969649d96863348a27d3379008cac5 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRM_0x_and_10_Samples/MigrateExporter/MigrateExporter.cs b/Assets/VRM_0x_and_10_Samples/MigrateExporter/MigrateExporter.cs new file mode 100644 index 000000000..244008d24 --- /dev/null +++ b/Assets/VRM_0x_and_10_Samples/MigrateExporter/MigrateExporter.cs @@ -0,0 +1,57 @@ +using System.IO; +using UnityEngine; + +namespace UniVRM10.Sample +{ + [DisallowMultipleComponent] + public class MigrateExporter : MonoBehaviour + { + [SerializeField] + UniVRM10.VRM10ObjectMeta _meta = new UniVRM10.VRM10ObjectMeta(); + + async void OnGUI() + { + // validate + foreach (var validation in _meta.Validate()) + { + GUILayout.Label("meta validation: " + validation.Message); + if (!validation.CanExport) + { + GUI.enabled = false; + } + } + + GUILayout.Label("ライセンスを変更する権利のある vrm-0.x モデルをロードしてください"); + if (GUILayout.Button("migrate")) + { + var path = UnityEditor.EditorUtility.OpenFilePanel("load vrm-0.x", null, "vrm"); + if (string.IsNullOrEmpty(path)) + { + return; + } + + Debug.Log(path); + var bytes = File.ReadAllBytes(path); + + // load + var vrm0Instance = await VRM.VrmUtility.LoadBytesAsync(path, bytes); + + // export設定 + var exportConfig = new UniGLTF.GltfExportSettings + { + }; + // export vrm0 + var vrm0 = VRM.VRMExporter.Export(exportConfig, + vrm0Instance.gameObject, new VRMShaders.RuntimeTextureSerializer()); + var vrm0bytes = vrm0.ToGlbBytes(); + + // migrate to vrm1 + var vrm1Bytes = UniVRM10.Migrator.Migrate(vrm0bytes, _meta); + var pathObj = VRMShaders.PathObject.FromFullPath(path); + var newPath = pathObj.Parent.Child(pathObj.Stem + ".10.vrm"); + newPath.WriteAllBytes(vrm1Bytes); + Debug.Log($"export to: {newPath}"); + } + } + } +} diff --git a/Assets/VRM_0x_and_10_Samples/MigrateExporter/MigrateExporter.cs.meta b/Assets/VRM_0x_and_10_Samples/MigrateExporter/MigrateExporter.cs.meta new file mode 100644 index 000000000..727096df7 --- /dev/null +++ b/Assets/VRM_0x_and_10_Samples/MigrateExporter/MigrateExporter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 057dcb5c6b50f574795f903ac5989b8d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRM_0x_and_10_Samples/MigrateExporter/MigrateExporter.unity b/Assets/VRM_0x_and_10_Samples/MigrateExporter/MigrateExporter.unity new file mode 100644 index 000000000..56fa2bc1e --- /dev/null +++ b/Assets/VRM_0x_and_10_Samples/MigrateExporter/MigrateExporter.unity @@ -0,0 +1,271 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.12731749, g: 0.13414757, b: 0.1210787, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &540916040 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 540916043} + - component: {fileID: 540916042} + - component: {fileID: 540916041} + m_Layer: 0 + m_Name: Camera + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &540916041 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 540916040} + m_Enabled: 1 +--- !u!20 &540916042 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 540916040} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &540916043 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 540916040} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 4.9861307, y: -1.2857006, z: -12.386837} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2054562369 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2054562371} + - component: {fileID: 2054562370} + m_Layer: 0 + m_Name: MigrateExporter + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &2054562370 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2054562369} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 057dcb5c6b50f574795f903ac5989b8d, type: 3} + m_Name: + m_EditorClassIdentifier: + _meta: + Name: MigrateExporter + Version: + Authors: + - MigrateExporterAuthor0 + CopyrightInformation: + ContactInformation: + References: [] + ThirdPartyLicenses: + Thumbnail: {fileID: 0} + AvatarPermission: 0 + ViolentUsage: 0 + SexualUsage: 0 + CommercialUsage: 0 + PoliticalOrReligiousUsage: 0 + AntisocialOrHateUsage: 0 + CreditNotation: 0 + Redistribution: 0 + Modification: 0 + OtherLicenseUrl: +--- !u!4 &2054562371 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2054562369} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/VRM_0x_and_10_Samples/MigrateExporter/MigrateExporter.unity.meta b/Assets/VRM_0x_and_10_Samples/MigrateExporter/MigrateExporter.unity.meta new file mode 100644 index 000000000..2a586fcdc --- /dev/null +++ b/Assets/VRM_0x_and_10_Samples/MigrateExporter/MigrateExporter.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5c0c00c31e7afc64bbdfaf0286ac1f5d +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRM_0x_and_10_Samples/MigrateExporter/README.md b/Assets/VRM_0x_and_10_Samples/MigrateExporter/README.md new file mode 100644 index 000000000..c6447432e --- /dev/null +++ b/Assets/VRM_0x_and_10_Samples/MigrateExporter/README.md @@ -0,0 +1,27 @@ +# MigrateExporter + +- for runtime +- Convert export vrm0 model directly to vrm1 +- input: vrm0 hierarchy + vrm1 meta +- output: vrm1 binary + +## Detail + +最初に vrm0 モデルをエクスポートします。 +このとき後で vrm1 化する前提で通常とは別の設定にします。 + +- 正規化しない +- z+ もしくは 左手系のまま進める +- divided vertex buffer(glb 向けに実装済み) + +得られた、vrm0 バイナリを migrate します。 +このとき、vrm1 の meta を外部から注入することで +ユーザー入力無しでの migration で `完全な` vrm1 を出力します。 + +結果に対して vrm1 バリデーション。 + +- https://github.com/vrm-c/glTF-Validator/pull/1 + +## Caution + +対象の `vrm-0.x` のライセンスを変更する権利が必要です。 diff --git a/Assets/VRM_0x_and_10_Samples/MigrateExporter/README.md.meta b/Assets/VRM_0x_and_10_Samples/MigrateExporter/README.md.meta new file mode 100644 index 000000000..2703b0002 --- /dev/null +++ b/Assets/VRM_0x_and_10_Samples/MigrateExporter/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 07cbd8332c1ad0645b7a7d2b51456558 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: