XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Thu Apr 27, 2017 2:27 am

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Persona 5 Model and Animation importer v0.8.1 - MaxScript -
PostPosted: Fri Oct 14, 2016 12:45 am 
Offline
veteran

Joined: Wed Jun 04, 2014 7:48 pm
Posts: 106
Location: Netherlands
Has thanked: 19 times
Have thanks: 27 times














You can make the ads go away by registering

I'm sharing my mostly complete but still very much a WIP MaxScript (well, set of scripts) to load Persona 5's (and P4D) animations and models.

Progress log:
  • 13/10/2016: Version 0.8 released
    - Initial release

  • 14/10/2016: Version 0.8.1 released
    - Fixed typos, issues with declaration order and other oversights due to Max not clearing its own memory properly
    - Improved consistency between files

Features:
  • Proper loading of meshes and materials (additional info in the listener window)
  • Rigging is applied
  • Weapon, character and level models are supported and..
  • Level textures are converted from their custom format into DDS (this requires you to keep the original folder structure intact)
  • Partial animation support. For now it only loads the first animation in a .GAP file. Sometimes GMD files also contain animations but those will be skipped.
  • Some MaxScript code you might find useful if you're into developing scripts yourself
  • Also loads models from Persona 4 Dancing All Night, but does not yet support loading the faces (p5 doesn't use them)

Current issues:
  • Some models are displaced, and I cannot find the reason as to why. Be sure to check your models thoroughly! If you have any idea, please let me know.
  • Materials load properly but their parsing is mostly brute forced and can possibly break. Figuring these out has proven to be quite difficult. Again help would be appreciated.
  • Some models don't load because of embedded particles (most of the enemies in p5). I don't know how to parse these, so until then models containing these will not load.
  • Rare bug that causes garbage face data to appear, I'm not sure as to why this happens.
  • Due to use of FileIn to seperate code, the script will now no longer work when run in the editor (Evaluate All).
    In fact, it will completely corrupt 3ds Max's MaxScript memory. Thanks Autodesk

Important notes:
This script is developed for 3ds Max 2016. If you have any issues other than the ones listed above, please make sure you're using this version. I do not intend to support older versions of Max as anyone can get a free download of the latest one and quite a few MaxScript features are blatantly broken in them.
Oh yeah, please retain the folder structure, otherwise the script won't work. All files are needed.

Special Thanks
  • Atlus for finally (Winter 2014 *cough*) delivering Persona 5
  • Pan for the preload dump of p5
  • PolarSoda for his P4D script
  • mrdudesworkshop for his findings on the animation structure

Download

I hope you enjoy these models as much as I enjoyed (and still do!) working on them.
Eventually I plan on putting custom models into the game, but until then my MaxScript will serve to help me reverse this format.

Cheers.

Image


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.



Last edited by TGE on Fri Oct 14, 2016 4:06 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: Persona 5 Model and Animation importer v0.8 - MaxScript
PostPosted: Fri Oct 14, 2016 8:35 am 
Offline
advanced

Joined: Sat Apr 19, 2014 8:02 am
Posts: 67
Has thanked: 37 times
Have thanks: 6 times
Thanks for the release. I hope I can get this working but for now I'm getting an error in the script listener when I load a model (same for all character models)

GFSFileLoader.Load: Chunk 0x1 ver: 0x1105070 sz: 0x0 at 0x4L
GFSFileLoader.Load: GFS start marker chunk

GFSFileLoader.Load: Chunk 0x100fc ver: 0x1105070 sz: 0xb6c45 at 0x10L
GFSFileLoader.ReadTextureList: Loading 15 textures

GFSFileLoader.ReadTextureList: Texture "c0001_t01_face01b_low.dds" fmt 0x1 sz 0xaa80 off 0x45L
GFSFileLoader.ReadTextureList: Writing to E:\Modeling\Persona 5\JP0005-NPJB00769_00-HDDBOOTPERSONA05_bg_1_0682bac23263ecd6e3416c91188109072b9f503f\NPJB00769\USRDIR\model\character\0001\c0001_t01_face01b_low.dds

"-- Runtime error: Struct member access requires instance: CreateWriteableFileStream"

I just installed Max 2016 (thanks for that heads up btw) so it's possible I goofed something. That long ass folder structure was just me moving the files back into the extracted pkg folder to see if it needed to be there. Same error happened when I had the extracted cpk elsewhere.

Edit: I tried several models and all returned this error. It does load weapons and items but nothing from the character folder.


Top
 Profile  
 
 Post subject: Re: Persona 5 Model and Animation importer v0.8.1 - MaxScrip
PostPosted: Fri Oct 14, 2016 4:05 pm 
Offline
veteran

Joined: Wed Jun 04, 2014 7:48 pm
Posts: 106
Location: Netherlands
Has thanked: 19 times
Have thanks: 27 times
Thanks for the report. I hopely have fixed the issues with the new revision. The download link has been updated.


Top
 Profile  
 
 Post subject: Re: Persona 5 Model and Animation importer v0.8.1 - MaxScrip
PostPosted: Fri Oct 14, 2016 5:32 pm 
Offline
advanced

Joined: Sat Apr 19, 2014 8:02 am
Posts: 67
Has thanked: 37 times
Have thanks: 6 times
Yup. Ran several character models through and each seemed to load fine with correct textures, skeleton and weights. Will spend more time over the weekend playing around with stuff. Thanks for the quick update!


Top
 Profile  
 
 Post subject: Re: Persona 5 Model and Animation importer v0.8.1 - MaxScrip
PostPosted: Mon Oct 17, 2016 10:27 pm 
Offline
advanced

Joined: Sat Apr 19, 2014 8:02 am
Posts: 67
Has thanked: 37 times
Have thanks: 6 times
So over the weekend I loaded and at least looked at each model in the character folder. Each character seemed to have one model that wouldn't load which I'm guessing has to do with the issue with embedded particles as you mentioned in the OP. That aside, everything seemed to be fine. Weights looked good (had to reparent a couple leg bones to get a single, working leg bone but that's not a script issue) and textures looked fine as well.

That aside, I do have an issue with something that I'm guessing has more to do with Max16 than your script. Exporting the models to .fbx, which should be a great format, screws up some of the UV maps. They are fine in Max and even exporting to other formats seems to keep the UV mapping correct. It's nothing major requiring massive work to fix manually, just a section or two would get separated from the main UV map and get placed somewhere else. Pretty much every model I exported had a small section on the top of their eyes out of place and a few places on the body/hair. An easy, but irritating fix. Dunno what the issue could be though.

Edit: Forgot to mention. Haven't been able to try out DLC costumes that aren't included in the main game. Haven't been able to get my hands on them.


Top
 Profile  
 
 Post subject: Re: Persona 5 Model and Animation importer v0.8.1 - MaxScrip
PostPosted: Wed Oct 19, 2016 3:49 pm 
Offline
n00b

Joined: Wed Apr 09, 2014 4:50 am
Posts: 11
Has thanked: 0 time
Have thanks: 0 time
Thanks for the release. I hope I can get this working but for now I'm getting an error in the script listener when I load a model in character\enemy\

GFSFileLoader.ReadNode: Reading node at 0x1ed33eL
GFSFileLoader.ReadNode: Node "rot" hash: 0xe03ec02a attachmentCount: 0

GFSFileLoader.ReadNode: Reading node at 0x1ed37cL
GFSFileLoader.ReadNode: Node "Bip01" hash: 0x76946249 attachmentCount: 0

GFSFileLoader.ReadNode: Reading node at 0x1ed3bcL
GFSFileLoader.ReadNode: Node "Bip01 Footsteps" hash: 0xa714e2ba attachmentCount: 1

GFSFileLoader.ReadNode: Attachment #1 Type: 7
"0x1ed401L"
"-- Runtime error: GFSFileLoader.ReadNode: Can't handle this attachment type
"


Top
 Profile  
 
 Post subject: Re: Persona 5 Model and Animation importer v0.8.1 - MaxScrip
PostPosted: Sun Oct 23, 2016 8:13 am 
Offline
veteran

Joined: Wed Jun 04, 2014 7:48 pm
Posts: 106
Location: Netherlands
Has thanked: 19 times
Have thanks: 27 times
liuxing wrote:
Thanks for the release. I hope I can get this working but for now I'm getting an error in the script listener when I load a model in character\enemy\

GFSFileLoader.ReadNode: Reading node at 0x1ed33eL
GFSFileLoader.ReadNode: Node "rot" hash: 0xe03ec02a attachmentCount: 0

GFSFileLoader.ReadNode: Reading node at 0x1ed37cL
GFSFileLoader.ReadNode: Node "Bip01" hash: 0x76946249 attachmentCount: 0

GFSFileLoader.ReadNode: Reading node at 0x1ed3bcL
GFSFileLoader.ReadNode: Node "Bip01 Footsteps" hash: 0xa714e2ba attachmentCount: 1

GFSFileLoader.ReadNode: Attachment #1 Type: 7
"0x1ed401L"
"-- Runtime error: GFSFileLoader.ReadNode: Can't handle this attachment type
"


Attachment type 7 is the type of the embedded particles, as pointed out by the OP those do not import yet.

ssringo wrote:
So over the weekend I loaded and at least looked at each model in the character folder. Each character seemed to have one model that wouldn't load which I'm guessing has to do with the issue with embedded particles as you mentioned in the OP. That aside, everything seemed to be fine. Weights looked good (had to reparent a couple leg bones to get a single, working leg bone but that's not a script issue) and textures looked fine as well.

That aside, I do have an issue with something that I'm guessing has more to do with Max16 than your script. Exporting the models to .fbx, which should be a great format, screws up some of the UV maps. They are fine in Max and even exporting to other formats seems to keep the UV mapping correct. It's nothing major requiring massive work to fix manually, just a section or two would get separated from the main UV map and get placed somewhere else. Pretty much every model I exported had a small section on the top of their eyes out of place and a few places on the body/hair. An easy, but irritating fix. Dunno what the issue could be though.

Edit: Forgot to mention. Haven't been able to try out DLC costumes that aren't included in the main game. Haven't been able to get my hands on them.


Might have to do with the presence of multiple uv channels, not sure. I'd have to mess with that.


Top
 Profile  
 
 Post subject: Re: Persona 5 Model and Animation importer v0.8.1 - MaxScrip
PostPosted: Mon Oct 24, 2016 10:10 am 
Offline
n00b

Joined: Mon Oct 21, 2013 7:43 pm
Posts: 18
Has thanked: 7 times
Have thanks: 0 time
Seems like P5 models have messed up bone links, any chance for that getting worked on?


Top
 Profile  
 
 Post subject: Re: Persona 5 Model and Animation importer v0.8.1 - MaxScrip
PostPosted: Mon Oct 24, 2016 5:51 pm 
Offline
ultra-veteran
ultra-veteran
User avatar

Joined: Tue May 16, 2006 10:55 pm
Posts: 588
Location: Czestochowa, Poland
Has thanked: 12 times
Have thanks: 14 times
I still can't get the files extracted from the cpk archives honestly.

I' only get this error after a certain point in the extraction, it doesn't get to characters or environments, and ps3.cpk is just odd, the tool doesn't even notice there anything in it.
Image

PC is set to run things in Japanese if non-unicode, so I'm all out of ideas.

Running windows 10 to be clear.

_________________
"Lemons are people nice hardworking & honest people too..."


Top
 Profile  
 
 Post subject: Re: Persona 5 Model and Animation importer v0.8.1 - MaxScrip
PostPosted: Wed Oct 26, 2016 5:10 pm 
Offline
veteran

Joined: Wed Jun 04, 2014 7:48 pm
Posts: 106
Location: Netherlands
Has thanked: 19 times
Have thanks: 27 times
Rin wrote:
Seems like P5 models have messed up bone links, any chance for that getting worked on?

There's nothing wrong with the bone links. You have to move both the limb and helper bone together to bend the limbs. They just used a weird IK setup.


Top
 Profile  
 
 Post subject: Re: Persona 5 Model and Animation importer v0.8.1 - MaxScrip
PostPosted: Sat Oct 29, 2016 3:14 pm 
Offline
ultra-veteran
ultra-veteran
User avatar

Joined: Tue May 16, 2006 10:55 pm
Posts: 588
Location: Czestochowa, Poland
Has thanked: 12 times
Have thanks: 14 times
Is anyone able to help with the CPK extraction error at all?

_________________
"Lemons are people nice hardworking & honest people too..."


Top
 Profile  
 
 Post subject: Re: Persona 5 Model and Animation importer v0.8.1 - MaxScrip
PostPosted: Tue Nov 01, 2016 10:51 pm 
Offline
veteran

Joined: Wed Jun 04, 2014 7:48 pm
Posts: 106
Location: Netherlands
Has thanked: 19 times
Have thanks: 27 times
lionheartuk wrote:
Is anyone able to help with the CPK extraction error at all?

It might have to do with your system locale as neither me nor others seem to get the error you're seeing.


Top
 Profile  
 
 Post subject: Re: Persona 5 Model and Animation importer v0.8.1 - MaxScrip
PostPosted: Wed Nov 02, 2016 1:01 am 
Offline
advanced

Joined: Sat Apr 19, 2014 8:02 am
Posts: 67
Has thanked: 37 times
Have thanks: 6 times
lionheartuk wrote:
Is anyone able to help with the CPK extraction error at all?


Did you get the game directly from PSN or did you torrent a modded version? Are you using some fan created/edited tool to extract the cpk files and if so, which one?

I can tell you that using the official files and tools straight from the source have no issues as far as extraction purposes go.

Edit: Don't see why your locale would cause issues. At least during the extraction process. If locale was an issue it should have given an error pretty much immediately. I mean, it's worth changing your locale to English (US) just to see.


Top
 Profile  
 
 Post subject: Re: Persona 5 Model and Animation importer v0.8.1 - MaxScrip
PostPosted: Wed Nov 02, 2016 4:25 pm 
Offline
ultra-veteran
ultra-veteran
User avatar

Joined: Tue May 16, 2006 10:55 pm
Posts: 588
Location: Czestochowa, Poland
Has thanked: 12 times
Have thanks: 14 times
ssringo wrote:
lionheartuk wrote:
Is anyone able to help with the CPK extraction error at all?


Did you get the game directly from PSN or did you torrent a modded version? Are you using some fan created/edited tool to extract the cpk files and if so, which one?

I can tell you that using the official files and tools straight from the source have no issues as far as extraction purposes go.

Edit: Don't see why your locale would cause issues. At least during the extraction process. If locale was an issue it should have given an error pretty much immediately. I mean, it's worth changing your locale to English (US) just to see.


My Locale is already set to Eng US on this machine so its not that.

I'm using the tool TGE linked me in the previous thread.

As for the game itself, I live in Japan so I grabbed it on release and dumped it, its not modded or anything like that though.

One thing I AM using though is a .bat file, because for the life of me typing the actual commands mentioned in the document.

Even when I type it exactly as the tool says, it doesn't work.

something I should mention is I deleted the PS3.cpk file, the tool read nothing at all from it anyway, so it'll suck if I find out that the other 2 files use that ps3.cpk file to get some data from and thats why I have this error.

_________________
"Lemons are people nice hardworking & honest people too..."


Top
 Profile  
 
 Post subject: Re: Persona 5 Model and Animation importer v0.8.1 - MaxScrip
PostPosted: Wed Nov 02, 2016 9:49 pm 
Offline
advanced

Joined: Sat Apr 19, 2014 8:02 am
Posts: 67
Has thanked: 37 times
Have thanks: 6 times
Sorry, mispoke about locale. Doing this from my phone do i can't look at the pc settings directly. Meant to say the setting that causes ¥ to display instead of / in the file path (as shown in your screenshot). Something something unicode. Again, don't see why it would be an issue since it didn't error out immediately. Just something that's obviously different.

Dunno what TGE gave you to use but it's likely not what i used to extract the cpk files. If it worked for him it should work for you. I have the tool licensed from criware so it damn sure doesn't have an issue reading and extracting the format :D

The copy of the game i used was downloaded straight from psn to my pc and extracted with pkg extracting tools. Dunno if or why a dump of the game would be different but yeah, it's not what i used.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group