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

エクスポート時にブレンドシェイプを含むパーツが消える #396

Closed
sorogonliy opened this issue May 11, 2020 · 11 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@sorogonliy
Copy link

モデルのエクスポート時にブレンドシェイプを含むパーツになにか問題があるようでエラーになります。

fail to mesh.AddBlendShapeFrame Face.baked.上
UnityEngine.Debug:LogErrorFormat(String, Object[])
VRM.BoneNormalizer:NormalizeSkinnedMesh(Transform, Transform, Dictionary2, Boolean) (at Assets/VRM/UniVRM/Scripts/SkinnedMeshUtility/BoneNormalizer.cs:443) VRM.BoneNormalizer:Execute(GameObject, Boolean, Boolean) (at Assets/VRM/UniVRM/Scripts/SkinnedMeshUtility/BoneNormalizer.cs:557) VRM.VRMExportSettings:Export(String, List1) (at Assets/VRM/UniVRM/Scripts/Format/VRMExportSettings.cs:291)
VRM.VRMExportSettings:Export(String) (at Assets/VRM/UniVRM/Scripts/Format/VRMExportSettings.cs:263)
VRM.VRMExporterWizard:OnWizardCreate() (at Assets/VRM/UniVRM/Editor/Format/VRMExporterMenu.cs:42)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

ArgumentException: Blend shape frame weight must be greather than previous frame weight
VRM.BoneNormalizer.NormalizeSkinnedMesh (UnityEngine.Transform src, UnityEngine.Transform dst, System.Collections.Generic.Dictionary2[TKey,TValue] boneMap, System.Boolean clearBlendShape) (at Assets/VRM/UniVRM/Scripts/SkinnedMeshUtility/BoneNormalizer.cs:447) VRM.BoneNormalizer.Execute (UnityEngine.GameObject go, System.Boolean forceTPose, System.Boolean clearBlendShapeBeforeNormalize) (at Assets/VRM/UniVRM/Scripts/SkinnedMeshUtility/BoneNormalizer.cs:557) VRM.VRMExportSettings.Export (System.String path, System.Collections.Generic.List1[T] destroy) (at Assets/VRM/UniVRM/Scripts/Format/VRMExportSettings.cs:291)
VRM.VRMExportSettings.Export (System.String path) (at Assets/VRM/UniVRM/Scripts/Format/VRMExportSettings.cs:263)
VRM.VRMExporterWizard.OnWizardCreate () (at Assets/VRM/UniVRM/Editor/Format/VRMExporterMenu.cs:42)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at :0)
UnityEditor.ScriptableWizard.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/ScriptableWizard.cs:79)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at :0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:342)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:336)
UnityEditor.HostView.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:129)
UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:266)
UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:438)
UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:421)
UnityEngine.Experimental.UIElements.IMGUIContainer.HandleEvent (UnityEngine.Experimental.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:401)
UnityEngine.Experimental.UIElements.EventDispatcher.ProcessEvent (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:511)
UnityEngine.Experimental.UIElements.EventDispatcher.Dispatch (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel, UnityEngine.Experimental.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:307)
UnityEngine.Experimental.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.Experimental.UIElements.EventBase e, UnityEngine.Experimental.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/Panel.cs:176)
UnityEngine.Experimental.UIElements.UIElementsUtility.DoDispatch (UnityEngine.Experimental.UIElements.BaseVisualElementPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:245)
UnityEngine.Experimental.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:68)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

@hiroj hiroj added the bug Something isn't working label May 11, 2020
@hiroj
Copy link
Contributor

hiroj commented May 11, 2020

ご報告ありがとうございます。
出来ればUnityのバージョン、使用したUniVRMバージョン、再現方法などを教えて頂けると助かります。

@sorogonliy
Copy link
Author

追記
OS:Windows10 64bit
Unity:2018.4.20.f1
UniVRM0.55.0

@sorogonliy
Copy link
Author

再現方法
①ヒエラルキー上に置いたモデルのプレハブアセットをクリック
②VRMタブからExport humanoidをクリック
③VRM Exporterウィンドウに必要事項を記載の上、Forse T PoseとPose Freezeのみにチェックを入れた状態でExportを押すとエラー

補足
Pose Freezeにチェックを入れない状態だと一応Exportされるが、二度目のExport時にPose Freezeにチェックを入れると同様にエラー発生。

@sorogonliy
Copy link
Author

タイトルの説明に少し誤りがありました。
実際には「エクスポートされたVRMにブレンドシェイプを含むパーツが消えている」のではなく、そもそもこの状態ではエクスポートはエラーで実行されず、その代りヒエラルキー上に出てきたモデル名(normalized)という新たなプレハブにブレンドシェイプを含むパーツが反映されていないという現象が起きています。モデル名(normalized)のブレンドシェイプを含んでいたパーツはSkinned Mesh Rendererごと消えている状態です。

@hiroj
Copy link
Contributor

hiroj commented May 11, 2020

情報ありがとうございます、調査してみます。

