Importing animations from any other P4G model onto The Culprit's Battle model are flipped 90 deg.

Describe your problem in as much detail as you can. Other users might help.
Post Reply
User avatar
Fortuna
Posts: 11
Joined: Mon Mar 01, 2021 12:16 am
Has liked: 5 posts
Been liked: 4 posts

So I was trying to add some animations from one Persona Golden model (Naoto) onto another (Adachi) using P4GModelConverter.

I followed the typical workflow:
-.GMO onto first box
-.MDS onto middle Box
-Right click and Add the new anim .mds and use up and down keys to the replace desired old anims etc.
-Click update, then drag new .MDS onto right square to make the updated .GMO model.

The good news is the new anims looks way better than expected,so hooray!

Image


The bad news is that for those anims the model now appears upside-down.

Image

Does anyone have any idea what I might be doing wrong?
(I know I've got like, 50 animations loaded, this is just for demonstrative purposes so for this one I haven't bothered to re-order or delete extra anims.)

P4GModelConverter Settings:
Image
Last edited by Fortuna on Fri Jan 21, 2022 7:42 pm, edited 1 time in total.

Tags:
User avatar
Iredc
Posts: 9
Joined: Wed Jun 02, 2021 5:00 am
Been liked: 6 posts

How did you extract the .gmo? I recall that, when you exported models using Noesis, you needed to check the "Flip 90 degrees" box.
User avatar
Fortuna
Posts: 11
Joined: Mon Mar 01, 2021 12:16 am
Has liked: 5 posts
Been liked: 4 posts

I export the .GMOs with Amicitia!
-If you drag the .PAC file onto it then you can export the file called "MODEL_DATA" with the typed extension of ".GMO".
-I have also tried to export the GMOs from the PAC files with P4GMOdel BETA, but it still gives me the same results when I add another model's animations...

I've tried to use Noesis in the past to export a .GMO (with the 'flip 90 degrees' option checked,) but I can't export it to a GMO (its not an option). All I can do is export it to other file extensions such as .fbx
-But when I try to put the .FBX file through P4GMOdel Converter it never is able to load the animations from .fbx file's generated .MDS file...
------------
The reason I'm doing this is that currently writing a guide on adding your own custom team members into P3P, including changing Busts, voice files, text files, Battle cutins etc,
-and knowing how to add animations to the new model is important, because otherwise if the model doesn't have the animation it needs (like a guarding animation) it just T-poses...
I thought it would be simple to just load up Adachi's model and add Naoto's Guard animation to him. And it does work, it's just now that specific animation flips him 90 degrees onto his back while he does it...

Honestly it seems that P4GMOdel BETA has a lot of promise, but it will never let me add another .MDS animation file to a model without crashing everytime...

I've seen mods floating around with like, Yu Narukami with FEMC's animations and vice versa, how are people managing to do it without the model turning upside-down?
I feel like this should be really simple but I'm bungling it somehow. Feels like I've spent like 3 hours trying different combinations and 3 different programs, converting things back and forth but I just can't seem to do it... T-T
User avatar
Fortuna
Posts: 11
Joined: Mon Mar 01, 2021 12:16 am
Has liked: 5 posts
Been liked: 4 posts

Okay, very strange update!

So, I was testing more models for animation swapping, and I found I was able to add Margaret's (p4) animations to Elizabeth's model (p3p) with 0 issues.
THEN I even added Naoto's animations to the Elizabeth/Margaret hybrid model, AND IT WORKS.
Everything works the way I thought it was supposed too, it turns out that the problem is specifically with Adachi's model???
Image

I thought that there was some issue with one of the programs flipping one of the models, but no, clearly all the models are not upside-down, only Adachi's is??
So I decided to root through some of my dumped files to see if the P4G PC version of Adachi's model animations are also upside-down.
I found a PC model (from a data dump downloaded from this site like a year ago lol), and yes, it is upside-down!
Image

Adachi tends to be one of the more modded characters, has this not been noticed before?
What's stranger also is that in the past, I've renamed Adachi's battle model and pasted it over yukari's, and played P3P with the model looking and acting not upside-down at all..

I'm really pleased that the.GMO editing programs are working as intended, and that I wasn't using them wrong to get upside-down models, but this kind of leaves me with a bigger question about why only Adachi's model is like this...

Does anyone have any ideas? If I had to take a guess, maybe the game is able to automatically position a model right-side up even if that model is flipped, but when the model has animations that are on a different axis's it snaps the model down for that animation...

Also, if you want to try replicating my "Swapping animations between models" proceedure, the steps are:
Spoiler
-go to the folder with battle models:
data00006\model\pack
-Find and drag file: em109.pac into Amicitia, then expand the directory and right click 'MODEL_DATA'
-Export as file name Adachi.GMO

