Conversion tool that is able to convert from the game binary formats (.pmx) to the middle formats (.pix) in Euro Truck Simulator 2 & American Truck Simulator.
The crash happened because this particular model has 177 bones (there are 5 deers running next to each other). When importing those bones, m_parent which was signed 1 byte, started to flip below 0 after reaching 127. Then these negative indexes were used when accessing m_bones Array. Changing the type of m_parent to unsigned 1 byte fixed the issue but then the mesh started to float around. To fix this I had to change the type of Vertex::m_boneIndex to unsigned 1 byte as well so that vertexes were assigned to proper bones. Now converter_pix is not crashing and the model and the animation works very well after importing to blender.
Ah and the crash wasn't happening on linux build but instead the resulting pis file had "(null)" parents in bones which had parent bones with indexes above 127.
The crash happened because this particular model has 177 bones (there are 5 deers running next to each other). When importing those bones, m_parent which was signed 1 byte, started to flip below 0 after reaching 127. Then these negative indexes were used when accessing m_bones Array. Changing the type of m_parent to unsigned 1 byte fixed the issue but then the mesh started to float around. To fix this I had to change the type of Vertex::m_boneIndex to unsigned 1 byte as well so that vertexes were assigned to proper bones. Now converter_pix is not crashing and the model and the animation works very well after importing to blender.