@hiroj
Copy link
Contributor

hiroj commented May 22, 2020

ArgumentException: Blend shape frame weight must be greather than previous frame weight

とエラーが出ているため、おそらくMesh = Face.baked にある BlendShapeName = 上のブレンドシェイプに複数フレーム登録がされており、Normalize時にうまく変換が出来ていないようです。
Normalize処理が複数フレームブレンドシェイプに対応していなかったため、いったんこの部分の修正を行います。

@hiroj
Copy link
Contributor

hiroj commented May 22, 2020

Forse T PoseとPose Freeze時に複数フレーム登録されているBlendShapeがコピーされるように修正を入れました #410.
よろしければ動作確認をしていただけると助かります。

@hiroj hiroj added this to the v0.56 milestone May 22, 2020
@sorogonliy
Copy link
Author

返答が遅れてしまい申し訳ございません。
当方、素人のため基礎的なことをお聞きしたいのですが上記の修正を適用するには #410 のページのFiles changedの内容をBoneNormalizer.csを編集し反映すればよいのでしょうか。
Files changedの赤い行を削除し、そこに緑の行を挿入するというやり方で大丈夫でしょうか。
20200624174956

@PoChang007
Copy link
Contributor

はい、その方法は大丈夫ですが、
オススメのやり方は:
このリポジトリをダウンロードする。
もしくはこのリポジトリからプルする。
ダウンロードしたフォルダをUnityでOpenする。

@sorogonliy
Copy link
Author

試して見ましたが上手くいかないようでした。

fail to mesh.AddBlendShapeFrame Face.baked.上
UnityEngine.Debug:LogErrorFormat(String, Object[])
VRM.BoneNormalizer:NormalizeSkinnedMesh(Transform, Transform, Dictionary2, Boolean) (at Assets/VRM/UniVRM/Scripts/SkinnedMeshUtility/BoneNormalizer.cs:443) VRM.BoneNormalizer:Execute(GameObject, Boolean, Boolean) (at Assets/VRM/UniVRM/Scripts/SkinnedMeshUtility/BoneNormalizer.cs:557) VRM.VRMExportSettings:Export(String, List1) (at Assets/VRM/UniVRM/Scripts/Format/VRMExportSettings.cs:291)
VRM.VRMExportSettings:Export(String) (at Assets/VRM/UniVRM/Scripts/Format/VRMExportSettings.cs:263)
VRM.VRMExporterWizard:OnWizardCreate() (at Assets/VRM/UniVRM/Editor/Format/VRMExporterMenu.cs:42)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

ArgumentException: Blend shape frame weight must be greather than previous frame weight
VRM.BoneNormalizer.NormalizeSkinnedMesh (UnityEngine.Transform src, UnityEngine.Transform dst, System.Collections.Generic.Dictionary2[TKey,TValue] boneMap, System.Boolean clearBlendShape) (at Assets/VRM/UniVRM/Scripts/SkinnedMeshUtility/BoneNormalizer.cs:447) VRM.BoneNormalizer.Execute (UnityEngine.GameObject go, System.Boolean forceTPose, System.Boolean clearBlendShapeBeforeNormalize) (at Assets/VRM/UniVRM/Scripts/SkinnedMeshUtility/BoneNormalizer.cs:557) VRM.VRMExportSettings.Export (System.String path, System.Collections.Generic.List1[T] destroy) (at Assets/VRM/UniVRM/Scripts/Format/VRMExportSettings.cs:291)
VRM.VRMExportSettings.Export (System.String path) (at Assets/VRM/UniVRM/Scripts/Format/VRMExportSettings.cs:263)
VRM.VRMExporterWizard.OnWizardCreate () (at Assets/VRM/UniVRM/Editor/Format/VRMExporterMenu.cs:42)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at :0)
UnityEditor.ScriptableWizard.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/ScriptableWizard.cs:79)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at :0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:342)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:336)
UnityEditor.HostView.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:129)
UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:266)
UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:438)
UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:421)
UnityEngine.Experimental.UIElements.IMGUIContainer.HandleEvent (UnityEngine.Experimental.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:401)
UnityEngine.Experimental.UIElements.EventDispatcher.ProcessEvent (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:511)
UnityEngine.Experimental.UIElements.EventDispatcher.Dispatch (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel, UnityEngine.Experimental.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:307)
UnityEngine.Experimental.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.Experimental.UIElements.EventBase e, UnityEngine.Experimental.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/Panel.cs:176)
UnityEngine.Experimental.UIElements.UIElementsUtility.DoDispatch (UnityEngine.Experimental.UIElements.BaseVisualElementPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:245)
UnityEngine.Experimental.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:68)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

@hiroj hiroj modified the milestones: v0.56, v0.57 Jul 6, 2020
@PoChang007
Copy link
Contributor

v56.2パッケージ使ってもインポートうまくいかなかったの場合は、インポートうまくいかなかったのモデル共有することは可能ですか?

私たち調査してみます。

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

3 participants