#Metaphor Blender Plugin Update: Testers Thread

167 messages · Page 1 of 1 (latest)

edgy haven
#

I have created a branch with preliminary support for Metaphor in the Blender plugin repo.

THIS IS NOT A RELEASE.

I would appreciate any and all help to bugtest this branch before I make a proper release. This branch is basically just YOLO code because I do not currently have a way to test the outputs in the full game, so it is entirely possible that whatever gets exported from the plugin just turbo-fries the game immediately. A few specific things I'm interested in:

  1. If vanilla import/re-export works (including characters, fields, whatever).
  2. If various edits of the vanilla models / animations work (including characters, fields, whatever).
  3. Any bugs encountered using the plugin.
  4. Any metaphor-specific features / UI updates that would be useful (anything 'big' would need to go into a subsequent release since it's healthier to have smaller and more frequent releases rather than bigger and slower ones).
  5. Any miscellaneous micro-features that would be nice to see in the metaphor support release, which I might be able to get to in a short timeframe.

A few notes:

  1. It's slow. If Blender hangs for a few minutes when importing/exporting anything (especially animations), don't panic. It took about two minutes for a character GAP to export on my machine, because there are literally thousands of animations per GAP.
  2. The material UI is a little bit wonky. Will improve if I can.
  3. There isn't currently any kind of material library for Metaphor like Mudkip made for P5. Will be investigating a built-in solution in the future. In the meantime consider nontrivial material edits (things beyond changing colors and stuff) to be in ⚠️ danger ⚠️ territory.
  4. Keep a few GiB of RAM spare to load stuff.

To get the plugin, just click the big green "code" button at this link and download the zip, which you can then install like normal.
Have fun and let me know how badly it breaks the game.
https://github.com/Pherakki/BlenderToolsForGFS/tree/feature/metaphor

thorn pasture
#

Djeizjeicnri HELLO

#

Imma test this :)

edgy haven
#

Thanks I hope it at least installs 🥲
Not sure if Blender 4.2 is compatible yet I have yet to install a copy

thorn pasture
#

I can download one if ya like.

#

Cuz Im on 4.1

edgy haven
#

Keeping on 4.1 and below is good for now, I'll test (and bugfix) any 4.2 incompatibilities on my end---it's just lack of time (and prioritisation) on my part that it's not checked yet

#

Argh something I forgot in the main post.
⚠️ Don't be scared by warning popups saying that more than 6192 vertices exist on a mesh. This is probably just a limit from P5R that needs to be re-checked on Metaphor.

#

error popups are a problem though.

thorn pasture
#

Alright dope :)

#

Gonna test after I finish eating.

edgy haven
#

Thanks. I will probably disappear for the day soon and come back to the chaos tomorrow.

sand glade
#

Before you go. While were on the topic of limits theres been a question i've been meaning to ask for a while now. Why exactly is there a 256 vertex group limit (specifically for P5R)? Because you can go over that limit no problem and the game runs fine.

edgy haven
#

I'll have to double-check the code. A mesh can reference at most 256 vertex groups because it stores weights as uint8s. But as you note, the model as a whole is ok because it stores them as uint16s. So I'll double-check if my brain was just having a bad day when I wrote that or if the error message is misleading.

sand glade
#

