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

[1.7.0-beta.6] T&OのAutoMergeSkinnedMeshでNullReferenceExceptionが発生しマージされない #1009

Closed
kxn4t opened this issue Apr 14, 2024 · 1 comment · Fixed by #1010

Comments

@kxn4t
Copy link
Contributor

kxn4t commented Apr 14, 2024

1.7.0-beta.6 の T&O の AutoMergeSkinnedMesh で NullReferenceException が発生してマージされない衣装がありました。
どうやら MA Mesh Settings の有無で発生するかしないかが変わるようです。

アバタールートに以下の状態のT&Oを付与した状態で確認
image

アバター:マヌカちゃん
対称衣装:https://vagrant.booth.pm/items/5111206

[発生しない場合]

  1. MA Mesh Settingsをアバタールートおよび衣装にセットせず、衣装にMA Merge Armatureのみをつけた場合
    → 衣装はマージされずメッシュは個別で展開される
  2. MA Mesh Settingsをアバタールートおよび衣装にセットして、衣装のメッシュを別途AAO Merge Skinned Meshでマージした場合
    → 衣装とManuka_atamaがマージされた状態になる。Anchor OverrideおよびRote BoneはMesh Settingsで指定したものになっている

[発生する場合]

  • MA Mesh Settingsをアバタールートおよび衣装にセットした場合
    → NullReferenceException が発生

設定したMesh Settings
image

以下スタックトレース

System.NullReferenceException: Object reference not set to an instance of an object
  at Anatawa12.AvatarOptimizer.Processors.TraceAndOptimizes.AutoMergeSkinnedMesh.CreateSubMeshesMergePreserveOrder (Anatawa12.AvatarOptimizer.Processors.SkinnedMeshes.MeshInfo2[] meshInfos) [0x00188] in .\Packages\com.anatawa12.avatar-optimizer\Editor\Processors\TraceAndOptimize\AutoMergeSkinnedMesh.cs:471 
  at (wrapper delegate-invoke) System.Func`2[Anatawa12.AvatarOptimizer.Processors.SkinnedMeshes.MeshInfo2[],System.ValueTuple`2[System.Int32[][],System.Collections.Generic.List`1[System.ValueTuple`2[UnityEngine.MeshTopology,UnityEngine.Material]]]].invoke_TResult_T(Anatawa12.AvatarOptimizer.Processors.SkinnedMeshes.MeshInfo2[])
  at Anatawa12.AvatarOptimizer.Processors.TraceAndOptimizes.AutoMergeSkinnedMesh.MergeStaticSkinnedMesh (nadena.dev.ndmf.BuildContext context, System.Func`1[TResult] gameObjectFactory, Anatawa12.AvatarOptimizer.Processors.TraceAndOptimizes.AutoMergeSkinnedMesh+CategorizationKey key, System.Collections.Generic.List`1[T] meshInfos, System.Func`2[T,TResult] createSubMeshes) [0x00033] in .\Packages\com.anatawa12.avatar-optimizer\Editor\Processors\TraceAndOptimize\AutoMergeSkinnedMesh.cs:151 
  at Anatawa12.AvatarOptimizer.Processors.TraceAndOptimizes.AutoMergeSkinnedMesh.Execute (nadena.dev.ndmf.BuildContext context, Anatawa12.AvatarOptimizer.Processors.TraceAndOptimizes.TraceAndOptimizeState state) [0x002e7] in .\Packages\com.anatawa12.avatar-optimizer\Editor\Processors\TraceAndOptimize\AutoMergeSkinnedMesh.cs:121 
  at Anatawa12.AvatarOptimizer.Processors.TraceAndOptimizes.TraceAndOptimizePass`1[T].Execute (nadena.dev.ndmf.BuildContext context) [0x00010] in .\Packages\com.anatawa12.avatar-optimizer\Internal\TraceAndOptimizeBase\TraceAndOptimizeProcessor.cs:95 
  at nadena.dev.ndmf.Pass`1[T].nadena.dev.ndmf.IPass.Execute (nadena.dev.ndmf.BuildContext context) [0x00000] in .\Packages\nadena.dev.ndmf\Editor\API\Fluent\Pass.cs:64 
  at nadena.dev.ndmf.ConcretePass.Execute (nadena.dev.ndmf.BuildContext context) [0x00000] in .\Packages\nadena.dev.ndmf\Editor\API\Solver\PluginResolver.cs:36 
  at nadena.dev.ndmf.BuildContext.RunPass (nadena.dev.ndmf.ConcretePass pass) [0x00124] in .\Packages\nadena.dev.ndmf\Editor\API\BuildContext.cs:350 
  at Anatawa12.AvatarOptimizer.Processors.TraceAndOptimizes.AutoMergeSkinnedMesh.CreateSubMeshesMergePreserveOrder (Anatawa12.AvatarOptimizer.Processors.SkinnedMeshes.MeshInfo2[] meshInfos) [0x00188] in .\Packages\com.anatawa12.avatar-optimizer\Editor\Processors\TraceAndOptimize\AutoMergeSkinnedMesh.cs:471 
  at (wrapper delegate-invoke) System.Func`2[Anatawa12.AvatarOptimizer.Processors.SkinnedMeshes.MeshInfo2[],System.ValueTuple`2[System.Int32[][],System.Collections.Generic.List`1[System.ValueTuple`2[UnityEngine.MeshTopology,UnityEngine.Material]]]].invoke_TResult_T(Anatawa12.AvatarOptimizer.Processors.SkinnedMeshes.MeshInfo2[])
  at Anatawa12.AvatarOptimizer.Processors.TraceAndOptimizes.AutoMergeSkinnedMesh.MergeStaticSkinnedMesh (nadena.dev.ndmf.BuildContext context, System.Func`1[TResult] gameObjectFactory, Anatawa12.AvatarOptimizer.Processors.TraceAndOptimizes.AutoMergeSkinnedMesh+CategorizationKey key, System.Collections.Generic.List`1[T] meshInfos, System.Func`2[T,TResult] createSubMeshes) [0x00033] in .\Packages\com.anatawa12.avatar-optimizer\Editor\Processors\TraceAndOptimize\AutoMergeSkinnedMesh.cs:151 
  at Anatawa12.AvatarOptimizer.Processors.TraceAndOptimizes.AutoMergeSkinnedMesh.Execute (nadena.dev.ndmf.BuildContext context, Anatawa12.AvatarOptimizer.Processors.TraceAndOptimizes.TraceAndOptimizeState state) [0x002e7] in .\Packages\com.anatawa12.avatar-optimizer\Editor\Processors\TraceAndOptimize\AutoMergeSkinnedMesh.cs:121 
  at Anatawa12.AvatarOptimizer.Processors.TraceAndOptimizes.TraceAndOptimizePass`1[T].Execute (nadena.dev.ndmf.BuildContext context) [0x00010] in .\Packages\com.anatawa12.avatar-optimizer\Internal\TraceAndOptimizeBase\TraceAndOptimizeProcessor.cs:95 
  at nadena.dev.ndmf.Pass`1[T].nadena.dev.ndmf.IPass.Execute (nadena.dev.ndmf.BuildContext context) [0x00000] in .\Packages\nadena.dev.ndmf\Editor\API\Fluent\Pass.cs:64 
  at nadena.dev.ndmf.ConcretePass.Execute (nadena.dev.ndmf.BuildContext context) [0x00000] in .\Packages\nadena.dev.ndmf\Editor\API\Solver\PluginResolver.cs:36 
  at nadena.dev.ndmf.BuildContext.RunPass (nadena.dev.ndmf.ConcretePass pass) [0x00124] in .\Packages\nadena.dev.ndmf\Editor\API\BuildContext.cs:350 

調査に必要であれば衣装をギフトするので遠慮なくおっしゃってください。

@kxn4t
Copy link
Contributor Author

kxn4t commented Apr 14, 2024

こちらの衣装でも同様の事象を確認しました。
https://booth.pm/ja/items/5114918

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant