Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Fate Extella PsVita *.mdl files

Post questions about game models here, or help out others!
Gashd
ultra-n00b
Posts: 3
Joined: Sun Mar 18, 2018 3:37 pm
Has thanked: 2 times

Fate Extella PsVita *.mdl files

Post by Gashd »

PC version of Noesis script does not work on the vita version of *.mdl files
And how to unpack the *.mdl file

please help me
OT})22_Z~M4RHLJ$L75ZQ3R.jpg
Sample file
http://www.mediafire.com/file/082mvcpa2 ... sv0000.mdl
You do not have the required permissions to view the files attached to this post.
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4286
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1147 times
Been thanked: 2242 times

Re: Fate Extella PsVita *.mdl files

Post by shakotay2 »

Some small patch to Kotcrab's great Noesis script from here: https://github.com/kotcrab/fate-explorer/releases
vita-sv0000-mdl.jpg
Some extra faces which I did not have the time to fix.
(Would need 2 or 3 more model samples to check if the patch is sufficient.)
You do not have the required permissions to view the files attached to this post.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
Gashd
ultra-n00b
Posts: 3
Joined: Sun Mar 18, 2018 3:37 pm
Has thanked: 2 times

Re: Fate Extella PsVita *.mdl files

Post by Gashd »

shakotay2 wrote:Some small patch to Kotcrab's great Noesis script from here: https://github.com/kotcrab/fate-explorer/releases
vita-sv0000-mdl.jpg
Some extra faces which I did not have the time to fix.
(Would need 2 or 3 more model samples to check if the patch is sufficient.)
Thank you very much for your reply and help
This is a sample file you need
http://www.mediafire.com/file/csp0ounfu760bxr/model.zip
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4286
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1147 times
Been thanked: 2242 times

Re: Fate Extella PsVita *.mdl files

Post by shakotay2 »

thanks! Here are the changes to patch into the original script;

####################################################################
be sure to use CORRECT indents, for example 8 blanks. Don't mix in tabs, never ever. You have been warned!
####################################################################

This is the most important change for VITA models; the vxstEntryCount is located 8 bytes earlier (reading 0x10 bytes instead of 0x18):

Code: Select all

        vxstEntryCount = []
        for _, des in enumerate(vxstList):
            bs.seek(des.offset + self.nearOffset, NOESEEK_ABS)
            bs.readBytes(0x10)
Then additional vertexStrides to be inserted (you might insert 19 and 27 and see if it improves anything). The UV1BufferOfs
should be (vertexStride -4 ) for HalfFloats; but pay attention that it's constant (0x18) / doesn't follow the rule in the original code from vstride= 32 and above.

So it was a bit wild guessing; choosing 0x1B for vStride=31 made sense to me (but not tested); for vStride=35 I just decremented 0x18 (for vStride=36) to 0x17; but not sure.

Replace the lines in the original script from
"if vertStride == 24:" to elif vertStride == 36: by

Code: Select all

            if vertStride == 20:  # 
                rapi.rpgBindPositionBuffer(vertBuff, noesis.RPGEODATA_FLOAT, vertStride)
                rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_HALFFLOAT, vertStride, 0x10)
            if vertStride == 23:  #
                rapi.rpgBindPositionBuffer(vertBuff, noesis.RPGEODATA_FLOAT, vertStride)
                rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_HALFFLOAT, vertStride, 0x13)
            elif vertStride == 24:  # 0xC, 0x10 unk floats
                rapi.rpgBindPositionBuffer(vertBuff, noesis.RPGEODATA_FLOAT, vertStride)
                rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_HALFFLOAT, vertStride, 0x14)
            elif vertStride == 28:  # 0xC, 0x10, 0x14 unk floats
                rapi.rpgBindPositionBuffer(vertBuff, noesis.RPGEODATA_FLOAT, vertStride)
                rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_HALFFLOAT, vertStride, 0x18)
            elif vertStride == 31:  # 
                rapi.rpgBindPositionBuffer(vertBuff, noesis.RPGEODATA_FLOAT, vertStride)
                rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_HALFFLOAT, vertStride, 0x1B)
            elif vertStride == 32:  # 0xC, 0x10, 0x14 unk floats, 0x1C unk
                rapi.rpgBindPositionBuffer(vertBuff, noesis.RPGEODATA_FLOAT, vertStride)
                rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_HALFFLOAT, vertStride, 0x18)
            elif vertStride == 35:  # 
                rapi.rpgBindPositionBuffer(vertBuff, noesis.RPGEODATA_FLOAT, vertStride)
                rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_HALFFLOAT, vertStride, 0x17)
            elif vertStride == 36:
For the additional faces: as I said, don't have the time to fix this.

