DarklightGames / io_scene_psk_psa

A Blender extension for importing and exporting Unreal PSK and PSA files
GNU General Public License v3.0
395 stars 24 forks source link

Meshes with high polygon counts export incorrectly #7

Closed Lasercar closed 3 years ago

Lasercar commented 3 years ago

Trying to export a 53K tri object, with 30K verts, results in a broken 40K vert, 52K model, with tons of artifacts and bits of the mesh missing.

Model in question: https://www.moddb.com/games/unreal-tournament-2004/addons/high-poly-scorpion https://sketchfab.com/3d-models/free-scorpion-ut2004-finished-9c337d0da10f49629877a0631a39c99e

I'm able to export it using ActorX (in 3dsmax) without any issues by unticking bake smoothing groups.

cmbasnett commented 3 years ago

Hi @Lasercar, I will have a look at this and try to identify the issue.

cmbasnett commented 3 years ago

image

I have reproduced the error. I have a suspicion as to what might be the cause. Models with more than 65536 wedges use a different internal structure for how they are represented. For our team's own uses, we never have any models with such high poly-counts and so never encountered this.

Upon further inspection, it appears that the method I'm using to export the wedges is overflowing the maximum wedge count built into the format. Effectively, the maximum triangle limit right now is 21,845, which this model exceeds, hence the borked export.

I will have to think about how best to fix this.

cmbasnett commented 3 years ago

This bug has been fixed in release 1.1.1. Thank you for the report!

image