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

Star Citizen 3.20 .Skin Files failing to export #168

Open Baconator650 opened 7 months ago

Baconator650 commented 7 months ago

Star Citizen 3.20 .Skin Files (specifically landing gear) failing to export

Baconator650 commented 7 months ago

Also appears that .chr files fail to extract as well.

Markemp commented 7 months ago

Was this working on earlier versions?

Baconator650 commented 7 months ago

It's a change in the ivo format.

There has been a lot of back and forth on versions working. But before 3.20 (using 3.19) we were able to convert the .skin files with 1.3.1 of the CGF-Converter with out issue and preserving the material naming convention that some use in their workflows.

NargiT commented 5 months ago

Any news about this ?

Markemp commented 5 months ago

Still working on getting animations working. Sorry this is taking so long. It's been a blocker for a few months now.

Markemp commented 5 months ago

This may not be so bad. Preliminarily it looks like he only gave new chunk type numbers for the objects. Testing a solution today and may have a preliminary 1.6 posted for those who want to use the 3.20/3.21 files

Markemp commented 5 months ago

Hmm... maybe it won't be so easy after all. Old on left, new is the bone garbage on the right.

image

Baconator650 commented 5 months ago

Oh, thats a big difference. Have you tried experimenting with some of the landing gear?

Markemp commented 5 months ago

I take it back. I think I got it. I just forgot to handle the materials, so it failed spectacularly. I'll try the landing gear next. Have any in particular you want tested?

image

Baconator650 commented 5 months ago

I have been using the AEGS_Gladius as my testing model as I can look at legacy stuff to compare it too. But for the new stuff probably the new Crusader A1/C1 would be a good test for a newer ship.

Markemp commented 5 months ago

Gladius landing gear. Armature is there too.

image

I'm having some problems getting the texture paths to output properly, so working on cleaning that up. Shouldn't be much longer.

Baconator650 commented 5 months ago

Gladius landing gear. Armature is there too.

I'm having some problems getting the texture paths to output properly, so working on cleaning that up. Shouldn't be much longer.

Looking good!! To maybe save you some time, both Blender and 3DS Max users use specialized scripts to handle Star Citizen's complex and varied materials and only require the naming convention of the material to be like "lowtech_alpha_ext_a_mtl_graphical_tint_decal_a".

Markemp commented 5 months ago

image

Is it supposed to be -mtl- or _mtl_?

Baconator650 commented 5 months ago

image

Is it supposed to be -mtl- or _mtl_?

The later

'mtl'

Markemp commented 5 months ago

Got it. The latest version of the branch should name the materials correctly now.

I'm close to doing a 1.6 release, so if you can find any bugs that need addressing or some updates, let me know. Thanks!

edit: derp. I could have answered my own question by lookup up a comment or two. 🤦

NargiT commented 5 months ago

Thank you for your work @Markemp

Almightykitten commented 5 months ago

So I compiled the current repository and it just converts to the folder that is navigated in powershell, and not where the source files are.

Markemp commented 5 months ago

So I compiled the current repository and it just converts to the folder that is navigated in powershell, and not where the source files are.

I'm not sure I follow. Converts what to the folder?

Baconator650 commented 5 months ago

So I compiled the current repository and it just converts to the folder that is navigated in powershell, and not where the source files are.

I'm not sure I follow. Converts what to the folder?

Having the same issue was batch converting. The collada files are being placed in the folder in which powershell is opened in, not the same folder where the .cgf, .cga, .skin

Markemp commented 5 months ago

Err... that's not good. Can you show the commands you are running when that happens?

Almightykitten commented 5 months ago

For example: The command: Get-ChildItem -Recurse *.cga, *.cgf, *.chr, *.skin -exclude *_lod* | ForEach-Object -parallel {cgf-converter -smooth -en proxy -em proxy -en bbox -en "3D_VisArea" -em nocollision_faces -en gut -en damage -en dmg -prefixmatnames -notex $_ -objectdir "F:\sc_modding\scdv_trial\all_my_stuff\Data"}

In previous versions that correctly converted to the same locations as the individual source files, now it converts it all to the location you navigated to with powershell.

Starfab has them all pooling up in its directory too when it uses it

Almightykitten commented 5 months ago

Another thing it ignores the path for the mtl in the cga/cgf/skin file if it has .mtl at the end of it, so you don't get the actual material names in the converted dae. This be a problem for older files. And again previous versions didn't have issues with that.

With these problems fixed it would actually be ready to be published again.

Markemp commented 5 months ago

Ok, thanks for the info. I'll take a look at it and see if I can figure out what broke. Sorry about that!

Markemp commented 5 months ago

Was this working on a recent commit? Can you help me pinpoint the time it stopped working?

Almightykitten commented 5 months ago

reckon its the function Path.GetFileNameWithoutExtension from commit

Markemp commented 4 months ago

Pushed up a new commit that I'm hoping fixes these issues. Can you test them out and let me know?

