Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EditModeテスト「VRM.Samples.Editor.Tests.VRMImportExportTests」が失敗している #357

Closed
saturday06 opened this issue Dec 26, 2019 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@saturday06
Copy link
Contributor

バグについて

EditModeテスト「VRM.Samples.Editor.Tests.VRMImportExportTests」が失敗しています。

再現方法

  1. Unityのメニュー「Window→General→Test Runner」を選択
  2. 「Test Runner」タブの「EditMode」ボタンを押下
  3. Run Allボタンを押下
  4. VRM.Samples.VRMImportExportTestImportExportTestSerializeCompare の各テストが失敗する

ImportExportTestの失敗メッセージは下記

ImportExportTest (2.260s)
---
Unhandled log message: '[Error] Material doesn't have a texture property '_RimTexture''. Use UnityEngine.TestTools.LogAssert.Expect
---
UnityEngine.Material:GetTexture(String)
UniGLTF.<GetTextures>d__5:MoveNext() (at Assets/VRM/UniGLTF/Scripts/IO/TextureIO.cs:107)
System.Linq.Enumerable:ToList(IEnumerable`1)
UniGLTF.gltfExporter:FromGameObject(glTF, GameObject, Boolean) (at Assets/VRM/UniGLTF/Scripts/IO/gltfExporter.cs:212)
UniGLTF.gltfExporter:Export() (at Assets/VRM/UniGLTF/Scripts/IO/gltfExporter.cs:144)
VRM.VRMExporter:_Export(glTF, VRMExporter, GameObject) (at Assets/VRM/UniVRM/Scripts/Format/VRMExporter.cs:44)
VRM.VRMExporter:Export(GameObject, Boolean) (at Assets/VRM/UniVRM/Scripts/Format/VRMExporter.cs:35)
VRM.Samples.VRMImportExportTests:ImportExportTest() (at Assets/VRM.Samples/Editor/Tests/VRMImportExportTests.cs:84)
System.Reflection.MethodBase:Invoke(Object, Object[])
NUnit.Framework.Internal.Reflect:InvokeMethod(MethodInfo, Object, Object[])
NUnit.Framework.Internal.MethodWrapper:Invoke(Object, Object[])
NUnit.Framework.Internal.Commands.TestMethodCommand:RunNonAsyncTestMethod(ITestExecutionContext)
NUnit.Framework.Internal.Commands.TestMethodCommand:RunTestMethod(ITestExecutionContext)
NUnit.Framework.Internal.Commands.TestMethodCommand:Execute(ITestExecutionContext)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
---
【SpeedLog】
TexturesProcessOnAnyThread: 0ms
TexturesProcessOnMainThread: 175ms
LoadMaterials: 3ms
ReadMesh: 2ms
BuildMesh: 1ms
ReadMesh: 1ms
BuildMesh: 0ms
ReadMesh: 0ms
BuildMesh: 0ms
ReadMesh: 0ms
BuildMesh: 0ms
ReadMesh: 0ms
BuildMesh: 0ms
ReadMesh: 1ms
BuildMesh: 1ms
ReadMesh: 0ms
BuildMesh: 0ms
ReadMesh: 16ms
BuildMesh: 2ms
ReadMesh: 2ms
BuildMesh: 2ms
ReadMesh: 0ms
BuildMesh: 0ms
ReadMesh: 0ms
BuildMesh: 0ms
ReadMesh: 0ms
BuildMesh: 0ms
LoadNodes: 1ms
BuildHierarchy: 2ms
AnimationImporter: 0ms
VRM LoadMeta: 5ms
VRM LoadHumanoid: 8ms
VRM LoadBlendShapeMaster: 5ms
VRM LoadSecondary: 1ms
VRM LoadFirstPerson: 4ms
total: 247ms

Material doesn't have a texture property '_RimTexture'
Material doesn't have a texture property '_UvAnimMaskTexture'
Material doesn't have a texture property '_RimTexture'
Material doesn't have a texture property '_UvAnimMaskTexture'
Material doesn't have a texture property '_RimTexture'
Material doesn't have a texture property '_UvAnimMaskTexture'
Material doesn't have a texture property '_RimTexture'
Material doesn't have a texture property '_UvAnimMaskTexture'
Material doesn't have a texture property '_RimTexture'
Material doesn't have a texture property '_UvAnimMaskTexture'
Material doesn't have a texture property '_RimTexture'
Material doesn't have a texture property '_UvAnimMaskTexture'
Material doesn't have a texture property '_RimTexture'
Material doesn't have a texture property '_UvAnimMaskTexture'
Material doesn't have a texture property '_RimTexture'
Material doesn't have a texture property '_UvAnimMaskTexture'
Material doesn't have a texture property '_RimTexture'
Material doesn't have a texture property '_UvAnimMaskTexture'
Material doesn't have a texture property '_RimTexture'
Material doesn't have a texture property '_UvAnimMaskTexture'
Material doesn't have a texture property '_RimTexture'
Material doesn't have a texture property '_UvAnimMaskTexture'
Material doesn't have a texture property '_RimTexture'
Material doesn't have a texture property '_UvAnimMaskTexture'
Material doesn't have a color property '_RimColor'
Material doesn't have a texture property '_RimTexture'
Material doesn't have a texture property '_RimTexture'
Material doesn't have a texture property '_RimTexture'
Material doesn't have a float or range property '_RimLightingMix'
Material doesn't have a float or range property '_RimFresnelPower'
Material doesn't have a float or range property '_RimLift'
Material doesn't have a texture property '_UvAnimMaskTexture'

(以下同様のメッセージが長く続く)

SerializeCompareの失敗メッセージは下記

SerializerCompare (0.342s)
---
System.NullReferenceException : Object reference not set to an instance of an object
---
at UniGLTF.IFormatterExtensionsGltf.GenSerialize (UniJSON.IFormatter f, UniGLTF.glTFNode value) [0x00031] in C:\u\UniVRM\Assets\VRM\UniGLTF\Scripts\IO\FormatterExtensionsGltf.g.cs:960 
  at UniGLTF.IFormatterExtensionsGltf.GenSerialize (UniJSON.IFormatter f, System.Collections.Generic.List`1[T] value) [0x00021] in C:\u\UniVRM\Assets\VRM\UniGLTF\Scripts\IO\FormatterExtensionsGltf.g.cs:945 
  at UniGLTF.IFormatterExtensionsGltf.GenSerialize (UniJSON.IFormatter f, UniGLTF.glTF value) [0x00197] in C:\u\UniVRM\Assets\VRM\UniGLTF\Scripts\IO\FormatterExtensionsGltf.g.cs:66 
  at VRM.Samples.VRMImportExportTests.SerializerCompare () [0x00040] in C:\u\UniVRM\Assets\VRM.Samples\Editor\Tests\VRMImportExportTests.cs:134 
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <567df3e0919241ba98db88bec4c6696f>:0