-Do the same for bc007.pac and name Naoto.GMO

-Open P4GModel COnverter and check all the 1st column boxes, check 'load animations' box on second column, uncheck 'fix for PC'
-drag Adachi.GMO onto the 1st square, grab the.mds it created and drag onto 2nd square.
-A list of animations will load on the right and a new mds called "_p4g.mds" will be created.


-Open P4GModel BETA and Drag Naoto.GMO onto and it'll auto generate an.MDS

-Back in P4GModel COnverter Right click over the animation list and select 'add'.
-Select the new.MDS you created with BETA.

-Naoto's animations are now added below Adachi's on the list
-Press the "Update MDS Animations button".
-Drag the _p4g.mds onto the last square and it will generate a "_p4g.GMO" file, which will be Adachi's model with his animations, and also Naoto's animations.

-You can view the animations by dragging the _p4g.GMO into Noesis, and in the top tab selecting: Tools > Data Viewer
-The window that pops up will have several "+" next to words, click the + next to Animations.
-The list that now shows are all the animations, and clicking on the name will play the animation over the model.
-See the difference between the animations with adachi's name vs the animations with Naoto's name. Naoto's are 90 degrees flipped....
^^^^^^^^^^ I'd like to fully write a guide on this, and the above steps DO work (see the pics, it worked with Margaret and Elizabeth), but only when you aren't involving Adachi's model... It's so wierd...

I'd really appreciate any help with this!
Last edited by Fortuna on Wed Jan 19, 2022 12:01 pm, edited 1 time in total.
User avatar
Iredc
Posts: 9
Joined: Wed Jun 02, 2021 5:00 am
Been liked: 6 posts

It's really strange, indeed. I've imported Yu's animations into Adachi's normal model without issues. Maybe it's because you're using Adachi's battle model?