Baconator650 commented 4 months ago

Think it might be a problem with how I am compiling it, but I have been getting this.

image

Baconator650 commented 4 months ago

And this... image

image

Files are placed in their proper folder though

Markemp commented 4 months ago

Hm... the material name is a problem. Something like -material-27 means it couldn't find the material file. Are these 3.20 or 3.22 files? I haven't downloaded the latest version yet.

Markemp commented 4 months ago

image This is v3.21. Looks vaguely like a landing gear too? image

Baconator650 commented 4 months ago

3.22 files

Markemp commented 4 months ago

Ok, let me download them and take a look.

Markemp commented 4 months ago

Here's the 3.22 CRUS Spirit:

image

Can you build again and see if it's working? Not sure why it failed.

Baconator650 commented 4 months ago

I think it's a user error on my part on building and publishing it to an exe.

Baconator650 commented 4 months ago

image

Found the issue causing the errors. User error using StarFab, exported the mtl in a json format (needed for Max scripts to create materials). Switched the export to a CryXMLB format and it worked (StarFab json and xml format do not work).

Looks like the bone placement for the landing gear is off, I believe this was an issue before though. This appears to be an issue with Max's Importer and StarFabs Scripts in Blender. Importing the landing gear directly into blender doesn't cause the issue.

Baconator650 commented 4 months ago

Its looking like the latest commits has broken bone structure to leave only a single bone.

When playing around with the landing gear before the commit, it looks like the rotations aren't being applied.

image

Also if you want some help on what the rotations are suppose to be, I can provide examples of what CGF-Converter is doing and what they are suppose to look like (using an older SC build and Dymek's modded CryEngine, I can export the HTR animations which keeps a lot of the rotation data intact.)

Markemp commented 4 months ago

I found the issue with it only creating the root bone, and will push up a fix here in a few minutes: image

Still cleaning up some material handling stuff, but almost have that part done. Then ... not sure what next. I'll go through the issues list and make sure as much stuff is solved as possible.

edit: I don't like how the bones are handled in this gladius landing gear, but that's more of an issue with the cryengine file. You rotate a bone that should turn a whole pipe, but only the first half of it turns. You have to select the bone on the other side and rotate them both at the same time. It's probably handled in the animation files, but it's just a really goofy way of setting up a bone hierarchy.

Emygdious commented 3 months ago

Still having issues with .skin files not sure if a fix is still being worked on currently or not.

PS Error

Markemp commented 3 months ago

Yup, still working on a 1.6 release. I'm fixing up some material issues right now. Until that is complete, the new SC skin files will have problems. Sorry for the time it is taking on this.

Baconator650 commented 3 months ago

Don't forget to look at the rotations for SC files too

Markemp commented 3 months ago

Got the materials refactored (again). Should support multiple material files, which is something I've only seen in Archeage models so far, but it needed to be done.

Arclight pistol parts are working in this build too. image

@Baconator650 , can you check the landing gears too? I think they are working but just want to make sure.

Baconator650 commented 3 months ago

Materials are good. Geometry is outputting.

Position and Rotations are substantially off: image

Comparing it with an older extraction [Correct Position, somewhat correct rotations], it appears to be rotated 180 degrees as well.

image It appears to be just the bones/skeleton that are off image

Overall CGF-Convert rotations are good, but they don't match up with what the animation files export out as from Cry Engine. This usually requires a quick fix with rotation of the pivot points by [90,00,00] on then [00,90,00] via a local rotation. Here is a comparison with a normal CGA file.

[done with the last tweaks from 2/6/2024][all displayed rotations are world reference] image

[Done with an older CGF-Converter Build from an older SC build][all displayed rotations are world reference] image

(CC=CGF Converter; HTR=HTR animation file export from Dymek CryEngine reading a SC3,8.2 build)

Markemp commented 3 months ago

Is this for gltf outputs?

Baconator650 commented 3 months ago

Collada (.dae), it's what StarFab deals with.

Markemp commented 3 months ago

Got it. Found the seat and it does look like it's moved down instead of I'm assuming up.

image

What landing gear is that?

Baconator650 commented 3 months ago

Should be the front landing gear of the Hurricane.

Markemp commented 3 months ago

Here is the ANVL Hurricane front landing gear CHR and SKIN files. The CHR definitely is not matching up with the skin bones. I'm looking into that now. image

I think the animation files are referencing the chr files? Are you pairing them up as part of the process?

Can you post the old anvl_hurricane_landing_gear_front_chr.dae file? I'd like to compare it too.

Baconator650 commented 3 months ago

The Cry Engine Character Tool is what I am using to extract the animations, which uses these .cdf and .chr.chrparams

image

image

Unfortunately due to CiG TOS, I can't not publicly post Star Citizen files.

Markemp commented 3 months ago

Oh, I already have the game files. I'm just looking for the working Collada file.

Or can you tell me if it was made with the 1.5 converter or some intermediate build?

Baconator650 commented 3 months ago

1.3 version