Gildor's Forums

Author Topic: mirrors edge static mesh, duplicate uv sets?  (Read 7870 times)
leiferiksson
Newbie
*
Posts: 1


View Profile
mirrors edge static mesh, duplicate uv sets?
« on: September 25, 2013, 23:10 »

Hi Gildor,

I've exported the mirrors egde package P_RooftopStructures with your current version of umodel. If I start the viewer I am able to toggle between the two uv sets using 'u' for example for the static mesh S_RooftopStructure_02.psk. I've loaded the psk file in blender using io_import_scene_unreal_psa_psk.py. In this python file there is this section:

#==================================================================================================
    # UV
    #==================================================================================================
    #read the VTXW0000 header
    indata = unpack('20s3i', pskfile.read(32))
    recCount = indata[3]
    printlog("Nbr of VTXW0000 records: " + str(recCount)+ "\n")
    counter = 0
    UVCoords = []
    #UVCoords record format = [index to PNTS, U coord, v coord]
    printlog("[index to PNTS, U coord, v coord]\n");
    while counter < recCount:
        counter = counter + 1
        indata = unpack('hhffhh', pskfile.read(16))
        UVCoords.append([indata[0], indata[2], indata[3]])
        printlog(str(indata[0]) + "|" + str(indata[2]) + "|" + str(indata[3]) + "\n")
        #print('mat index %i', indata(4))
        #print([indata[0], indata[2], indata[3]])
        #print([indata[1], indata[2], indata[3]])

This section reads in the uvs and you can see in the debug file that there are two sets of uvs being processed but if you compare these two sets for example the first 151 uvs of each set then the coordinates are the same, so they must have been written in the file two times the same. Do you know of any issue in your code which could cause that or any other influence which could result in that.

Any help would be appreciated

many thanks

Regards

- leif eriksson
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7957



View Profile WWW
Re: mirrors edge static mesh, duplicate uv sets?
« Reply #1 on: September 25, 2013, 23:21 »

Hi.
UVs are stored in VTXW0000 section in structure containing vertex and material index as well. If mesh has additional UV sets, they're stored in EXTRAUVS0, EXTRAUVS1 etc sections appended to the end of file. This structure holds 2 floats only, just UV information. Code which you've provided doesn't have EXTRAUVS processing, so perhaps you're wrong - most likely psk file is ok, but (Blender's?) script is not.
Logged
Jump to:  

Powered by SMF | SMF © 2006-2009, Simple Machines LLC
Leviathan design by Bloc | XHTML | CSS