Page 1 of 1

.tmd2 UV issues . need help!

Posted: Sat Aug 05, 2023 4:35 am
by kurokozeref
Script used : viewtopic.php?p=166307#p166307
Sample Files : https://drive.google.com/file/d/19kdwSI ... Fr_oq/view
(included the model that have no issues for investigation pl01cos04)


I managed to open it but some of the model will export with super tiny UV (can't be scale, and some UV r just mess up).
The only reason I find out some r fked some r not it's becuz they're from previous game.
but using gintama rumble script the uv still fked
Image
I tried to change rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, vertStride, vertStride - 16)
vertstride - 16 to others number it just crash or still messed

Re: .tmd2 UV issues . need help!

Posted: Sat Aug 05, 2023 12:33 pm
by shakotay2
From what I can see the script sets the UV1BufferOfs to 48 for all submeshes for the sample I checked, but for the first submesh it's 40.
So replacing -8 by -16 (for the troublesome models only!) should do the trick.
.
First submesh only:
pl17Cos00_00_0_1-tmd2.jpg

Re: .tmd2 UV issues . need help!

Posted: Sun Aug 06, 2023 5:39 am
by kurokozeref
shakotay2 wrote: Sat Aug 05, 2023 12:33 pm From what I can see the script sets the UV1BufferOfs to 48 for all submeshes for the sample I checked, but for the first submesh it's 40.
So replacing -8 by -16 (for the troublesome models only!) should do the trick.
.
First submesh only:
pl17Cos00_00_0_1-tmd2.jpg
I changed the bottom script from
rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, vertStride, vertStride - 16)
else:
rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, vertStride, vertStride - 8 )
to
rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, vertStride, vertStride - 16)
else:
rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, vertStride, vertStride - 16)

and for "From what I can see the script sets the UV1BufferOfs to 48 for all submeshes for the sample I checked, but for the first submesh it's 40."
I didn't found any 48 number except self.inFile.seek(0x48, NOESEEK_ABS)

This is the screenshot after i changed the vertstride from 8 to 16. the uv r visible now but still buggy. (Picture model is Pl17Cos00_00_0.cat, mesh 1 in noesis . should be 2nd mesh since noesis start counting from 0)
https://media.discordapp.net/attachment ... /image.png



but yes! Thank you so much! It does fix alot of the face mesh

Re: .tmd2 UV issues . need help!

Posted: Sun Aug 06, 2023 8:57 am
by shakotay2
kurokozeref wrote: Sun Aug 06, 2023 5:39 am I didn't found any 48 number except self.inFile.seek(0x48, NOESEEK_ABS)
That line is not related. It's a matter of formulas. You'll need to be a coder to get this.
The difference between 16 and 8 is 8. Since the original script outputs 48 where it should be 40 the workaround was to subtract 16 instead of 8.

This is an ugly patch only. Should be replaced by correct code. Some day.

I'd suggest to do it mesh-by-mesh - maybe using Hex2obj. Or AMR or ModelResearcher.

Once you got a whole model (of those with uv's error) that way you can think about patching the script.

Re: .tmd2 UV issues . need help!

Posted: Tue Aug 08, 2023 2:22 pm
by nudgenudgenudge
I have never used Noesis so I tried importing its tmd2 file into blender.
After modifying the tmd2 importer script for Neptunia x Senran Kagura, it is now possible to import correctly including UV maps.
I'm not sure if this script is correct in determining data format, but I hope this helps you.

Image

Re: .tmd2 UV issues . need help!

Posted: Mon Aug 14, 2023 12:23 pm
by nudgenudgenudge
I made a noesis script for this tmd2 model.
The uv map is also read correctly in all the sample files.

This addon script may not read files with up to 8 weights per vertex correctly.