Thats fine, I was just curious since sometimes it just allows me to bypass the limit when exporting (there's no real rhyme or reason it just does).

edgy haven
#

If you can find a reproducible case for that I would be interested in that, esp if you could pop it in an issue report on the repo

#

It sounds like my brain was just wrong in that case though

sand glade
#

It seems like it usually happens when I do a model from the ground up and I never close blender (though I feel like sometimes that wasn't the case). I'll do a bit of research and see what I can come up with.

edgy haven
#

I just checked now and yeah I just made a dumb error

#

I check both the global bone palette and the individual meshes...
Bone palette check needs to go

sand glade
#

Ah, that makes sense.

edgy haven
#

I'll push that as part of this release, I spotted a few other errors I fixed (and forgot to document, like a terrible person) along the way too. So thanks for pointing that one out 🙂

sand glade
#

It's no problem. Glad I could be of service. femc

thorn pasture
#

so I got imports working

#

can this load metaphor gaps

sand glade
#

the 1st note mentions GAPs so i'd assume so.

thorn pasture
#

i am a prime example of someone of who doesn't read whoops

sand glade
#

We all go through it in life, it's no biggie.

thorn pasture
#

I managed to load my custom model and the anim

#

so time to re export and see if work in gfd now

#

so I am unable to export as gfs

#

I got will and fidelio to load up fine

devout sage
#

Tested by deleting Hulkenberg hair, The TEX file generated on export seems to make the model not able to be read by GFD studio (even with no changes made). Grabbing a vanilla TEX file from game folder doesn't have this issue. I was unable to get an exported model to load in game direct from the plugin. The model had to be loaded into gfd studio (with some tex workarounds since the blender tex wouldn't load) and replaced it's materials.gmtd with a vanilla one. So I aasume something is messing with mat values on export? I did get a GAP to export and it looked liked it worked in GFD Studio but crashed in game. Unsure if file size was too big after editing or other issue though. Honestly while still a bit jank to work with, it's already a million times better than going into every mesh in GFD Studio and changing their flags to work lmao.

edgy haven
thorn pasture
#

well I should clarify I can export as gmd but just doesnt do like anything for gfs.

#

no error prompt

edgy haven
# devout sage Tested by deleting Hulkenberg hair, The TEX file generated on export seems to m...

Thanks. I found two issues with the texture bin:

  1. Duplicate textures get inserted into the bin (fixed locally, will push later)
  2. Unreferenced textures are removed from the texture bin (because it's rebuilt from scratch - working on a sol'n atm)

I'll double check the materials to see if I can find a difference between import and exported textures.
With animations there are two bits of data I suspected might cause an issue and I set them both to 0. Apparently they don't cause a problem in Catherine but they might cause a problem here. Those two might be causing the animation issues and I should figure that out (there's a hopefully quick hack that can be done to test it)

edgy haven
# thorn pasture no error prompt

Nothing in the Blender console? It's a bit odd that there might be GMD/GFS difference because they're the same file with a different extension name

thorn pasture
#

yeah I found it hard

#

odd*

#

but I realized it just force export as gmd like I could'nt change the extension name.

#

u can spit out a gfs buy gfd studio so not a big deal tbhg

edgy haven
#

Well I guess the solution would be to just add a third menu item to export with a GFS extension

#

But you can just hit F2 in the file browser and rename the GMD to a GFS, you don't need to re-export with GFD Studio, because the file data is the same

thorn pasture
#

thats good to know

edgy haven
#

Materials are exporting the wrong texture indices; will try to fix that today too

edgy haven
#

Ok, apparently the texture indices and texture samplers are now inconsistent, so I will need to implement an alternative way of keeping the texture indices alive

edgy haven
#

I also missed a texture.

edgy haven
#

Alright, just pushed a bunch of fixes to that branch for the texture bin and materials. If anybody could let me know if that fixes the material + texture bin crashes that'd be grand

#

(animation issues will not be addressed by these updates)

devout sage
#

Nice. Model exported directly from plugin loaded in game with no fuss

devout sage
#

There are (at least a few) models that don't load into blender on import, all with seemingly the same V2Type12Support error. Mainly noticeably these characters
Eupha 0006
Basilio 0008
Grius 0010
Gallica 0011

spiral wyvern
#

Looks like mats with texcords of 0xFFFFFE38 die?

#

(referring to issue above)

#

If you delete mats with those and their meshes, then they seem to import fine

devout sage
#

Plugin seems to load new meshes fine. Just duping existing mats and renaming them. Basically the same thing I've been doing for P5R since forever lol

spiral wyvern
#

Gave custom model only using one mat a mat without those, imported

#

Used mat with it, same error

edgy haven
#

I think this issue is simply that I screwed up the call invocation rather than a texcoord issue

#

TypeError: V2Type12Support.from_V2_type12_params() takes 1 positional argument but 2 were given

#

This would be a compiler error in a happier world

edgy haven
#

Turns out that I misnamed the to_V2_type12_params() function which overrode this one 💀

edgy haven
#

Pushed a few fixes:

  • Fixed texture samplers not importing or exporting the enable_animation property
  • Fixed texture sampler UI not displaying
  • Fixed export of multiple shader parameter types
  • Added an option to toggle vertex colors on and off (because they are very funky and do not mix with the textures as I would expect)
  • Added a band-aid change to see if importing and exporting vanilla GAPs without edits will work now
#

I'm very interested to see if the final point is "fixed" by this edit (it will require figuring out the formulae to calculate two unknown variables to generalise this to animations with edits if it works)

devout sage
#

Exported GAP with no edits still crashed the game. Exported GAP was also like 10 mb bigger than vanilla

edgy haven
#

The size difference is probably due to the plugin only knowing how to export uncompressed keyframes (tbh things should be mature enough now for me to allow compression)

#

Will be investigating GAP export issues now

thorn pasture
#

I know this isnt metaphor related but I managed to import gmd files from p3d and p4d just fine now on 4.1. Before this fork I needed an old blender ver to get it function properly so thanks.

haughty spoke
#

stupid question maybe but clicking code button in github always download the latest fixes or not?

edgy haven
#

As long as the branch that's selected in GitHub is the feature/metaphor branch, it will give you the latest version of the code that's being developed for metaphor compatibility. If you don't know how to make sure you're on that branch, just make sure you access the repository from the link in the first post of this thread rather than google and you'll be ok

#

(when the testing phase is complete this will be merged back into the main branch, which is the one that probably turns up on google)

#

Whether the latest version of the code
a) Contains fixes
b) Contains new bugs
c) Both of the above
is a function of how awake I was when I made those edits :3

#

In general the 'code' button will not get you something useable on GitHub, because it downloads the raw source code. Python is just a bit special in that the raw source code can be eaten and translated very quickly into instructions usable by an application (in this case, Blender, because Blender comes packaged with Python interpretation software)

#

This repository is also designed in such a way that the "code" button downloads a zip that can be directly understood by Blender as a Python plugin; this is not guaranteed for every Blender plugin you may come across

haughty spoke
#

Thanks! appreciate the detailed answer

junior mantle
#

I attempt to import the object file [ COMMON\model\field\object\o_0001_004_00.GMD ] but this gives me an error detailed in these images below.

edgy haven
#

Ooh good I made a typo, thanks for the catch

#

Good I'll push that later

junior mantle
#

Np. Thanks for the quick response.

edgy haven
#

Pushed a bunch of edits:

  • Fixed Type0 Shader Param imports
  • Fixed Type12 Shader Param exports
  • Fixed Type15 Shader Param exports
  • Fixed a bunch of Shader Param UI errors
  • Made sure that Type31 animation keyframes are exported as Type31 animation keyframes (animation export is still busted though)
thorn pasture
#

Sad

#

But yay

haughty spoke
#

I get this when trying to export c_0006_208_B.GFS - not sure if you have the DLCs however - only like removed 2 meshes, nothing else. Blender 3.6

devout sage
edgy haven
edgy haven
spiral wyvern
#

works for me

#

why they have so many different rest poses in this game

devout sage
spiral wyvern
#

fogor to post eupha, gallica, and hulkenberg using a mat with same texcord they do working in game as well True

thorn pasture
spiral wyvern
#

p3d

thorn pasture
#

Ah ty

edgy haven
thorn pasture
#

getting errors with exporting Strohl

devout sage
thorn pasture
#

I'll send my blend

devout sage
#

I'll check 4.1 rq

thorn pasture
#

since Im doing a comm and I barely have knowledge on gmd/gfs

#

smh exceed limit

devout sage
#

Oh damn 4.1 crashed when I tried to export lmao

thorn pasture
#

damn

#

guess Imma try 3.6

#

ty

devout sage
#

Crashed so hard GFSTools wasn't installed anymore so I'll do a reboot cycle

#

Hmm I'm still assuming me issue but 4.1 crashed on export even with protag so like Idk. I think my computer just doesn't like Blender 4 lmao

#

I believe in 3.6 supremacy

devout sage
thorn pasture
#

I got it to export on 3.6

#

welp

edgy haven
#

I think the issue is that you selected everything

#

Just select a mesh or the armature

thorn pasture
#

