diff --git a/Scripts/Format/Editor/VRMImporterMenu.cs b/Scripts/Format/Editor/VRMImporterMenu.cs index 28a131552..5b9ef0286 100644 --- a/Scripts/Format/Editor/VRMImporterMenu.cs +++ b/Scripts/Format/Editor/VRMImporterMenu.cs @@ -50,7 +50,7 @@ namespace VRM var prefabPath = UnityPath.FromUnityPath(assetPath); var context = new VRMImporterContext(); context.ParseGlb(File.ReadAllBytes(path)); - context.SaveTexturesAsPng(prefabPath); + context.ExtranctImages(prefabPath); EditorApplication.delayCall += () => { diff --git a/Scripts/Format/Editor/vrmAssetPostprocessor.cs b/Scripts/Format/Editor/vrmAssetPostprocessor.cs index cd184777e..2582f25d5 100644 --- a/Scripts/Format/Editor/vrmAssetPostprocessor.cs +++ b/Scripts/Format/Editor/vrmAssetPostprocessor.cs @@ -34,7 +34,7 @@ namespace VRM var prefabPath = path.Parent.Child(path.FileNameWithoutExtension + ".prefab"); // save texture assets ! - context.SaveTexturesAsPng(prefabPath); + context.ExtranctImages(prefabPath); EditorApplication.delayCall += () => { diff --git a/Scripts/Format/VRMImporterContext.cs b/Scripts/Format/VRMImporterContext.cs index 2e6c74586..3d053a610 100644 --- a/Scripts/Format/VRMImporterContext.cs +++ b/Scripts/Format/VRMImporterContext.cs @@ -34,7 +34,7 @@ namespace VRM public override void Load() { - MaterialImporter = new VRMMaterialImporter(this, glTF_VRM_Material.Parse(Json)); + SetMaterialImporter(new VRMMaterialImporter(this, glTF_VRM_Material.Parse(Json))); base.Load(); OnLoadModel(); } @@ -53,7 +53,7 @@ namespace VRM { using (MeasureTime("new VRMMaterialImporter")) { - MaterialImporter = new VRMMaterialImporter(this, gltfMaterials); + SetMaterialImporter(new VRMMaterialImporter(this, gltfMaterials)); } }) .OnExecute(Scheduler.ThreadPool, parent => diff --git a/Scripts/Format/VRMPreShaderPropExporter.cs b/Scripts/Format/VRMPreShaderPropExporter.cs index 945ad83b0..2c4e72f4f 100644 --- a/Scripts/Format/VRMPreShaderPropExporter.cs +++ b/Scripts/Format/VRMPreShaderPropExporter.cs @@ -6,7 +6,7 @@ [PreExportShaders] public static SupportedShader[] VRMSupportedShaders = new SupportedShader[] { - new SupportedShader(VRM_TARGET_FOLDER, "VRM/MToon", "_BumpMap"), + new SupportedShader(VRM_TARGET_FOLDER, "VRM/MToon"), new SupportedShader(VRM_TARGET_FOLDER, "VRM/UnlitTexture"), new SupportedShader(VRM_TARGET_FOLDER, "VRM/UnlitCutout"), new SupportedShader(VRM_TARGET_FOLDER, "VRM/UnlitTransparent"), diff --git a/Scripts/PreExportShaderProps/VRM_MToon.cs b/Scripts/PreExportShaderProps/VRM_MToon.cs index 614774d51..c087771ee 100644 --- a/Scripts/PreExportShaderProps/VRM_MToon.cs +++ b/Scripts/PreExportShaderProps/VRM_MToon.cs @@ -15,36 +15,36 @@ namespace UniGLTF.ShaderPropExporter new ShaderProps { Properties = new ShaderProperty[]{ -new ShaderProperty("_Cutoff", ShaderPropertyType.Range, false) -,new ShaderProperty("_Color", ShaderPropertyType.Color, false) -,new ShaderProperty("_ShadeColor", ShaderPropertyType.Color, false) -,new ShaderProperty("_MainTex", ShaderPropertyType.TexEnv, false) -,new ShaderProperty("_ShadeTexture", ShaderPropertyType.TexEnv, false) -,new ShaderProperty("_BumpScale", ShaderPropertyType.Float, false) -,new ShaderProperty("_BumpMap", ShaderPropertyType.TexEnv, true) -,new ShaderProperty("_ReceiveShadowRate", ShaderPropertyType.Range, false) -,new ShaderProperty("_ReceiveShadowTexture", ShaderPropertyType.TexEnv, false) -,new ShaderProperty("_ShadeShift", ShaderPropertyType.Range, false) -,new ShaderProperty("_ShadeToony", ShaderPropertyType.Range, false) -,new ShaderProperty("_LightColorAttenuation", ShaderPropertyType.Range, false) -,new ShaderProperty("_SphereAdd", ShaderPropertyType.TexEnv, false) -,new ShaderProperty("_EmissionColor", ShaderPropertyType.Color, false) -,new ShaderProperty("_EmissionMap", ShaderPropertyType.TexEnv, false) -,new ShaderProperty("_OutlineWidthTexture", ShaderPropertyType.TexEnv, false) -,new ShaderProperty("_OutlineWidth", ShaderPropertyType.Range, false) -,new ShaderProperty("_OutlineScaledMaxDistance", ShaderPropertyType.Range, false) -,new ShaderProperty("_OutlineColor", ShaderPropertyType.Color, false) -,new ShaderProperty("_OutlineLightingMix", ShaderPropertyType.Range, false) -,new ShaderProperty("_DebugMode", ShaderPropertyType.Float, false) -,new ShaderProperty("_BlendMode", ShaderPropertyType.Float, false) -,new ShaderProperty("_OutlineWidthMode", ShaderPropertyType.Float, false) -,new ShaderProperty("_OutlineColorMode", ShaderPropertyType.Float, false) -,new ShaderProperty("_CullMode", ShaderPropertyType.Float, false) -,new ShaderProperty("_OutlineCullMode", ShaderPropertyType.Float, false) -,new ShaderProperty("_SrcBlend", ShaderPropertyType.Float, false) -,new ShaderProperty("_DstBlend", ShaderPropertyType.Float, false) -,new ShaderProperty("_ZWrite", ShaderPropertyType.Float, false) -,new ShaderProperty("_IsFirstSetup", ShaderPropertyType.Float, false) +new ShaderProperty("_Cutoff", ShaderPropertyType.Range) +,new ShaderProperty("_Color", ShaderPropertyType.Color) +,new ShaderProperty("_ShadeColor", ShaderPropertyType.Color) +,new ShaderProperty("_MainTex", ShaderPropertyType.TexEnv) +,new ShaderProperty("_ShadeTexture", ShaderPropertyType.TexEnv) +,new ShaderProperty("_BumpScale", ShaderPropertyType.Float) +,new ShaderProperty("_BumpMap", ShaderPropertyType.TexEnv) +,new ShaderProperty("_ReceiveShadowRate", ShaderPropertyType.Range) +,new ShaderProperty("_ReceiveShadowTexture", ShaderPropertyType.TexEnv) +,new ShaderProperty("_ShadeShift", ShaderPropertyType.Range) +,new ShaderProperty("_ShadeToony", ShaderPropertyType.Range) +,new ShaderProperty("_LightColorAttenuation", ShaderPropertyType.Range) +,new ShaderProperty("_SphereAdd", ShaderPropertyType.TexEnv) +,new ShaderProperty("_EmissionColor", ShaderPropertyType.Color) +,new ShaderProperty("_EmissionMap", ShaderPropertyType.TexEnv) +,new ShaderProperty("_OutlineWidthTexture", ShaderPropertyType.TexEnv) +,new ShaderProperty("_OutlineWidth", ShaderPropertyType.Range) +,new ShaderProperty("_OutlineScaledMaxDistance", ShaderPropertyType.Range) +,new ShaderProperty("_OutlineColor", ShaderPropertyType.Color) +,new ShaderProperty("_OutlineLightingMix", ShaderPropertyType.Range) +,new ShaderProperty("_DebugMode", ShaderPropertyType.Float) +,new ShaderProperty("_BlendMode", ShaderPropertyType.Float) +,new ShaderProperty("_OutlineWidthMode", ShaderPropertyType.Float) +,new ShaderProperty("_OutlineColorMode", ShaderPropertyType.Float) +,new ShaderProperty("_CullMode", ShaderPropertyType.Float) +,new ShaderProperty("_OutlineCullMode", ShaderPropertyType.Float) +,new ShaderProperty("_SrcBlend", ShaderPropertyType.Float) +,new ShaderProperty("_DstBlend", ShaderPropertyType.Float) +,new ShaderProperty("_ZWrite", ShaderPropertyType.Float) +,new ShaderProperty("_IsFirstSetup", ShaderPropertyType.Float) } } diff --git a/Scripts/PreExportShaderProps/VRM_UnlitCutout.cs b/Scripts/PreExportShaderProps/VRM_UnlitCutout.cs index f642d49ba..dbb4b7b88 100644 --- a/Scripts/PreExportShaderProps/VRM_UnlitCutout.cs +++ b/Scripts/PreExportShaderProps/VRM_UnlitCutout.cs @@ -15,8 +15,8 @@ namespace UniGLTF.ShaderPropExporter new ShaderProps { Properties = new ShaderProperty[]{ -new ShaderProperty("_MainTex", ShaderPropertyType.TexEnv, false) -,new ShaderProperty("_Cutoff", ShaderPropertyType.Range, false) +new ShaderProperty("_MainTex", ShaderPropertyType.TexEnv) +,new ShaderProperty("_Cutoff", ShaderPropertyType.Range) } } diff --git a/Scripts/PreExportShaderProps/VRM_UnlitTexture.cs b/Scripts/PreExportShaderProps/VRM_UnlitTexture.cs index 298a4b1a7..fbc25138c 100644 --- a/Scripts/PreExportShaderProps/VRM_UnlitTexture.cs +++ b/Scripts/PreExportShaderProps/VRM_UnlitTexture.cs @@ -15,7 +15,7 @@ namespace UniGLTF.ShaderPropExporter new ShaderProps { Properties = new ShaderProperty[]{ -new ShaderProperty("_MainTex", ShaderPropertyType.TexEnv, false) +new ShaderProperty("_MainTex", ShaderPropertyType.TexEnv) } } diff --git a/Scripts/PreExportShaderProps/VRM_UnlitTransparent.cs b/Scripts/PreExportShaderProps/VRM_UnlitTransparent.cs index f1edc22e2..d160623cb 100644 --- a/Scripts/PreExportShaderProps/VRM_UnlitTransparent.cs +++ b/Scripts/PreExportShaderProps/VRM_UnlitTransparent.cs @@ -15,7 +15,7 @@ namespace UniGLTF.ShaderPropExporter new ShaderProps { Properties = new ShaderProperty[]{ -new ShaderProperty("_MainTex", ShaderPropertyType.TexEnv, false) +new ShaderProperty("_MainTex", ShaderPropertyType.TexEnv) } } diff --git a/Scripts/PreExportShaderProps/VRM_UnlitTransparentZWrite.cs b/Scripts/PreExportShaderProps/VRM_UnlitTransparentZWrite.cs index 35dea7bdf..6ee765b08 100644 --- a/Scripts/PreExportShaderProps/VRM_UnlitTransparentZWrite.cs +++ b/Scripts/PreExportShaderProps/VRM_UnlitTransparentZWrite.cs @@ -15,7 +15,7 @@ namespace UniGLTF.ShaderPropExporter new ShaderProps { Properties = new ShaderProperty[]{ -new ShaderProperty("_MainTex", ShaderPropertyType.TexEnv, false) +new ShaderProperty("_MainTex", ShaderPropertyType.TexEnv) } } diff --git a/UniGLTF b/UniGLTF index fb2176c8e..25c88fb19 160000 --- a/UniGLTF +++ b/UniGLTF @@ -1 +1 @@ -Subproject commit fb2176c8ea68d9913241292591b494d88b87ff31 +Subproject commit 25c88fb196453eac1599c033097281a66632c139