My workflow was a bit different, though.
First, I converted both .gmo to .mds with the option "convert to fbx: fbxascii".
Then I went to "Load animations: import" and imported only the secondary .mds (in this case Naoto). I renamed the animations (so they don't get confused with the originals) and deleted the ones I didn't need.
Then I clicked on the Fix Mds box (with the option Load Animations selected) and opened the base .gmo (Adachi). I updated and ordered the animations. Then I exported them to a separate .mds, which contains the combined animations.
After that, I closed and opened again GMOdelConverter. Click on Fix MDS without the Load Animations selected. I opened the base .gmo. Click on Load Animations and Auto update MDS, then imported the animations from the .mds that contains the combination.
Then, I clicked Convert to GMO and selected the .mds that ends in _p4g.
Finally, I converted this last .gmo to .AMD using the GMO2AMD tool.
User avatar
Fortuna
Posts: 11
Joined: Mon Mar 01, 2021 12:16 am
Has liked: 5 posts
Been liked: 4 posts

Yeah, I'm now fully convinced that it's excusively Adachi's Battle model that is rotated like this. No other battle model (Maragaret. Elizabeth, Naoto, Yosuke, Kanji etc) that I tested had this issue.

However, I did make a bit of progress!

So I decided to open both adachi's and maragaret's MDS in Notepad and comb through them to see if I could locate the difference between the models that was rotating adachi.
(I picked Margaret over Naoto because she'd be more similar to Adachi in structure as a fellow boss battle enemy.)

Turns out the culprit might just be a few of the "RotateZYX" values!
So I copy and pasted 4 of Margaret's RotateZYX Bone values over Adachi's, saved it, and used that .MDS to get a GMO.

Now when I try to add other character animations onto it?
Looking at Noesis, everything appears to be working. The model isn't rotating when it plays Naoto's animations.

Image

Specifically these were the values, and this is what I did:
Spoiler
Change the RotateZYX values for 4 of Adachi's bones by opening up his .MDS file in a text editor.

Original rotation values that need to be changed:

Bone "adachi_root_Bone"
RotateZYX -0.000000 -0.000000 3.141593
Bone "rot_Bone"
RotateZYX 1.570796 -0.000000 -0.000000
Bone "body_Bone"
RotateZYX -0.000000 -0.000000 -0.000000
Bone "Bip01_Bone"
RotateZYX -1.570796 -0.000000 -1.570795

****Note: For "body_Bone" you may need to scroll down a bit to find the RotateZYX on this one, it's below like 200 rows of numbers. worst case use "ctrl+F" to search for it.

-Open up Maragaret's .MDS and copy, find the 4 Bones listed above, then copy and paste her specific Bone RotateZYX values over adachi's.
-Now they should look like this:

Bone "adachi_root_Bone"
RotateZYX 0.000000 0.000000 3.141593
Bone "rot_Bone"
RotateZYX 0.000000 0.000000 0.000000
Bone "body_Bone"
RotateZYX 0.000000 0.000000 0.000000
Bone "Bip01_Bone"
RotateZYX 0.000000 1.570795 0.000000

-Now save the .MDS and there we go. Adachi's little flipped problem is now fixed. He'll be perfectly compatible with other model's animations now.

(Technically I have no idea if ALL 4 of those NEED to be changed, but hell if I'm going to spend another minute on this but better safe than sorry!)
It only takes like 3 minutes to edit those 4 values in Adachi's .MDS file.
Now everything's fixed!
Or at least that's what I thought. Everything looked great in Noesis, BUT...

When it's in P3P there's one small problem:

When the model changes from an original adachi animation to an imported Naoto animation there's this brief second where the entire model lunges forward and rotates 90 degrees. Then it plays the imported animation normally. When the animation stops it again rotates 90 degrees briefly for a second, then returns to the original animation.

You can imagine how this looks when the model goes from standing idle to running, with that happening everytime.

-Quick clip showing this:


I was so close -it really seemed like I had it this time...
Did I miss changing one of the RotateZYX for the model parts? Or does it have more to do with some value under one of adachi's OG animations needing to be changed? This is clearly happening during some kind of 'inbetween/transistion' frame between animations...
Or maybe I just wasn't able to change ALL of the original rotation values fully...?



Either way, what I do think, is that while editing as many of the RotateZYX's I can find helps a bit, trying to rotate the model manually by editing a text file is probably a terrible substitute for just being able to open the model in a 3d editing program, flip it forward 90 degrees, and then export it back as a .GMO/.MDS file without screwing up the textures, animations, and bones...

Unfortunately, while I dabble with blender occasionally I've never been able to import, edit, and export a Persona character model back out without breaking it in some way
(actually made a post for help with exporting persona models from blender without breaking them like a year ago which sadly never really got resolved lol:
viewtopic.php?f=3&t=858 )

SO, at this point I think I'm stuck until either:

1. Someone makes a guide on how to rotate a Persona 4 model 90 degrees and export it safely.
2. I just offer like 15$ to anyone that can rotate Adachi's battle model forward 90 degrees without breaking the bones/anims/textures. (seriously, why is only his battle model not of the same orientation as all the others??)...
(Actually, am I allowed to make an offer like that here?)

lol but yeah, that's about where I am.

----------

If anyone's interested, I'm going to include The PC adachi battle model I've tried rotating (the one showcased in my clip above), as well as the orignal un-edited one.
Naoto's and Maragaret's are also there:
https://ufile.io/f/9iqag

NOTE: if anyone decides to test the adachi.pac I provided, the animations are slightly out of order. I haven't bothered to re-order them with a tool yet because what's the point if I can't fix the model rotating like that first xD
The idle and running anims are in proper order though, and that's what I've been looking at when testing.

2xNOTE: I edited the title of the post because now we know this issue is not with P4G Converter but rather Adachi's batttle model/anims being rotated compared to all the others.
User avatar
Iredc
Posts: 9
Joined: Wed Jun 02, 2021 5:00 am
Been liked: 6 posts

I haven't achieved much about fixing the issue. But I found out that this isn't exclusive to Adachi. When trying to add one of Margaret's animations (from model n5001, which is npc Margaret, and not a battle model) to Yu (model n60) it happened the same. Margaret's animation rotated the model.

Maybe the issue is in the animation itself and not the whole model? After all, the original models look all fine in Noesis. Maybe some animations are designed for a specific skeleton, and if It doesn't match exactly, It snaps the model to grid.

Or maybe the models only support a limited number of animation frames, so if you add too many extra animations, it breaks. Have you tried deleting some of Adachi's animations before importing Naoto's?

EDIT: I fixed the problem, at least in the case of Margaret's animations (though I haven't tested It in game, only in Noesis). The trick is taking the .gmo you want to import animations from (Naoto) and open It in GMOdelConverter to remove unwanted animations. Then create a new .gmo. You open this cleaned-up .gmo in Noesis, and export It as .fbx with the flip 90 degrees option selected. To create the .mds from the .fbx select "fbxoldexport" in GMOdelConv.
The reason I had to remove unwanted animations beforehand, is because upon converting to .fbx, all animations are bundled together and can't be separated anymore.

The .mds of the base model (Adachi) is made as usual. And adding the extra animations to the base model is also done as usual. The difference is that now, you haven't rotated the base model at all, only the imported animations. Maybe this will fix the strange glitch in-game. But as I said, I didn't check It yet.
Post Reply
cron

ShrineFox 2020 - 2023
Support | Progress | Labs | Privacy | Terms
This site is NOT affiliated, associated, authorized, endorsed by, or in any way officially connected with Atlus Co., Ltd, Atlus U.S.A., Inc. or Sega Games Co., Ltd, or any of its subsidiaries or its affiliates.