Thought I should mention this isnt metaphor related but on 4.1 at least textures dont load on p3d and p4d meshes. iirc. Royal works fine tho

#

Cursed.

spiral wyvern
thorn pasture
#

I guess my installation is cursed.

#

Imma reinstall 4.1 at this point Imao.

#

Or do a redump

thorn pasture
#

yeah idk

edgy haven
#

When was BC7 support added to Blender again

#

My guess is that 3.6 just doesn't know how to load BC7 files

#

Yeah 3.6 doesn't support BC7

thorn pasture
edgy haven
#

That's a bit odd

#

That said P3D didn't use BC7

thorn pasture
#

i think it's a me problem tbh

edgy haven
#

Regarding animation export: it looks like it is caused by what was previously suspected; the two unknown integers in the animation structs that got added. Setting these to 0 causes a crash.
The first is the track count except sometimes it's 0.
The second is probably the required allocation size for a buffer to hold the keyframe data. Plenty of evidence pointing that way.
So, I think the formula to recreate these two need to be figured out before animation exports will work.

devout sage
spiral wyvern
#

Well yeah those use gnf for textures

thorn pasture
devout sage
#

You can export them from gfd studio. Has to be as a png though iirc

#

Exporting as dds dies

thorn pasture
#

yeah ur right on that I had to Imao

edgy haven
#

figured out how to calculate those unknowns btw and it seems to all work fine for re-exporting vanilla animations, just doing some stress tests with mudkip on it

edgy haven
#

Ok, pushed one commit implementing that calculation. According to Mudkip's testing (thanks!) exported GAPs should now be loadable by the game.
There might still be some issues where animations seem to freeze a bit and not loop correctly, so that's probably either a duration issue or caused by some (seemingly-useless) animation controllers getting dropped on export. Investigating both

#

In the meantime feel free to update and let me know if it works for more things

#

If this all works I think there's no other tickets left for a metaphor release of the plugin

#

The only other thing I'd like to do is implement texture bin support for P5R before releasing too since I had to set up a framework for that for metaphor, but we'll see if it makes release or not

#

Since we might be wrapping up after any bugs with the animation export are sorted out, this might also be your last chance for this to remind me if there are any small features that are desperately needed before release, either for P5 or metaphor

#

I might, for example, need to add separate menu items for exporting P5 and Metaphor, because they use different texture bins. But maybe I don't if that's file version-dependent behaviour rather than game-dependent behaviour.

#

I guess my default would be to do it the slimmer way and export different texture bin types depending on the file version, but there are files in the Metaphor demo that have the P5 version rather than Version 2 versions, so if somebody went a bit crazy and exported a model with a P5 version for MR, we'd have to know for certain which bin type the game expects (and also if it crashes if it can't find the appropriate bin, which I don't think should happen)

devout sage
#

Working 👍

edgy haven
#

Cracking

#

Could you try replacing some walking/run animations too? Mudkip is seeing issues where you lose input control at certain intervals if those get replaced

devout sage
#

Yeah I just need to sort a million animations lmao

edgy haven
#

It's so painful 😭

#

Why are the GAPs so big

devout sage
#

At least 2k in this battle according to blender. With a bunch just being empty

edgy haven
#

I think there must be 2k odd "roles" the animations that could play and only the ones necessary get filled in

#

I think P5 is similar, the GAPs are just much smaller

devout sage
#

From what I can tell it doesn't like frame length b eing bigger than vanilla? You continue moving after the animation has looped once. Tried replacing all 4 walk anims 301 302 311 312 and it still hitched after half a second. Shrinking the anim down to vanilla anim length seems to stop the "stopping in place" at least.

#

Not even sure if issue with plugin could just be a game limitation

edgy haven
#

That's odd. Maybe that is a game thing...

edgy haven
#

I think I'm going to call this "done" for now and claim that anim replacement might need additional non-GAP-asset research

#

I'll see what else I can clean up of the things I mentioned over the next few days and make a release

edgy haven
#

Pushed a few more fixes to the branch for material export and UI errors

#

I will probably make a release tomorrow

thorn pasture
#

Yay 👀

edgy haven
#

Released. Thanks everyone for the testing work!