期待する動作

テストが失敗しない

スクリーンショット

ある場合は、問題の説明に役立つスクリーンショットを追加してください。

環境情報

  • OS: Windows 10 Pro 1919
  • UniVRM version: c39e68c
  • Unity: 2019.2.17f1

追加の状況・背景

この問題に関するその他の状況・背景など記載したい場合にここに記載してください。

@saturday06 saturday06 changed the title EditModeテスト「VRM.Samples.Editor.Tests.VRMImportExportTests.ImportExportTest」が失敗している EditModeテスト「VRM.Samples.Editor.Tests.VRMImportExportTests」が失敗している Dec 26, 2019
@hiroj hiroj added this to the v0.55 milestone Dec 26, 2019
@hiroj hiroj added the bug Something isn't working label Dec 26, 2019
@hiroj hiroj mentioned this issue Dec 26, 2019
@hiroj
Copy link
Contributor

hiroj commented Dec 26, 2019

node->children の nullチェック追加して修正しました

@saturday06
Copy link
Contributor Author

0.55.0がリリースされたようですが、 ImportExportTest はまだ修正されていないように見えます。修正されるまでこのissueは残しておきます。

@saturday06
Copy link
Contributor Author

Unityのメニュー「VRM→ShaderProperty→PreExport ShaderProps」を実行後にテストを走らせると成功します。また、その際に Assets/VRM/ShaderProperty/Runtime/VRM/VRM_MToon.cs に下記のような更新が発生しています。

diff --git a/Assets/VRM/ShaderProperty/Runtime/VRM/VRM_MToon.cs b/Assets/VRM/ShaderProperty/Runtime/VRM/VRM_MToon.cs
index f5fc6f1..aa9162c 100644
--- a/Assets/VRM/ShaderProperty/Runtime/VRM/VRM_MToon.cs
+++ b/Assets/VRM/ShaderProperty/Runtime/VRM/VRM_MToon.cs
@@ -30,11 +30,6 @@ new ShaderProperty("_Cutoff", ShaderPropertyType.Range)
 ,new ShaderProperty("_ShadeToony", ShaderPropertyType.Range)
 ,new ShaderProperty("_LightColorAttenuation", ShaderPropertyType.Range)
 ,new ShaderProperty("_IndirectLightIntensity", ShaderPropertyType.Range)
-,new ShaderProperty("_RimColor", ShaderPropertyType.Color)
-,new ShaderProperty("_RimTexture", ShaderPropertyType.TexEnv)
-,new ShaderProperty("_RimLightingMix", ShaderPropertyType.Range)
-,new ShaderProperty("_RimFresnelPower", ShaderPropertyType.Range)
-,new ShaderProperty("_RimLift", ShaderPropertyType.Range)
 ,new ShaderProperty("_SphereAdd", ShaderPropertyType.TexEnv)
 ,new ShaderProperty("_EmissionColor", ShaderPropertyType.Color)
 ,new ShaderProperty("_EmissionMap", ShaderPropertyType.TexEnv)
@@ -43,11 +38,6 @@ new ShaderProperty("_Cutoff", ShaderPropertyType.Range)
 ,new ShaderProperty("_OutlineScaledMaxDistance", ShaderPropertyType.Range)
 ,new ShaderProperty("_OutlineColor", ShaderPropertyType.Color)
 ,new ShaderProperty("_OutlineLightingMix", ShaderPropertyType.Range)
-,new ShaderProperty("_UvAnimMaskTexture", ShaderPropertyType.TexEnv)
-,new ShaderProperty("_UvAnimScrollX", ShaderPropertyType.Float)
-,new ShaderProperty("_UvAnimScrollY", ShaderPropertyType.Float)
-,new ShaderProperty("_UvAnimRotation", ShaderPropertyType.Float)
-,new ShaderProperty("_MToonVersion", ShaderPropertyType.Float)
 ,new ShaderProperty("_DebugMode", ShaderPropertyType.Float)
 ,new ShaderProperty("_BlendMode", ShaderPropertyType.Float)
 ,new ShaderProperty("_OutlineWidthMode", ShaderPropertyType.Float)

MToonの更新に追従できていないように見えます。この更新をコミットしてしまえば、テストは通るようになるように思えます。

@saturday06
Copy link
Contributor Author

私の手元のMToonのサブモジュールが更新されていなかったのが原因でした。大変失礼しました。こちらはクローズします。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants