Mesh Separate stack trace

Back in VRoid Studio character and audio2face (does not work) - #7 by alan.james.kent I talked about a VRoid Studio character which has lots of disconnected meshes. I thought I reported here the problems I had with Mesh Separate, but cannot find it (maybe I just mentioned in Discord).

Note that the mesh is badly disconnected so I know needs work to fix it up, but reporting some problems with Mesh Separate regardless in case helpful.

Here is an example face before running mesh separate. (I hid the body and hair meshes)

Running mesh separate dumps stack traces with normals array accesses being out of bounds, so I commented out all the normals code just to see what would happen.

Here is the face after running mesh separate with normals code commented out. It found the teeth, mouth cavity, tongue, eye sockets. The rest is not visible.

It did generate 26 separate meshes, but many seem to have lost the textures. So it is not just normals that is the only problem (probably).

I think I am going to have to write custom code regardless - I need to stitch meshes together, but reporting the problem regardless in case helpful.

Stack trace (with normals code left in place):

2023-06-02 20:52:15  [Error] [omni.kit.commands.command] Failed to execute a command: MeshSeparate.
2023-06-02 20:52:15  [Error] [omni.kit.commands.command]   File "d:\omniverse\pkg\audio2face-2022.2.1\extscache\omni.kit.mesh_separate-1.1.7\omni\kit\mesh_separate\menu.py", line 16, in <lambda>
2023-06-02 20:52:15  [Error] [omni.kit.commands.command]     MenuItemDescription(name="Mesh Separate", onclick_fn=lambda: self._mesh_separate_on_clicked()),
2023-06-02 20:52:15  [Error] [omni.kit.commands.command]   File "d:\omniverse\pkg\audio2face-2022.2.1\extscache\omni.kit.mesh_separate-1.1.7\omni\kit\mesh_separate\menu.py", line 28, in _mesh_separate_on_clicked
2023-06-02 20:52:15  [Error] [omni.kit.commands.command]     omni.kit.commands.execute("MeshSeparate")
2023-06-02 20:52:15  [Error] [omni.kit.commands.command]   File "d:\omniverse\pkg\audio2face-2022.2.1\kit\extscore\omni.kit.commands\omni\kit\commands\command.py", line 459, in execute
2023-06-02 20:52:15  [Error] [omni.kit.commands.command]     result = omni.kit.undo.execute(command, name, kwargs)
2023-06-02 20:52:15  [Error] [omni.kit.commands.command] [...skipped...]
2023-06-02 20:52:15  [Error] [omni.kit.commands.command]   File "d:\omniverse\pkg\audio2face-2022.2.1\kit\extscore\omni.kit.commands\omni\kit\undo\undo.py", line 77, in execute
2023-06-02 20:52:15  [Error] [omni.kit.commands.command]     result = _execute(command, name, level, history_key)
2023-06-02 20:52:15  [Error] [omni.kit.commands.command]   File "d:\omniverse\pkg\audio2face-2022.2.1\kit\extscore\omni.kit.commands\omni\kit\undo\undo.py", line 454, in _execute
2023-06-02 20:52:15  [Error] [omni.kit.commands.command]     raise error
2023-06-02 20:52:15  [Error] [omni.kit.commands.command]   File "d:\omniverse\pkg\audio2face-2022.2.1\kit\extscore\omni.kit.commands\omni\kit\undo\undo.py", line 415, in _execute
2023-06-02 20:52:15  [Error] [omni.kit.commands.command]     result = command.do()
2023-06-02 20:52:15  [Error] [omni.kit.commands.command]   File "d:\omniverse\pkg\audio2face-2022.2.1\extscache\omni.kit.mesh_separate-1.1.7\omni\kit\mesh_separate\commands.py", line 47, in do
2023-06-02 20:52:15  [Error] [omni.kit.commands.command]     subgraphs = graph.subgraphs_sp
2023-06-02 20:52:15  [Error] [omni.kit.commands.command]   File "d:\omniverse\pkg\audio2face-2022.2.1\extscache\omni.kit.mesh_separate-1.1.7\omni\kit\mesh_separate\meshAlg.py", line 134, in subgraphs_sp
2023-06-02 20:52:15  [Error] [omni.kit.commands.command]     self.subgraph_preprocess_data()
2023-06-02 20:52:15  [Error] [omni.kit.commands.command]   File "d:\omniverse\pkg\audio2face-2022.2.1\extscache\omni.kit.mesh_separate-1.1.7\omni\kit\mesh_separate\meshAlg.py", line 94, in subgraph_preprocess_data
2023-06-02 20:52:15  [Error] [omni.kit.commands.command]     self.normals = self.meshData.normals[self.faceVertexIndices]
2023-06-02 20:52:15  [Error] [omni.kit.commands.command] 
2023-06-02 20:52:15  [Error] [omni.kit.commands.command]  <class 'IndexError'> index 24123 is out of bounds for axis 0 with size 21714

Hi @alan.james.kent

I guess this is the post you created before: VRoid Studio character and audio2face (does not work) - Apps / Audio2Face - NVIDIA Developer Forums

While A2F tries to tackle some common mesh problems, it’s not a good tool for fixing all of them. Its purpose is mostly deforming (standard) meshes based on audio, at least for now.