Anyways, HTH
Last edited by shakotay2 on Sat Feb 09, 2019 11:32 am, edited 1 time in total.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
Gashd
ultra-n00b
Posts: 3
Joined: Sun Mar 18, 2018 3:37 pm
Has thanked: 2 times

Re: Fate Extella PsVita *.mdl files

Post by Gashd »

shakotay2 wrote:thanks! Here are the changes to patch into the original script;

####################################################################
be sure to use CORRECT indents, for example 8 blanks. Don't mix in tabs, never ever. You have been warned!
####################################################################

This is the most important change for VITA models; the vxstEntryCount is located 8 bytes earlier (reading 0x10 bytes instead of 0x18):

Code: Select all

        vxstEntryCount = []
        for _, des in enumerate(vxstList):
            bs.seek(des.offset + self.nearOffset, NOESEEK_ABS)
            bs.readBytes(0x10)
Then additional vertexStrides to be inserted (you might insert 19 and 27 and see if it improves anythink). The UV1BufferOfs
should be (vertexStride -4 ) for HalfFloats; but pay attention that it's constant (0x18)/doesn't follow the rule in the original code from vstride= 32 and above.

So it was a bit wild guessing; choosing 0x1B for vStride=31 made sense to me (but not tested); for vStride=35 I just decremented 0x18 (for vStride=36) to 0x17; but not sure.

Replace the lines in the original script from
"if vertStride == 24:" to elif vertStride == 36: by

Code: Select all

            if vertStride == 20:  # 
                rapi.rpgBindPositionBuffer(vertBuff, noesis.RPGEODATA_FLOAT, vertStride)
                rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_HALFFLOAT, vertStride, 0x10)
            if vertStride == 23:  #
                rapi.rpgBindPositionBuffer(vertBuff, noesis.RPGEODATA_FLOAT, vertStride)
                rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_HALFFLOAT, vertStride, 0x13)
            elif vertStride == 24:  # 0xC, 0x10 unk floats
                rapi.rpgBindPositionBuffer(vertBuff, noesis.RPGEODATA_FLOAT, vertStride)
                rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_HALFFLOAT, vertStride, 0x14)
            elif vertStride == 28:  # 0xC, 0x10, 0x14 unk floats
                rapi.rpgBindPositionBuffer(vertBuff, noesis.RPGEODATA_FLOAT, vertStride)
                rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_HALFFLOAT, vertStride, 0x18)
            elif vertStride == 31:  # 
                rapi.rpgBindPositionBuffer(vertBuff, noesis.RPGEODATA_FLOAT, vertStride)
                rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_HALFFLOAT, vertStride, 0x1B)
            elif vertStride == 32:  # 0xC, 0x10, 0x14 unk floats, 0x1C unk
                rapi.rpgBindPositionBuffer(vertBuff, noesis.RPGEODATA_FLOAT, vertStride)
                rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_HALFFLOAT, vertStride, 0x18)
            elif vertStride == 35:  # 
                rapi.rpgBindPositionBuffer(vertBuff, noesis.RPGEODATA_FLOAT, vertStride)
                rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_HALFFLOAT, vertStride, 0x17)
            elif vertStride == 36:
For the additional faces: as I said, don't have the time to fix this.

