P4GModelConverter failing to load animations from .smd?

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

Like the title says, I'm trying to use the P4GModelConverter to combine a slightly edited model with that model's animations, back into 1 GMO for use in P4G PC.
I'm fairly certain that it's my fault though, there must to be some issue with my current process that's getting me stuck here.

Also, I understand there's actually been a fair bit of P4 and P3 model editing but there seem to be very few guides (many seem to have been lost in multiple forum closures over the years) and the ones that remain seem outdated and not compatible with many of the new tools people have come up with. I'd like to write a little tutorial/guide here for exporting editing, and repacking these P4G models (since I haven't been able to find one), but I've found myself stuck at the last step of re-importing the edited .smd models back into .gmo through the P4GModelConverter...

It's actually a fairly simple process, so I'm hoping if I list it here, someone with more knowledge can point out why this hasn't been working, and then maybe I can rework/finish this guide and post in the 'Guides' section of the forum...

===========================================================================================

Extracting models, editing them in blender, then importing them back into the model files
----------------------------------------------------------------------------------

1.EXPORT THE MODEL FILE:

-Go to the directory of model\pack and copy the file you want to edit into a new folder.
-For the example in this guide it will be Yukiko's Battle Gekko costume, it's "bc004_c4.pac"

-drag the .pac into Amicitia
-Click on the + squares in the left directory unil you see "MODEL_DATA" show up.
-Right click it and Export MODEL_DATA, but make sure to name it a name you'll recognize, and also add on the extension: .gmo
-drag the new .gmo into Noesis
-In the top right click File>export -change the "Main output type:" to .smd
(I've tried several different file types and honestly this seems like the only one that's been working so far...)

-Click Export.

>This will result in 1 .smd that has the model(out.smd), and 1 .smd that has the animations (out_mainsequence.smd) as well as some pngs that are the exported textures for the model.


2.IMPORTING AND EDITING THE MODEL IN BLENDER:

-Download and open blender vers. 2.80 or later.
-Download the Source Tools. (http://steamreview.org/BlenderSourceTools/)
-Don’t unzip.

Installing the 'Source tools' addon in Blender (necessary to import .smd):

Select Edit > Preferences
Move to the Add-ons tab
Click Install... at the top-right of the window
Find the downloaded zip file and select it (Double click)
'Blender Source Tools' should be the only add-on shown if installed correctly. Check the box to the left and wait a moment for activation to complete.

-Time to bring in the model.
-File>import>.smd
-Choose the model .smd
-make sure the options on the bottom left have the "Up Axis" set as Y
-Make sure "Import Animations" is checked

-now import the animations .smd -follow the same instructions as above.

-Edit the model
***NOTE: I'm not sure exactly how much you can edit without risking causing issues. For this example, I want to get rid of the glasses on Yukiko's battle model (mostly just as a test, in the future I'd like to experiment a bit with removing hats, and maybe swapping hair models. For now though I'm just trying to make sure I can get these edited models back into the game before I start putting a lot of effort into serious model editing).
So, rather than deleting them, I'm just going to shrink them a bit and then move them back so they disappear inside the head. So, they won't show on the model, but will still be there, so there's no missing object or unassigned texture issues)

-Okay, so now the change is done. Time to export!

-Exporting a .smd is a bit different than the usual blender export. You'll need to do it from the bottom right panel, specifically the "Scene" Tab (the tab has an icon of a cone and sphere).
-you'll have to choose an export folder.
-set the export format as SMD
-Target up Axis: Y
Under Source Engine Exportable, make sure both files are checked.

-now scroll back up and click "export" and both the model .smd and animations .smd will be exported to the folder (animations will be in a new folder called 'anims' by default.)

-You can check how the model is looking by draging the model.smd into Noesis, then, see how the animations are fitting by dragging the animations.smd over to Noesis as well, and by choosing "no" when it asks if you want to open as a new model.
-The animations are fitting perfectly in the example, and the glasses have been successfully removed. (If you aren't seeing textures on the model, make sure to have the .pngs exported from noesis present in the same folder that the .smd's are.

Okay, time to try to put the edited model and animations back into a .gmo!!!

3.CONVERTING THE EDITED MODEL AND ANIMATIONS BACK INTO 1 .GMO File

-Open P4GModelConverter

-In the first column, make sure "Convert to FBX w/ Noesis" is checked.
-also make sure "-fbxoldexport (animation)" is checked
-also make sure "-fbxascii (mds output)" is checked
-also make sure "Convert to FBX to GMO" is checked

-drag the new model.smd into the first square, which will generate an .fbx, a .gmo and an .mds

NOW, if you want to , you can then drag the new .mds file onto the middle square, and then drag the newer _p4g.mds file onto the last box on the right. (Check the "Preview New GMO w/ Noesis" box for it to preview the new .gmo model.
BUT you will notice that it is only a stationary model, the animations are not part of it.
-We need to find some way to add the animations onto it, like the original .gmo

*****************Okay, so here's where I'm kinda stuck...********************

4. GETTING WRECKED

-check the middle column box "load animations"
-in the far right corner click "import"
X -change the file type to .smd and select your animations.smd (Actually no, doesn't work, it crashes...
X-So let's try turning our animations smd into an mds and importing it that way... -Nope, it DOES load an animation, but it only labels that as 1 Noesis Frame -which is not the 20 or so animations that used to be there... (if you try to apply the model.smd to this single animation, it will end up making a gmo with animations, BUT the animations are playing at like 3x speed, and rather than seperate animations in a row, it seems like they've all been combined together in a wierd hyper mess...)
X-Okay turning the animations smd into .fbx and then importing the animations through that... -NOPE crashes...

-So, it doesn't seem like it's possible for P4GModelConverter to load animations from the .smd file that has all the animations.
Normally I'd think that the animations .smd was corrupted or something, but Noesis has no problem loading the same animation file and displaying them on the model .smd perfectly... :(

*****As part of one last ditch effort, I tried to load the animations from the Original gmo model's .mds file -and they do load!

(First close and reopen the P4GModelConverter, to get rid of the failed animations)
-so click and drag the ORIGINAL .gmo -and drag it into the first box -it will generate a .mds file.
-Now make sure the middle column's "Load Animations" box is checked, and click "import" in the bottom right corner.
-Choose the ORIGINAL gmo's .mds you just created.
-You will now see the right column fill up with numbered motions. These are the animations we've been trying to assign to the model. (If you click on the "Animation Preset" drop down, and choose which kind of model it is -in this example it's a P4G Party Member- it will kindly label all the animations as which is which. Nice!)
-So now we have the animations preloaded, all we need to do is drag our previous model.smd turned into .mds turned into _p4g.mds onto the last square (with Preview checked)
-Aaaaand -nothing happens -it still appears as a static model.
-But! If you then click on "Update MDS Animations" then, if you drag the newly created _p4g.gmo back onto noesis, it does have the animations!
But the model is now kinda janked. Part of her hair and part of her skirt are pulled straight up. (I wonder if this is due to them being sort of 'gravity simulated bones? like, both the hair and skirt have specific kinds of bones made to bounce around with physics, right? and all the other bones are fine. Hmmmmm)
Image
So I can't seem to combine both the edited model and the animations back into 1 .gmo right now...

---

Well. There, we go. Tried my best, but it seems like some issue is causing me to trip up right at the finish line. T_T
Am I exporting them wrong from blender? Why doesn't the P4GCOnverter accept .smd animations when it accepts .smd models?? Why is it that when I try to load the original animations from the starting .gmo onto the slightly edited model it jacks up the rigging of the skirt and hair??

I've seen people with altered P4G models, heck, I've seen people rigging those models to other model's skeletons or swapping animations, so I KNOW this is possible, but I'm not sure what I'm doing wrong.

Hopefully someone is willing to advise me as to the issue, because I really would like to fix and finish this guide and get it posted to the forum...
User avatar
Tupelov
Posts: 12
Joined: Wed Apr 15, 2020 4:30 pm
Has liked: 2 posts
Been liked: 3 posts

SMD? Do you mean amd? Its a gmo with a header. When you export the MODEL_DATA, that's the gmo inside the amd. So it should be MODEL_DATA.gmo I know this video may be a bit vague but I do showcase a recording of the whole model porting process here https://youtu.be/tAE3ZZHk-NQ
Keep in mind that p3p and p4g share model formats each other but not with the other games.
I have no clue how the hell you even got this far lmao
User avatar
Fortuna
Posts: 11
Joined: Mon Mar 01, 2021 12:16 am
Has liked: 5 posts
Been liked: 4 posts

I have no clue how the hell you even got this far lmao
Yeah sounds about right XD

But yeah, .smd does infact mean .smd -not a misspelling of .amd!
It's an option when exporting from Noesis!
Image
I got the idea from Shrine fox actually! (link to that forum post is in my og post above)
Image

I like it because you can directly import it into blender (fbx wont let me, says 6100 is too old and not supported etc :P), all you have to do is install an addon that allows editing of source engine models (funny enough those models appear to be from Team Fortess 2, so it seems that's the type of model that uses these files most? Guess it makes sense because it mentions Valve in the acronym Hmmm)
-I also like it because you can directly use it in P4GModelConverter, infact it's one of only a few filetypes that work with it:
Image
-I'm sure it's possible to use .smd files for this, I mean, surely Shrinefox woudn't have gone to the trouble of actually coding in support for .smd files into his new tool if they were couldn't be used, right?
If I can just finish this last step of getting both the modified model from .smd back into a .gmo with the hair and skirt bones not borking up, I think it'd end up being a really easy and streamlined way to edit these models, and make for a really beginner/idiot-friendly guide to model editing!
I mean, look at the process:
.Gmo exported as .smd from Noesis > edit in blender & export .smd > Drag into P4GModelConverter & combine with loaded animations > Back to .gmo

^^That's a pretty easy process, I'm sure it's got potential!
I'm just not sure why the .smd animations aren't preloading into P4GModelConverter...
User avatar
Fortuna
Posts: 11
Joined: Mon Mar 01, 2021 12:16 am
Has liked: 5 posts
Been liked: 4 posts

UPDATE: Alright! Somehow I've found a work-around!
Since I can't seem to get the .smd animations to import into P4GConverter, I ended up just converting the edited model .smd into an .fbx through Noesis, then preloading the original gmo's animations in P4GConverter, then combining them! It works!?
The good news is that with this work around, the original animations now work with the edited .fbx model, whereas they did not with the .smd model. So I guess it's better this way.
------------------------------------------------------------------------------------------------------------------------------------------------
The Process:
-Drag the edited model .smd into Noesis, then drag the animations .smd (exported from blender into 'anim' folder) into noesis, clicking no to apply it to the existing model.
-file>export from preview> choose fbx for the format.

-Make sure all the texture .pngs are in the same folder that your .fbx is in (not in the newly generated textures folder p4gconverter will soon create).

-Start P4GConverter.
-Check all the left column check boxes.
-drag the original model .gmo into the left square. (You'll get a .mds file)

-now check box 'load animation' in middle column, then check 'auto update mds' in bottom right corner.
-drag the og gmo's new .mds into the middle square, animations will pop up listed in right panel.
-check preview in Noesis box in last column.

-take your edited .fbx that came from your .smd and drag into first square. (it will make another fbx, an gmo and mds)
-uncheck middle column box 'load animations'
-take and drag the new .mds into middle square
-take and drag the new _p4g.mds into the last square.

-The model should now display in Noesis, edited and perfectly fitting the animations!
***If it doesn't open in noesis, just open Noesis and drag the new .gmo into it.
-Now you should see your edited model with the animations successfully playing on it!
***If you're noticing that your newly gmo'd models don't have any textures, makes sure the .pngs generated when you exported from Noesis are in the same folder as your fbx, and that you leave the box "Convert Textures to TM2" unchecked.
Worst case, with the settings in the line above, drag the edited model's .mds (not the _P4G.mds) onto the middle square, then the _P4G.mds onto the last square. It should have the textures now!
------------------------------------------------------------------------------------------------------------------------------------------------
And that's it! It seems like a simpler process than some, and can be done in blender!
Now I just need to re-download Persona 4 Golden for PC and then test this model out on the field MC.
After I make sure everything looks good I'll clean up and submit the process from above as a simplified model editing guide in the Tutorial section! :D
Image
^^In this example I took the Mc's Field drag model and edited it in blender to look more like a FeMC would. So sharpened the chin and rounded the jaw, raised the skirt and knees, cinched the waist, plumped the bust and hair, etc. Ideally, if this goes well I can try swapping out more of the MC's models with this FeMC version and maybe make a small mod? Hmmm

-So I guess this post is solved. Still can't get the edited model's .smd animations to load with the P4GConverter, -and still not sure if that's a bug or something I did wrong. But really, it's better just to use an .fbx with the original .gmo's animations anyway.
User avatar
ShrineFox
Site Admin
Posts: 290
Joined: Mon Oct 07, 2019 3:19 am
Has liked: 277 posts
Been liked: 115 posts

Thanks for the info and being willing to test this! Honestly, in the program's currently released state, it's a nightmare to troubleshoot. I don't remember if that was the intended way to convert animations or not, but just that SMD => FBX was the only way I was ever able to successfully import them. It's possible that it's a bug or some weird specific difference in our setup, like the SMD/FBX versions we used in the first place.

There's so many variables going into this that I haven't made a proper tutorial yet. There's not much I can do to improve importing since it relies on the leaked official gmotool program, which of course doesn't come with a source. I'm slowly but surely rewriting P4GMO so that it serializes mds data into its own object and relies as little as possible on external programs while editing:
Image

While I'm working on that I'll experiment a bit more with animation importing to see if I can automate the conversion to work more consistently, using this thread as a reference
User avatar
Fortuna
Posts: 11
Joined: Mon Mar 01, 2021 12:16 am
Has liked: 5 posts
Been liked: 4 posts

Oh jeeze, sorry Shrinefox, you make all these cool tools and then people like me are almost trying to break them ^^;
This tool really is such a such a life-saver compared to the old days! I still remember the old 'P3/4 model editing' video you made and the example was Jack Frost's head on the MC XD
I hope your efforts with that new GMO tool are going at least somewhat smoothly!!
And I wouldn't sweat about the .smd anims not loading, it's probably much safer for the edited models to be compatible with original animations anyway!
--------------------------------------------------------------------------------------------------------------------------------------------------
Okay! So I just tested the edited .gmo model ingame! (Replaced the fc_01_00 field MC with the drag model with the field MC's animations applied, some clipping issues, and I haven't gotten rid of her Kendo sword, but this is just a quick proof-of-concept test, so doesn't matter :P)

Clean steam install of Persona Golden PC, getting the Aemelus and Injector set up etc, mods are working, so I dropped the edited amd packed in the proper folder directory (data00001modelfield etc) in as a mod, ran the game aaaaand:
Image
Foiled again. XP

-At first I thought it was some issue with the model, but that's when I realized -the new .gmo doesn't actually have the textures baked on anymore??
It tricks you into thinking it does because Noesis auto-applies the .pngs in the folder onto the model! If you remove the loose .pngs in the folder then the textures disapear from the model.
-I think that may be what's causing it to be invisible? (Isn't there a trick where people have gotten rid of glasses in model mods by replacing their texture .dds file with blank alpha or something? Sounds like that's what's happening here...)
-I thought maybe the issue could be that some models in the game have a folder of seperate .dds textures that overwrite the model's textures (data00002tex2modelfield), but checking on it, seems they are still there -but clearly they are not being applied to the model?

SO, I tried a couple things:
-maybe since noesis exported the textures as "diss_01.png" named files, I should rename the textures as that? No dice.
-Maybe the actual .pngs themselves needed to be in the texture folder? -Nope
-Maybe it wanted .tm2 textures that P4GConverter uses? -Nope

-Okay, since noesis requires the textures to be in the same folder as .gmo to show up on the model in display, maybe I should try putting the .pngs, .dds, and tm2 textures in the same folder as the new .amd? -Noooope.

-I've also tried tinkering with checking and unchecking the "Extract TIM2 Textures" and "Convert Textures to TIM2" boxes but no combination with the edited smd, fbx or gmo seems to help... Seems that P4GConverter won’t recognize these any textures for this .gmo to .smd to .fbx file, even though Noesis does? hmmm
-So, I'm kinda out of ideas here... I was so freaken close to a relatively easy model editing process :P
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
At this point it seems that I'm either going to have to figure out how to make P4GConverter apply these .png textures to the model, or find out if it's possible to bake the textures onto the model before P4GConverter... T-T
-Since you mentioned you’ve also expermented with having the gmo in .smd turned .fbx, how did you manage to keep the textures intact? (I feel like the textures might have gotten lost when I exported the original gmo into .smd because, as far as I can tell, unlike fbx smd doesn't have textures baked? hmm..)
Either way, just in case anyone has any ideas or wants to do their own tests, here's the edited .smd, .fbx, and .gmo with fc_01_00 MC animations, as well as in a format that can be dragged into Aemulus for quick modding: http://s000.tinyupload.com/index.php?fi ... 2802196036
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.