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

Granny .GR2 Reader plugin for Noesis

Post questions about game models here, or help out others!
jayn23
mega-veteran
mega-veteran
Posts: 250
Joined: Sun Jul 17, 2011 9:30 pm
Has thanked: 61 times
Been thanked: 241 times

Re: Granny .GR2 Reader plugin for Noesis

Post by jayn23 »

Here:
http://www.mediafire.com/file/q8bhn0jiq ... rt.7z/file
Are Legend models/animations .pak and .dat if you want to directly check them + In the ESO folders the first files loads and are armor pieces and such, other files throw... yep, errors.
Apologize for the useless blabbing and thank you.

Edit: Another header that's commonly used is "29 DE 6C C0 BA A4 53 2B 25 F5 B7 A5 F6 66 E2 EE" and too is present into the model.pak, animations still got nothing... on a better "view" i noticed that the armor/weapons loaded do load the skeletons.
i looked at the bms script and data models.pak and managed to load some models manually by adding a header.
"29 DE 6C C0 BA A4 53 2B 25 F5 B7 A5 F6 66 E2 EE" and "B867 B0CA F86D B10F 8472" are both 32 bit litle endian magic for granny header,
but they are only part of the header, if someone can show me an example how to have the bms script write these bytes to each file extracted we can get it working.

as for a progress update:
ESO - all files a loading, so no more crashing :D , on the down side many of the meshes have corrupted UV , as i stated before my output is identical to that of granny viewer so its not my script, they must have made some custom changes to the file.
animation also seems to work, some files contain multiple animation - i only load the first one.
I was trying out your plugin on a WayForward game (Double Dragon Neon), and I get this error.
Double Dragon Neon - this game is just built unprofessionally if you ask me [roll] for example 1 file contained 46 animation , multiple textures and materials 123 models (multiple mesh for each model) and 3 skeletons, noesis cant handle so many apparently:
Image

from the samples provided only 1 is loading the others just have to many models...

last game to tackle is Medal of Honor, then i am taking a break :P

ill upload new version once i do some testing make sure i didnt break other stuff that was working
CheloXL
beginner
Posts: 20
Joined: Sat Apr 09, 2011 6:41 pm
Has thanked: 2 times
Been thanked: 2 times

Re: Granny .GR2 Reader plugin for Noesis

Post by CheloXL »

How do I apply textures to the model? I'm trying with Dragon Commander. Model/Animations works perfect, but can't find a way to apply textures...
jayn23
mega-veteran
mega-veteran
Posts: 250
Joined: Sun Jul 17, 2011 9:30 pm
Has thanked: 61 times
Been thanked: 241 times

Re: Granny .GR2 Reader plugin for Noesis

Post by jayn23 »

How do I apply textures to the model? I'm trying with Dragon Commander. Model/Animations works perfect, but can't find a way to apply textures...
Glad to here another Larian Studios games is working, unfortunately most games using Granny format dont store texture/Material data in file
but use some other systems to mange this. this means for each game i would need to build its own "module" to support auto texturing.
that isnt possible with number of games using this format so i decided to add texture support only for very specific games,
currently planned only BG3 :wink:

It would be very easy to manually apply textures in 3ds max or blender.
User avatar
Henchman800
mega-veteran
mega-veteran
Posts: 308
Joined: Fri Nov 16, 2018 5:00 pm
Has thanked: 72 times
Been thanked: 34 times

Re: Granny .GR2 Reader plugin for Noesis

Post by Henchman800 »

jayn23 wrote: Mon Jun 15, 2020 10:14 am HI Henchman800

can you confirm if games works with aniamtion?
id like to update tested games list if yes, Thanks
Yo!
So the plugin imports characters and animation files as described.
Mesh import works flawlessly!
Character models and their idle animations make no problem when importing:
Image

Map objects, like the fishing bear and the chinese warriors seem to have problems though.
The bears skeleton and animation are looking fine! The skinning though seems to make problems:
Image
(Don't mind the artifacts in the gifs....this is just because i reduced info and used heavy compression)

The chinese warrior does nothing and no animation is playing at all. are the gr2-files treating character and map meshes with animations differently?
Image

well this is at least what i found out :-)
i've attatched the bears and warriors mesh and animation files here:
https://cdn.discordapp.com/attachments/ ... amples.zip

Having a look at my topic about Winter X-Games Snocross right here:
viewtopic.php?f=16&t=21279
I found a clumbsy way to export the textures from the .gr2 files. Do you happen to know an easier way for doing so?