Anyways, HTH
The script can work with the vita model
Not perfect but still thank you very much for your help
UJ[T_8900LCGQS3${Y{C6OK.png
You do not have the required permissions to view the files attached to this post.
Kotcrab
beginner
Posts: 31
Joined: Fri Jul 28, 2017 10:36 am
Been thanked: 23 times

Re: Fate Extella PsVita *.mdl files

Post by Kotcrab »

I added support for PS Vita models based on this. New script also works on Fate/Extella Link models.

https://github.com/kotcrab/fate-explore ... g/mdl-v1.2
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4286
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1147 times
Been thanked: 2242 times

Re: Fate Extella PsVita *.mdl files

Post by shakotay2 »

jay11800 wrote:Hello, I am trying to apply materials to the MDL files of fate extella link, when I go into noesis my model has 7 materials, all of which have textures, but aren't linked for some odd reason.
you guys! :D Why not just print out the texture path in Noesis?
It uses ".mxt" as texture extension.
If your extension is different for whatever reason then change it, like such:

Code: Select all

            for sstv in sstvList:
                def getTexPath(extension):
                    texPath = self.stringBank[sstv.texPathSid]
                    texNormalizedName = path.splitext(path.basename(texPath))[0]
                    #texFinalPath = rapi.getDirForFilePath(rapi.getInputName()) + texNormalizedName + extension
                    texFinalPath = rapi.getDirForFilePath(rapi.getInputName()) + texNormalizedName + ".png"
                    #print("TexFinalPath: ", cnt, " ", texFinalPath)
                    if rapi.checkFileExists(texFinalPath):  # check in current dir first
                        return texFinalPath, texNormalizedName
Works for me:
ch001_m01_00-mdl.jpg
You do not have the required permissions to view the files attached to this post.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
jay11800
n00b
Posts: 19
Joined: Thu Jul 12, 2018 3:42 pm
Has thanked: 2 times

Re: Fate Extella PsVita *.mdl files

Post by jay11800 »

shakotay2 wrote:
jay11800 wrote:Hello, I am trying to apply materials to the MDL files of fate extella link, when I go into noesis my model has 7 materials, all of which have textures, but aren't linked for some odd reason.
you guys! :D Why not just print out the texture path in Noesis?
It uses ".mxt" as texture extension.
If your extension is different for whatever reason then change it, like such:

Code: Select all

            for sstv in sstvList:
                def getTexPath(extension):
                    texPath = self.stringBank[sstv.texPathSid]
                    texNormalizedName = path.splitext(path.basename(texPath))[0]
                    #texFinalPath = rapi.getDirForFilePath(rapi.getInputName()) + texNormalizedName + extension
                    texFinalPath = rapi.getDirForFilePath(rapi.getInputName()) + texNormalizedName + ".png"
                    #print("TexFinalPath: ", cnt, " ", texFinalPath)
                    if rapi.checkFileExists(texFinalPath):  # check in current dir first
                        return texFinalPath, texNormalizedName
Works for me:
ch001_m01_00-mdl.jpg
So what do I do with this, add it to the python script? I tried that, and nothing happened
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4286
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1147 times
Been thanked: 2242 times

Re: Fate Extella PsVita *.mdl files

Post by shakotay2 »

Uncomment thsi line (delete the #):
#print("TexFinalPath: ", cnt, " ", texFinalPath)
to find out what your problem might be.
In
def registerNoesisTypes():
this line's required: noesis.logPopup()
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
jay11800
n00b
Posts: 19
Joined: Thu Jul 12, 2018 3:42 pm
Has thanked: 2 times

Re: Fate Extella PsVita *.mdl files

Post by jay11800 »

shakotay2 wrote:Uncomment thsi line (delete the #):
#print("TexFinalPath: ", cnt, " ", texFinalPath)
to find out what your problem might be.
In
def registerNoesisTypes():
this line's required: noesis.logPopup()
You do not have the required permissions to view the files attached to this post.
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4286
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1147 times
Been thanked: 2242 times

Re: Fate Extella PsVita *.mdl files

Post by shakotay2 »

yeah, sorry, forgot that I added more lines:

Code: Select all

        cnt= 0
        for mate in materialInfo:

...

                cnt = cnt + 1
                if texFinalPath is None:
                    continue
Take care of correct indents; and use blanks or tabs but no mixing
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
jay11800
n00b
Posts: 19
Joined: Thu Jul 12, 2018 3:42 pm
Has thanked: 2 times

Re: Fate Extella PsVita *.mdl files

Post by jay11800 »

shakotay2 wrote:yeah, sorry, forgot that I added more lines:

Code: Select all

        cnt= 0
        for mate in materialInfo:

...

                cnt = cnt + 1
                if texFinalPath is None:
                    continue
Take care of correct indents; and use blanks or tabs but no mixing
I'm still struggling trying to figure out what to do with this, and where it should go :c
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4286
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1147 times
Been thanked: 2242 times

Re: Fate Extella PsVita *.mdl files

Post by shakotay2 »

what do you mean?

search for the line "for mate in materialInfo:" in the script
and put the line cnt=0 before it.

search for the line "if texFinalPath is None:" in the script; there's two occurences;
put the line
cnt = cnt + 1
before the one which is followed by "continue".

Or, even simpler, just use
print("TexFinalPath: ", texFinalPath)
(should do the trick, the "cnt" is not that important)
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
jay11800
n00b
Posts: 19
Joined: Thu Jul 12, 2018 3:42 pm
Has thanked: 2 times

Re: Fate Extella PsVita *.mdl files

Post by jay11800 »

shakotay2 wrote:what do you mean?

search for the line "for mate in materialInfo:" in the script
and put the line cnt=0 before it.

search for the line "if texFinalPath is None:" in the script; there's two occurences;
put the line
cnt = cnt + 1
before the one which is followed by "continue".

Or, even simpler, just use
print("TexFinalPath: ", texFinalPath)
(should do the trick, the "cnt" is not that important)
Ok, I did it exactly like I think you are saying it goes, and I get this now
You do not have the required permissions to view the files attached to this post.
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4286
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1147 times
Been thanked: 2242 times

Re: Fate Extella PsVita *.mdl files

Post by shakotay2 »

dunno, what's going wrong there-
Maybe you should follow Kotcrab's tip:
Kotcrab wrote:If you want textures automatically loaded in Noesis you just need to open .mdl file from original extract directory without renaming or moving anything.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
Post Reply