Five-Damned-Dollarz / io_scene_lithtech

Based off of io_scene_abc by @cmbasnett
GNU General Public License v2.0
5 stars 2 forks source link

Export of PS2 model (ltb) as abc gives "IndexError list index out of range" #2

Open StenApp opened 2 months ago

StenApp commented 2 months ago

See original post here https://github.com/haekb/io_scene_lithtech/issues/30#issue-2262219634

Five-Damned-Dollarz commented 2 months ago

I'm open to suggestions, but I don't think there's anything reasonable to be changed except the documentation. If it just assumed unassigned vertices should be assigned to the root node (or some other "default") on export that could cause very serious visual bugs in-engine, I'd rather just have it fail to export instead. Maybe it's the error checking that needs updating to give a better message about what's wrong.

StenApp commented 2 months ago

I'm a bit clueless with this error since i'm a beginner in model formats and 3D stuff. I just wanted to port over the nolf ps2 models to pc.

Five-Damned-Dollarz commented 2 months ago

Ah, I see what's happening now. The PS2 LTB format has a flag for models that don't use the skeleton, meaning they don't have any weight data. The PC format doesn't have a flag like that. I think your only solution is to paint the weights yourself on the models that fail with that specific error. That's as easy as going to edit mode (tab), selecting all vertices (A), and clicking Assign in the Object Data Properties tab with whichever bone's vertex group selected (in theory they'll only have 2 bones, select the one not named null).

StenApp commented 2 months ago

Thank you for that information! It worked on the britishpolicehat.Ltb which is an attachment. Can you update the bt file with the flag info and/or the documentation please?

Five-Damned-Dollarz commented 2 months ago

The ps2_ltb template needs a lot of additional work that I don't want to do at the moment but I threw in a quick change to make the mesh type an enum and activated the pieces loop for the time being.

StenApp commented 2 months ago

Thanks, i‘d like to help but don‘t know how.