DarklightGames / io_scene_psk_psa

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

Support for non-standard chunks and .pskx extension #15

Closed floxay closed 2 years ago

floxay commented 2 years ago

Hey, I just wanted to ask if you would consider adding support for these chunks;

cmbasnett commented 2 years ago

Absolutely. Could you provide an example file with all of these features utilized?

floxay commented 2 years ago

Here's a skeletal mesh with all four of the above mentioned chunks; CS_Sarge_S0_Skelmesh.zip

I'm linking the VTXNORMS chunk block just in case since it is not part of 'vanilla' UEViewer, tho it's pretty straightforward; ExportPsk.cpp#L250-L264

cmbasnett commented 2 years ago

@floxay I added PSKX functionality in pull request https://github.com/DarklightGames/io_scene_psk_psa/pull/17.

Could you have a look and see if it works as advertised on whatever models you might have laying around? This link should work: https://github.com/DarklightGames/io_scene_psk_psa/archive/refs/heads/feature-pskx.zip

I will merge it to main once you give it the thumbs up.

floxay commented 2 years ago

That was fast! Thank you!

One thing I noticed is the vertex colors being incorrect; image

I believe it's due to the lack of conversion between linear and sRGB.

floxay commented 2 years ago

Actually I'm not so sure anymore which one is correct, this is what UEViewer shows; Image: https://user-images.githubusercontent.com/57007485/151123064-2092d803-f08e-4b11-a4ef-46fa7f303176.png

This -at least to me- looks closer to the one this addon imports ...but that would mean that the other two addons are not working properly or with proper data, or simply the viewer in UEViewer is incorrect.

Edit: removed embedded image as it took up too much space.

floxay commented 2 years ago

Apologies for the lengthy thread, I believe I've reached the conclusion.

I enabled cooked content for Unreal Engine and compared the results; image

Looking at the mask and legs it seems that conversion between linear and sRGB is indeed needed and the viewer in UEViewer displays it incorrectly.

The model used for comparison: CS_Stealth_S0_Skelmesh.zip

cmbasnett commented 2 years ago

Interesting. I will add sRGB color conversion as the default behavior later today.

cmbasnett commented 2 years ago

Updated the branch with the sRGBA conversion as the default, as well as adding support for toggling the import of additional data.

image

image

Give it a whirl if you get a chance.

floxay commented 2 years ago

Works flawlessly 👍

cmbasnett commented 2 years ago

This has been merged to main and is part of the latest release release (2.1.0)