Markemp / Cryengine-Converter

A c# program to convert Crytek files to Collada (XML) format
https://www.heffaypresents.com/GitHub/
GNU General Public License v2.0
208 stars 53 forks source link

Refactor GLTF #172

Closed Soreepeong closed 5 months ago

Soreepeong commented 5 months ago

image

I still have no confidence on whether MeshSubset.MatId is an index inside SubMaterials node inside a material XML file; the code is written under that assumption, and it seems to work.

Markemp commented 5 months ago

I think you're right about the MeshSubset.MatId. :( I'm looking at some new Ivo files from Star citizen, and it's not the index but rather a hex 0x3F519404. Argh! I need to check the material file and see if that value is stored anywhere.

Oh weird. The classic cryengine files have the matId property which seems to line up to the index. image

With the Ivo SC files, there is a property I have named materialId that seems to be the index. Or at least an index. It seems to be the order of the submeshes, but whether that matches with the order in the mtl file... I'm not sure. image

edit: hahaha, I must have run into this before. The submesh chunk for Ivo reads the first property into MatId. It's just my 010 template that has them backwards. MatId seems to be the index of the material in the mtl file.