And did you have a look at the .REZ archive? sadly the extractor i found online doesn't recognize it as a valid rez-file :-/

Hope I could help with my little research,

PEACE
Last edited by Henchman800 on Wed Jun 17, 2020 4:33 pm, edited 1 time in total.
Allanoon
veteran
Posts: 91
Joined: Sat Apr 14, 2012 9:00 pm
Has thanked: 116 times
Been thanked: 25 times

Re: Granny .GR2 Reader plugin for Noesis

Post by Allanoon »

jayn23 wrote: Tue Jun 16, 2020 9:02 pm i looked at the bms script and data models.pak and managed to load some models manually by adding a header.
"29 DE 6C C0 BA A4 53 2B 25 F5 B7 A5 F6 66 E2 EE" and "B867 B0CA F86D B10F 8472" are both 32 bit litle endian magic for granny header,
but they are only part of the header, if someone can show me an example how to have the bms script write these bytes to each file extracted we can get it working.

as for a progress update:
ESO - all files a loading, so no more crashing :D , on the down side many of the meshes have corrupted UV , as i stated before my output is identical to that of granny viewer so its not my script, they must have made some custom changes to the file.
animation also seems to work, some files contain multiple animation - i only load the first one.
Unfortunately i've 0 knowledge of these things. IF there's only the need to add one of those headers i wouldn't mind doing it manually since the files are nicely sorted too but that doesn't seems to be the case right? I'll try looking around the net for a solution~
OT question regarding ESO, the files you got from other ppl had names?
jayn23
mega-veteran
mega-veteran
Posts: 250
Joined: Sun Jul 17, 2011 9:30 pm
Has thanked: 61 times
Been thanked: 241 times

Re: Granny .GR2 Reader plugin for Noesis

Post by jayn23 »

I want to thank you guys for all the help and testing you are doing would have taken me weeks to do.
The chinese warrior does nothing and no animation is playing at all. are the gr2-files treating character and map meshes with animations differently?
i checked the animation and it only has 1 frame, so it is static, i checked with my best friend Granny viewer :wink: and it is indeed showing the exact same "static animation"

as for the bear i checked the weights and they are applied correctly, what i think is wrong is the axis the mesh is created on, and the one the animation is are not the same causing this distorted mesh. i dont think its fixable sorry
well this is at least what i found out :-)
Having a look at my topic about Winter X-Games Snocross right here:
viewtopic.php?f=16&t=21279
I found a clumbsy way to export the textures from the .gr2 files. Do you happen to know an easier way for doing so?

And did you have a look at the .REZ archive? sadly the extractor i found online doesn't recognize it as a valid rez-file :-/

Hope I could help with my little research,
i took a look at you "clumbsy way" unfortunately i cant help since textures in file are stored in compressed .bik format which i have no clue how to read.
regarding the .REZ archive, each game has its own archive, as far as i know there are no official GR2 Archive, and trying to reverse this would be instead of working on improving my gr2 reader, what i can say is it looks to be compressed with zlib you can try aluigi tool to decompress all files and take a look if the first 16 bytes for those files is the same as other files, if yes they are granny files.
Unfortunately i've 0 knowledge of these things. IF there's only the need to add one of those headers i wouldn't mind doing it manually since the files are nicely sorted too but that doesn't seems to be the case right? I'll try looking around the net for a solution~
OT question regarding ESO, the files you got from other ppl had names?
If you find an example how to do this, i can write header that basically does nothing and skips to the data section, in a format that my script can work. but there is no rush i have more than enough bugs to deal with :oops:
and no ESO files were just numbers.

i actually own ESO and tried extracting the files myself but failed miserably with this error, do you know what i am doing wrong?
Image
User avatar
Henchman800
mega-veteran
mega-veteran
Posts: 308
Joined: Fri Nov 16, 2018 5:00 pm
Has thanked: 72 times
Been thanked: 34 times

Re: Granny .GR2 Reader plugin for Noesis

Post by Henchman800 »

jayn23 wrote: Wed Jun 17, 2020 7:36 pm
The chinese warrior does nothing and no animation is playing at all. are the gr2-files treating character and map meshes with animations differently?
i checked the animation and it only has 1 frame, so it is static, i checked with my best friend Granny viewer :wink: and it is indeed showing the exact same "static animation"

