Gildor's Forums

Author Topic: glTF support  (Read 1341 times)
Gildor
Administrator
Hero Member
*****
Posts: 7969



View Profile WWW
glTF support
« on: August 15, 2019, 16:02 »

For Blender import, there's a second option - to use glTF format. Here's the main thread:
https://www.gildor.org/smf/index.php/topic,6281.0.html

Please note that you should use Blender 2.8+ in order to get fully functional built-in importer. Older Blender versions require custom glTF addon, please see the thread mentioned above.
« Last Edit: January 23, 2023, 02:11 by Gildor » Logged
Kino
Newbie
*
Posts: 10


View Profile
Animation data .psk vs .gltf
« Reply #1 on: January 14, 2023, 19:11 »

Hi people!
First of all, sorry if my question is stupid, I'm a noob. So, I've been playing around with exporting 3D models from Unreal Engine games, and I'd like to ask : when exported into .psk files, the models come up with an "AnimSet" folder containing .psa files. Those are animation-related data, I get it. However, when exported into .gltf files, the exports don't contain those data anymore. So, here's my question : in this case, are the animation data contained in the .gltf file itself, or in another file, say, the .bin file going on par with the model?
Second question, in case anyone has any idea : while exporting, I get "Material3" and "MaterialInstanceConstant" folders containing .mat and .props.txt files. What are those? Do they have any interest in keeping or could I as well delete them without thinking? I attached a folder with an example of what i get (just deleted the textures for size reasons) in case it helps.
Finally, I'd be more than pleased if someone can also answer my second question : how can I import (and visualize) the animation data in blender?
Thanks in advance y'all, and I'll use the opportunity to thank and congratulate Gildor for the amazing tool they've provided us. I'm really grateful.
Thanks y'all

* WhiteKing.zip (262.9 KB - downloaded 35 times.)
« Last Edit: January 14, 2023, 19:15 by Gildor » Logged
Gildor
Administrator
Hero Member
*****
Posts: 7969



View Profile WWW
Re: Animation data .psk vs .gltf
« Reply #2 on: January 14, 2023, 19:16 »

Fixed a typo: psk, not spk.

gltf format doesn't allow to store animations separately from the mesh, so yes - everything is in .gltf and .bin files.
Logged
Kino
Newbie
*
Posts: 10


View Profile
Re: Animation data .psk vs .gltf
« Reply #3 on: January 14, 2023, 20:57 »

Noted, thank you!!!
Logged
Kino
Newbie
*
Posts: 10


View Profile
Re: Animation data .psk vs .gltf
« Reply #4 on: January 22, 2023, 04:10 »

Hello again! I'd like to ask one more question, just to be sure : when exporting models into glTF, are the animation data stored by default into the .gltf and .bin files, or is there a process to do in Umodel while extracting to make it happen? Considering, of course, that the "animation" checkbox in the "View / Export object types" column is checked. The game I am trying to export models from is Alice Madness Returns.
I exported most of the models I wanted in .gltf because .psk were rough in blender (I didn't try md5mesh btw), and as I just have found out Juso3D say how easy it is to smooth psk models in blender (here https://www.gildor.org/smf/index.php?topic=7619.0 , I feel very dumb), and so far i couldn't find how to use animation data from the .gltf I exported. So I COULD reexport everything into .psk and start again, but it'd waste a lot of work I did so far. That's why I'd like to make sure I didn't find how to use animation because of how Blender works, or because they're not there in the first place ^^'
Also while I'm at it, what are the LODs from the "export LODs" checkbox? I didn't check it because i have no idea what purpose it could have :x
Thank you in advance!
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7969



View Profile WWW
Re: Animation data .psk vs .gltf
« Reply #5 on: January 22, 2023, 04:24 »

Hi.

Not sure if you're doing things right. This is a part of readme.txt:
Quote
22.08.2018
- implemented glTF skeletal animation export; note that the animation should be opened in mesh viewer for that

So, to get animations exported to gltf, your should open the model in viewer, assign animation to it (Ctrl+A key), and then export (Ctrl+X). This is because of the gltf limitation again, compared to psa: this format doesn't let to export animation without a mesh, but Unreal stores them separately.

In other words, if you're using batch export, then you won't get any animations in your gltf files - you'll see only meshes there. When batch exporter works, it will see the animation, but it won't know which mesh it belongs to (plus, animations could be shared between multiple meshes). And it can't export the animation as a "standalone" object. So, it simply skips it.
Logged
Kino
Newbie
*
Posts: 10


View Profile
Re: Animation data .psk vs .gltf
« Reply #6 on: January 22, 2023, 17:42 »

Thank you very much for your reply!!! I managed, with your explanations :') I was exporting in batch indeed, hence my problem. I should manage now.
In your opinion, even considering that both the .psk and .gltf formats have pros and cons, would you say that there is one of the two that is, overall, more useful or better than the other, for editing and/or archival purposes? From where I stand I feel like psk is a less widely supported format file, which could be a problem, but that working with animation data is easier because of the .psa file, for example.
Thank you again an incredible lot for your help!
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7969



View Profile WWW
Re: Animation data .psk vs .gltf
« Reply #7 on: January 23, 2023, 02:10 »

Yes, you're right - psa allows to use animations separately from the mesh, what's flexible. And yes - gltf is "more widely supported" (in theory). However, you can't load gltf to Max or Maya, as there's no supporting plugins for them. So, I've added gltf support with a hope, that the format will be trully supported in the future.

There are lots of applications which can EXPORT gltf, but not IMPORT. Unreal engine has the same restrictions - it has gltf exporter in marketplace, but no importer.

Regarding UModel itself, gltf provides export of mesh normals and tangents (what's not a part of psk format), however there's no export of materials - I don't know how Blender users handles that. I didn't add material export because of gltf inflexibility in that - it has MSR baked into the single texture, so doing export of that would require building a new texture. I didn't find the good solution for that (2+ years ago), so I just left it "as is".

Also, gltf has support for morph targets. But - in quite complicated way ("sparse data"), plus, only up to 4 morph targets per mesh, what makes it useless for exporting things from Unreal games.
Logged
Jump to:  

Powered by SMF | SMF © 2006-2009, Simple Machines LLC
Leviathan design by Bloc | XHTML | CSS