Robert-N7 / abmatt

ANoob's Brres Material Tool for Mario Kart Wii
GNU General Public License v3.0
14 stars 3 forks source link

Fix some textures not getting rescaled #51

Closed Heath123 closed 3 years ago

Heath123 commented 3 years ago

Fixes #43 It happened because it looped over the list of textures, being in this case (with orl being the broken dog picture) ['smk', 'orl'] It started with the first element, smk, which it rescaled. First it removed the original from the model: ['orl'] Then it added back the rescaled one: ['orl', 'smk'] But wait - the list has been reordered! So when the loop gets to the second element, it checks smk again, sees that it's now fine, and skips orl entirely, leaving it broken. This fixes the issue by using names instead of indexes to loop over it, so it works with a reordered list. This could also be fixed by making the replacement not reorder the list. I tried to use list comprehensions which I haven't used used before so it might be a bit of a mess, feel free to do it a cleaner way