as for the bear i checked the weights and they are applied correctly, what i think is wrong is the axis the mesh is created on, and the one the animation is are not the same causing this distorted mesh. i dont think its fixable sorry
well this is at least what i found out :-)
Having a look at my topic about Winter X-Games Snocross right here:
viewtopic.php?f=16&t=21279
I found a clumbsy way to export the textures from the .gr2 files. Do you happen to know an easier way for doing so?

And did you have a look at the .REZ archive? sadly the extractor i found online doesn't recognize it as a valid rez-file :-/

Hope I could help with my little research,
i took a look at you "clumbsy way" unfortunately i cant help since textures in file are stored in compressed .bik format which i have no clue how to read.
regarding the .REZ archive, each game has its own archive, as far as i know there are no official GR2 Archive, and trying to reverse this would be instead of working on improving my gr2 reader, what i can say is it looks to be compressed with zlib you can try aluigi tool to decompress all files and take a look if the first 16 bytes for those files is the same as other files, if yes they are granny files.

Thanks for taking the time man!
zardalu
veteran
Posts: 134
Joined: Sat Sep 13, 2008 3:13 pm
Has thanked: 17 times
Been thanked: 31 times
Contact:

Re: Granny .GR2 Reader plugin for Noesis

Post by zardalu »

"i actually own ESO and tried extracting the files myself but failed miserably with this error, do you know what i am doing wrong?"

You need to put the path to ESO in quotes because there are spaces in the folder name, so:

C:\>YourPathToESOExecutable\EsoExtractData "D:\SteamLibrary\steamapps\common\Zenimax Online\The Elder Scrolls Online\game\client\game.mnf" \export\pathToYourExportFolderProbablyAlsoInQuotes\

Also, the extraction tool available at https://www.esoui.com/downloads/info125 ... tData.html only extracts a few files with the proper names for me. The rest are numbers with correct extension, so you have to manually rename them. Still, I've managed to find many of the correct textures and apply them to meshes captured by Ninja Ripper, but it would be so much better to be able to convert the files directly from the GR2s. Thanks for all your work on this,
jayn23
mega-veteran
mega-veteran
Posts: 250
Joined: Sun Jul 17, 2011 9:30 pm
Has thanked: 61 times
Been thanked: 241 times

Re: Granny .GR2 Reader plugin for Noesis

Post by jayn23 »

You need to put the path to ESO in quotes because there are spaces in the folder name, so:

C:\>YourPathToESOExecutable\EsoExtractData "D:\SteamLibrary\steamapps\common\Zenimax Online\The Elder Scrolls Online\game\client\game.mnf" \export\pathToYourExportFolderProbablyAlsoInQuotes\
thanks for the tip, ill try it out as soon as i get back home from work

ill take a look if i can figure out why the UV are corrupted , but my main focus is getting the meshes and animations working correctly.
captured by Ninja Ripper, but it would be so much better to be able to convert the files directly from the GR2s. Thanks for all your work on this,
do you have by any chance a model you ripped using ninja ripper with correct UV and and its corresponding gr2 file?
i am looking at the data and the uv and normal data isnt making sense to me.
its a 36 bytes block
12 - Bytes - positions
4 bytes FF FF FF FF
10 Bytes yields numbers that cant be UV or Normal's like nan - file is telling me these 12 bytes are the noramls
2 bytes FF FF
8 Bytes - yields numbers that cant be UV like nan - and this looks like uv if i were getting reasonable numbers
zardalu
veteran
Posts: 134
Joined: Sat Sep 13, 2008 3:13 pm
Has thanked: 17 times
Been thanked: 31 times
Contact:

Re: Granny .GR2 Reader plugin for Noesis

Post by zardalu »

do you have by any chance a model you ripped using ninja ripper with correct UV and and its corresponding gr2 file?
I sent you a PM :)
jayn23
mega-veteran
mega-veteran
Posts: 250
Joined: Sun Jul 17, 2011 9:30 pm
Has thanked: 61 times
Been thanked: 241 times

Re: Granny .GR2 Reader plugin for Noesis

Post by jayn23 »

Here is my updated script

Iv have made many bug and feature fixes some of them include:

1. fixed rare instance that mesh data was being deleted by the script before being processed by noesis
2. fixed rare issue where some data could be read as big endian rather than small endian
3. added support for dynamic amount of weights - previously was only 4 any other number would cause a crash
4. added support for files with multiple animation in file - currently i read only first animation data
5. added support for files with multiple skeletons under the same model (in all cases were dummy bones )
6. re did my animation and skeleton building ,fixed many issues but caused some issues with models that previously worked, to address this
i added at line 21 SKELETON_DEBUG = 0, if you skeleton inst loading correctly try changing this to SKELETON_DEBUG = 1.
only game i know this affects is Winter X-Games: Snocross, this game should be run in Mode = 1

and many other fixes...

known issues:
1. rigid bodies (like props, guns etc..) that dont have wights dont attach to model - will be fixed in future update.
2. few animations dont work correctly
3. ESO models + skeletons + animations seem to work , uv and normals are still corrupted
4. files with to many models give error and crash - i will see in the future what can be done about it

i am currently planning as a future update to redo a very big part of the code to support user control over multiple animation, and just to make the code cleaner, currently it is a huge mess :oops: , but that is probably weeks away.

please check this update and let me know if everything works
Last edited by jayn23 on Thu Jul 09, 2020 9:00 pm, edited 1 time in total.
KingJuls
advanced
Posts: 59
Joined: Wed Feb 28, 2018 8:29 am
Has thanked: 9 times
Been thanked: 3 times

Re: Granny .GR2 Reader plugin for Noesis

Post by KingJuls »

Thx for the Work jayn.

Btw can anyone share ESO Client?
Allanoon
veteran
Posts: 91
Joined: Sat Apr 14, 2012 9:00 pm
Has thanked: 116 times
Been thanked: 25 times

Re: Granny .GR2 Reader plugin for Noesis

Post by Allanoon »

Thanks for the update jayn, it's working nicely! :D
Yet a question regarding ESO, or maybe it's a noesis use that i can't remember. I see that the game divides the skeleton from the meshes (ex. dat 108, mesh 128084-085 got the skeleton at 128297) but i can't "merge" them, so the meshes aren't rigged if i extract them. Is there some command i'm missing?

Also from a fast look:
Dat 000 to 095 there're some random .dds and files which i dunno what use they have.
096 to 100 have .gr2 animation files.
101 to 104 some dunno files.
105 to 117 there're .gr2 model files (mounts, enemies, equipments).
118 to 128-129 There're like pictures and maps .dds
130 to 158 seems to contain models textures .dds
159 to 180~ still textures but i think they're Static meshes one .dds
Then i stopped~
jayn23
mega-veteran
mega-veteran
Posts: 250
Joined: Sun Jul 17, 2011 9:30 pm
Has thanked: 61 times
Been thanked: 241 times

Re: Granny .GR2 Reader plugin for Noesis

Post by jayn23 »

Thanks for the update jayn, it's working nicely! :D
Yet a question regarding ESO, or maybe it's a noesis use that i can't remember. I see that the game divides the skeleton from the meshes (ex. dat 108, mesh 128084-085 got the skeleton at 128297) but i can't "merge" them, so the meshes aren't rigged if i extract them. Is there some command i'm missing?
Glad its working correctly, it took me over a week to fix a bug that was causing 30% of animations from beyond divinity to "explode" lol
i nearly gave up. now that almost everything seems to be working i am going to work an adding new features.

let me know if i understand correctly,
your saying mesh and skeleton files are stored in different files the same way for most other games mesh/skeleton and animation are stored in different files? but i have some samples that mesh and skeleton are on the same file...
i guess i can add on option to load a skeleton file separately from mesh file, just upload a few samples for me to test with please.
Allanoon
veteran
Posts: 91
Joined: Sat Apr 14, 2012 9:00 pm
Has thanked: 116 times
Been thanked: 25 times

Re: Granny .GR2 Reader plugin for Noesis

Post by Allanoon »

jayn23 wrote: Sat Jun 27, 2020 6:58 pm Glad its working correctly, it took me over a week to fix a bug that was causing 30% of animations from beyond divinity to "explode" lol
i nearly gave up. now that almost everything seems to be working i am going to work an adding new features.

let me know if i understand correctly,
your saying mesh and skeleton files are stored in different files the same way for most other games mesh/skeleton and animation are stored in different files? but i have some samples that mesh and skeleton are on the same file...
i guess i can add on option to load a skeleton file separately from mesh file, just upload a few samples for me to test with please.
Basically yeah
Also may i ask the "names" of the files you got? The only full meshes i found are like pets/mounts/enemies not based on the characters races and all were always boneless. They're easily findable as the file size is around 200kb-1mb~
https://www.mediafire.com/file/xpdkuj8y ... e.rar/file
Apologize if they're only a few, i'll look for more if you need, matching should be correct.
And as always, thank you for your time :)
Post Reply