Coder Social home page Coder Social logo

markemp / cryengine-converter Goto Github PK

View Code? Open in Web Editor NEW
219.0 31.0 54.0 88.98 MB

A c# program to convert Crytek files to Collada (XML) format

Home Page: https://www.heffaypresents.com/GitHub/

License: GNU General Public License v2.0

C# 99.98% Batchfile 0.02%

cryengine-converter's Introduction

Heffay Presents

Cryengine Converter

Cryengine Converter is a C# program to help convert Cryengine assets into a more portable format. Currently it supports .obj (No longer supported) and .dae (Collada), although work is in progress to allow exporting Cryengine assets into USD (Universal Scene Description) format. The default output is Collada, as this supports the most features, including Armature/rigs with vertex weights, as well as improved material handling.

How do you use it? Well, here is the output from the current Usage:

PS D:\scripts> cgf-converter

cgf-converter [-usage] | <.cgf file> [-outputfile <output file>] [-objectdir <ObjectDir>] [-obj] [-blend] [-dae] [-smooth] [-throw]

-usage:           Prints out the usage statement

<.cgf file>:      The name of the .cgf, .cga or .skin file to process
-outputfile:      The name of the file to write the output.  Default is [root].obj
-noconflict:      Use non-conflicting naming scheme (<cgf File>_out.obj)
-allowconflict:   Allows conflicts in .mtl file name
-objectdir:       The name where the base Objects directory is located.  Used to read mtl file
                  Defaults to current directory.
-dae:             Export Collada format files (Default)
-smooth:          Smooth Faces
-group:           Group meshes into single model

-throw:           Throw Exceptions to installed debugger

Ok, so how do you actually USE it?

I'm going to assume you've already taken a Cryengine based game (Mechwarrior Online, Star Citizen, etc) and extracted the .pak files into a directory structure that essentially mimics a Cryengine layout.

PS D:\depot\Star Citizen> dir

    Directory: D:\Depot\Star Citizen

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        5/20/2017   7:59 AM                Animations
d-----        5/20/2017   7:59 AM                Entities
d-----        5/20/2017   7:59 AM                Levels
d-----        5/20/2017   8:00 AM                Libs
d-----        5/20/2017   7:59 AM                Materials
d-----        5/20/2017   8:43 AM                Objects
d-----        5/20/2017   8:00 AM                Prefabs
d-----        5/20/2017   8:00 AM                Scripts
d-----        5/20/2017   8:54 AM                Sounds
d-----        5/20/2017   9:04 AM                Textures
d-----        5/20/2017   9:05 AM                UI

This is pretty close to what Cryengine/Lumberyard games will look like after you extract all the .pak files, using a utility like 7zip. The important directories here are Objects (generally contains the .cga/.cgam/.cgf/.skin files) and the Textures directory. You generally don't need to worry about the directory structure unless you're using my cryengine-importer.ps1 script, but let's just call this the root directory for Cryengine assets.

Aside: When compiled (or you just download the .exe), this program is easiest to use when you put it into a dedicated directory that is in the path. I won't go into how to modify the path on your computer, but I have my own d:\scripts directory with cgf-converter.exe in it, along with a few other commonly used scripts and programs. I recommend you do the same (or something similar), as from now on the Powershell commands I type out will assume that the programs are in the path. If they aren't, the commands I list will not work.

Aside 2.0: Be careful exporting stuff to .obj files, as it is no longer supported. A Cryengine file (in incredibly simplified terms) consists of a geometry file (ends in .cga/.cgf/.cgam/.skin) and the related material file (ends in .mtl). The Cryengine material file is an XML file that contains material info. This program will take that file and convert it by default to an .obj material file with the same name, which is not ideal. Use the -noconflict argument to make it write to a similar name that won't conflict.

** Important:** Use the -objectdir argument whenever possible! The location of the material files is dependent on a number of factors, and the program does its best to find them. However, if it can't find the proper material file for the object you're trying to convert, it will just create default materials for the model.

Tutorial Videos:

I have a playlist of tutorial videos here: https://www.youtube.com/watch?v=6WoA2ubTZ0k&list=PL106ZeLhxxVn551_IKGKeU_LBODtkh29b

Conversion Instructions

Collada (-dae)

Collada format (v1.4.1) may be a better option for most game assets. On top of having cleaner geometry than .obj, the material file is included into the Collada (.dae) file, so you only have one file to worry about (so no need to use -noconflict). In addition, if there is an armature/rig/skeleton, Collada files can also contain all that information as well.

To convert a single .cga/.cgf/.skin/.chr file to a .dae file, using Powershell:

PS D:\Depot\Star Citizen\Objects\Spaceships.ships\AEGS\gladius\>cgf-converter AEGS_Gladius.cga -objectdir <insert the directory to the Object dir>

You can replace the -dae with -collada as well.

Waveform (-obj. Avoid using this unless you absolutely have to. Not supported!)

To convert a single .cga/.cgf/.skin/.chr file to an .obj file, using Powershell:

PS D:\Depot\Star Citizen\Objects\Spaceships.ships\AEGS\gladius\>cgf-converter AEGS_Gladius.cga -obj

This will create a couple of files in that directory:

  • AEGS_Gladius.obj
  • AEGS_Gladius.mtl

Since the Cryengine .mtl file has a good chance of being in that directory, it will overwrite it unless you use the -noconflict argument.

PS D:\Depot\Star Citizen\Objects\Spaceships.ships\AEGS\gladius\>cgf-converter -noconflict AEGS_Gladius.cga

Instead of an AEGS_Gladius.mtl file, it will create an AEGS_Gladius_mtl.mtl file, and leave the original .mtl file as is.

There are occasions where you may want to overwrite the file, but generally you are going to want to use the -noconflict argument.

Bulk Conversion

If you want to convert all the files in a directory, you can provide a wildcard for the file name:

cgf-converter *.cga -objectdir <path to the Objects folder>

This will take every file in the directory where the command is being run and convert it to Collada format.

If you want to convert all the files in a directory as well as all the directories below it, you can use the -recurse option to make it traverse:

foreach ($file in (get-childitem -recurse *.cga,*.cgf,*.chr,*.skin)) { cgf-converter $file -objectdir <path to the Objects folder> }

NOTE: If you run this on the Objects directory, it will convert EVERY file in the game. This can take a very long time, and takes a lot of disk space. Be careful using the command like this.

Finally, the converter does support being run through the Windows Explorer, so you can just drag a .cga file or files onto cgf-converter.exe and it'll do a default conversion (to .dae). This isn't ideal, but it is the quick and dirty way if you are morally opposed to using a prompt. 👍

Questions? Feel free to contact me and I'll be happy to provide some additional help.

cryengine-converter's People

Contributors

dependabot[bot] avatar diogotr7 avatar kjasi avatar lonelyhawk avatar markemp avatar peter-dolkens avatar soreepeong avatar ventorvar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cryengine-converter's Issues

Latest release generating invalid data in DAE

File conversion on the latest release is generating non-valid vertex data when running on Star Citizen files from multiple versions. Examples of parsing errors are as follows:

Schema validation (Warning): Error: ERROR_TEXTDATA_PARSING_FAILED Element: float_array, Line: 1922, Column: 148375, Additional:  -E♥
Schema validation (Warning): Error: ERROR_TEXTDATA_PARSING_FAILED Element: float_array, Line: 1922, Column: 148973, Additional: ∞ -185.438908 0.00
Schema validation (Warning): Error: ERROR_TEXTDATA_PARSING_FAILED Element: float_array, Line: 1922, Column: 150469, Additional: ∞ -185.438908 0.00
Schema validation (Warning): Error: ERROR_TEXTDATA_PARSING_FAILED Element: float_array, Line: 1922, Column: 150765, Additional: ∞ -185.438908 -412
Schema validation (Warning): Error: ERROR_TEXTDATA_PARSING_FAILED Element: float_array, Line: 1922, Column: 160365, Additional: Na

This will crash most software, and I believe may not be intended :)

Trouble with UnZipping .pak files for Hunt Showdown

I'm not sure I'm not doing this correctly but I'm positive I am. I am using 7zip to extract the .pak files but it comes with an error saying "cannot open file as archive". Since Hunt is a newer game with Crytek are the .pak files encrypted? If they are is there a way to get past it?

Collada file materials not importing due to spaces on full path

Hi,

I tried to check why some collada files were not importing the materials, and I just saw something funny...

Collada file:

    <image id="Surface_Diffuse" name="Surface_Diffuse">
      <init_from>/C:\juegos\scuncomp\Data\/objects/spaceships/power_plants/a_and_r/lr-7 uopp/textures/lr-7_uopp_diff.tif</init_from>
    </image>
    <image id="Surface_Specular" name="Surface_Specular">
      <init_from>/C:\juegos\scuncomp\Data\/objects/spaceships/power_plants/a_and_r/lr-7 uopp/textures/lr-7_uopp_spec.tif</init_from>
    </image>
    <image id="Surface_Bumpmap" name="Surface_Bumpmap">
      <init_from>/C:\juegos\scuncomp\Data\/objects/spaceships/power_plants/a_and_r/lr-7 uopp/textures/lr-7_uopp_ddna.tif</init_from>

Collada (in blender) import log:

| input file      : C:\Juegos\scuncomp\Data\Objects\Spaceships\Power_Plants\A_and_R\LR-7 UOPP\LR-7_UOPP.dae
| use units       : no
| autoconnect     : no
+-- Armature Import parameters ----
| find bone chains: no
| min chain len   : 0
| fix orientation : no
| keep bind info  : no
**|! Image not found: C:\juegos\scuncomp\Data\\objects\spaceships\power_plants\a_and_r\lr-7
|! Image not found: C:\juegos\scuncomp\Data\\objects\spaceships\power_plants\a_and_r\lr-7
|! Image not found: C:\juegos\scuncomp\Data\\objects\spaceships\power_plants\a_and_r\lr-7**
Couldn't find an image by UID.
Couldn't find an image by UID.

As you can see, it is loading textures from a non existent path, and starts missing on the space on "lr7 uopp".

But not sure if this is your converter or just a blender issue-limitation, honestly...

Thanks,
Draakuns

StarCitizen ship models convert as series of empties

Whenever using the tool to convert StarCitizen ship models from the 3.9.1 patch the result is just a cloud of points. Same result when I try to import with the cryengine-importer addon.

Steps to reproduce:

  1. Extract ship assets
  2. Convert with the tool
  3. Import to blender

Expected result:
Ship mesh is imported.

Actual result:
Only empties are imported.

So I am not sure if this is a problem with the tool itself since every other model seems to convert 100% correctly or if it's the ship models themselves or if it's my workflow.

Icarus Online model issues

game: Icarus Online

I had failed to convert a model. It's a hand model (hm_inner_04.chr).
Though all the files (except this one) I tried are working so far.
I attached some models that works for the reference.


There was an error rendering D:_r\icarus_online_pc_r2017_11_28\objects
characters\players\hm\hm_inner_04.chr

Index was outside the bounds of the array.

at CgfConverter.COLLADA.WriteLibrary_Geometries() в C:\Users\Geoff\Source\Repo
s\cgf-converter\CgfConverter\Renderers\Collada\COLLADA.cs:line 633
at CgfConverter.COLLADA.Render(String outputDir, Boolean preservePath) в C:\Us
ers\Geoff\Source\Repos\cgf-converter\CgfConverter\Renderers\Collada\COLLADA.cs:line 91
at CgfConverterConsole.Program.Main(String[] args)


here's files:
icarus_hm.zip

Enhancement: Add support for new skin file format

As pointed out in #36, Star Citizen as of 3.11.x is using a new file format for .skin files. This issue is to track progress in working out this new format and ultimately implementing it in cryengine-converter.

Index was out of range. Must be non-negative and less than the size of the collection.

Some Cryengine skin files have problems


Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at CgfConverter.COLLADA.WriteLibrary_Geometries() in C:\Users\Geoff\Source\Repos\cgf-converter\CgfConverter\Renderers\Collada\COLLADA.cs:line 389
at CgfConverter.COLLADA.GenerateDaeObject() in C:\Users\Geoff\Source\Repos\cgf-converter\CgfConverter\Renderers\Collada\COLLADA.cs:line 56
at CgfConverter.COLLADA.Render(String outputDir, Boolean preservePath) in C:\Users\Geoff\Source\Repos\cgf-converter\CgfConverter\Renderers\Collada\COLLADA.cs:line 23
at CgfConverterConsole.Program.Main(String[] args)


It doesn't come out the dae file. How to solve it?

Flag not updated on help page

Hi,

I am using this tool for SC, and as DDS on that game are split into several files and unsupported I went down the road converting to TIF. The point is that you must also use the -tif flag when converting the files, but it doesnt appear on the help page.

Can you add it to avoid more ppl having the same doubts as I had if you see fit?

Thanks!
Draakuns

converting .cgf

i'm having an error trying to convert a .cgf file from my game.
cgf-converter.exe -dae forest_ruin.cgf -noconflict
is the command that i've been trying, also attempted with -obj instead of dae
The error I end up with is
"There was an error rendering forest_ruin.cgf",
"Object reference not set to an instance of an object.
at CgfConverterConsole.Program.Main(String[ ] args)"

forest_ruin.zip

„The object reference was not set to an object instance.“?

Tried it per PM already - probaly a noob problem:
I unpacked a copy of my (than) SC 3.0.1 build with the SCLeaksP4KBuster. It worked pretty good and looks right [saved in D:\Depot]. Than I downloaded your gf-converter.exe, did put it in the directory D:\scripts and modified the path in the advanced system settings [D:\scripts].

Trying to convert some single Constellation-files took me many hours on several evenings, but I didn' get it working. Most probably the problem is sitting in front of the screen.

Copying the .cga or .cgam files into the directory and drag'n dropping them from there in the explorer only makes opening and closing a littele black window for 0.1 sec.

Typing in power shell only produces this cryptic (to me) failure massage:

„The object reference was not set to an object instance.“ (in German: „Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.“)
image: http://www.alphaforge.de/sc/error_ggf-converter.png

I have no idea, what to try now. Can you or somebody here help me?

best regards

Star Citizen skin files don't export mesh

I was converting Star Citizen files (tried on both 3.10 and 3.12 files) and I noticed that whenever I included a .skin file, the .dae file only contained the bones. No mesh was included. When I excluded the .skin file, I got the mesh.

I also noticed that after importing both a mesh and skin file, that the bones where very off-set from where the mesh is. Example:
image

The male Vanduul Helmet (what I used for testing) is located here: Data\Objects\Characters\Human\male_v7\armor\ccc\m_ccc_vanduul_helmet_01.cgf

Fix rotation mode and W

To fix rotation in blender:
- Select object.
- Change Rotation Mode from XYZ Euler to Quarternion
- Inverse W (so if .991, change to -.991).

Also look at making proxy material transparent for shields.

Star Citizen 3.3 ships transform matrix

Hello!
Thanks for your project.

Unfortunately, I encountered a number of problems when importing sc 3.3 files.

  1. Converter version 1.03 creates files from which you can import only the skeleton. The geometry is present in the file, but not processed. It looks like an error in the structure of xml. Tested on a blender, autodesk collada and opencollada
  2. Most models of ships have problems with the transform matrix - their parts are not in their places, turned, etc.

Sample files are ready to send to you say.
Also posted them in your topic on xentax
http://forum.xentax.com/viewtopic.php?f=33&t=13137&sid=cb7c3dded970564401baa9cf2aedb66e&start=90

Can you help?
Thank you.

does this not work for .cga?

PS D:\depot\miscreated\GameSDK\Objects\vehicles\F100Truck> cgf-converter.exe .\F100Truck.cga -objectdir "d:\depot\miscreated\GameSDK"
Input file set to .\F100Truck.cga
Data directory set to d:\depot\miscreated\GameSDK\


There was an error rendering D:\depot\miscreated\GameSDK\Objects\vehicles\F100Truck\F100Truck.cga

Object reference not set to an instance of an object.

at CgfConverter.COLLADA.WriteLibrary_Effects() in C:\Users\Geoff\Source\Repos\cgf-converter\CgfConverter\Renderers\Collada\COLLADA.cs:line 405
at CgfConverter.COLLADA.Render(String outputDir, Boolean preservePath) in C:\Users\Geoff\Source\Repos\cgf-converter\CgfConverter\Renderers\Collada\COLLADA.cs:line 89
at CgfConverterConsole.Program.Main(String[] args)


my first time using this, so probably a noob problem.

Error on conversion to DAE with some SC assets

Running release 1.05 on SC files, I'm intermittently getting the following error during conversion to DAE:

********************************************************************************
There was an error rendering X:\sc38\Data\Objects\Spaceships\ships\AEGS\Reclaimer\Exterior\AEGS_Reclaimer.cga

Object reference not set to an instance of an object.

   at CgfConverter.COLLADA.CreateNode(ChunkNode nodeChunk) in C:\Users\Geoff\Source\Repos\cgf-converter\CgfConverter\Renderers\Collada\COLLADA.cs:line 0
   at CgfConverter.COLLADA.CreateChildNodes(ChunkNode nodeChunk) in C:\Users\Geoff\Source\Repos\cgf-converter\CgfConverter\Renderers\Collada\COLLADA.cs:line 1253
   at CgfConverter.COLLADA.CreateNode(ChunkNode nodeChunk) in C:\Users\Geoff\Source\Repos\cgf-converter\CgfConverter\Renderers\Collada\COLLADA.cs:line 1200
   at CgfConverter.COLLADA.CreateChildNodes(ChunkNode nodeChunk) in C:\Users\Geoff\Source\Repos\cgf-converter\CgfConverter\Renderers\Collada\COLLADA.cs:line 1253
   at CgfConverter.COLLADA.CreateSimpleNode(ChunkNode nodeChunk) in C:\Users\Geoff\Source\Repos\cgf-converter\CgfConverter\Renderers\Collada\COLLADA.cs:line 1236
   at CgfConverter.COLLADA.CreateNode(ChunkNode nodeChunk) in C:\Users\Geoff\Source\Repos\cgf-converter\CgfConverter\Renderers\Collada\COLLADA.cs:line 1162
   at CgfConverter.COLLADA.WriteLibrary_VisualScenes() in C:\Users\Geoff\Source\Repos\cgf-converter\CgfConverter\Renderers\Collada\COLLADA.cs:line 1058
   at CgfConverter.COLLADA.Render(String outputDir, Boolean preservePath) in C:\Users\Geoff\Source\Repos\cgf-converter\CgfConverter\Renderers\Collada\COLLADA.cs:line 23
   at CgfConverterConsole.Program.Main(String[] args)
********************************************************************************

This isn't happening on all files; files with this error are not converted.

Broken UVs for .obj, broken normals for .dae.

When importing the converted .dae files the normals seem to be broken:
normals01
normals02
When using -obj this problem does not occur, however the UVs are broken.
Also, when trying to import .obj files the program crashes, meaning I have to import the .obj files into another program and export them as .fbx . This is not an issue with the program as importing other .obj files works fine. Any ideas as to what might be causing this?

Cryengine 5 Cgf

I'm try with Cryengine 5 Cgf and get error : "Version 919 of ChunkTimingFormat is not supported"

Pandemic Express Extraction issue.

Unhandled Exception: "System.MissingMethodException: Method not found: '!!0[] System.Array.Empty()'.
at CgfConverterConsole.Program.Main(String[] args)"
is what i get when attempting to extract the rebellion set models

CGF may contain PhysicsData *AND* Mesh

Issue: If a CGF contains a node that has a PhysicsData attribute, the mesh geometry node is discarded while it could be imported

Replacing the else if to a simple if in COLLADA.cs:4891 solves the lack of mesh geometry in the scene (which led to an error on import).

capture

Unable to convert .obj files

Single conversion doesn't work:
cgf-converter palm_tree_large_a_con.cgf -obj -noconflict

Bulk conversion doesn't work:
cgf-converter.exe *.cgf -obj D:\mydir\

My target files were cgf files from CryEngine 5's GameSDK.

[REQUEST] Star Citizen Prefab and Object Container File XML to .DAE

Request to add an addition Cry Engine/Star Citizen File format to the CGF-Converter, as to serve as method for non-Blender users to import Prefab/Object Container data.

  • Converter will read a variety of prefab data (Standard Cry Engine XML and Converter SOC (located in .socpak) and converter them into a .dae file.

  • Objects Entities (cga, cfg, skin) create a dummy/helper with position/rotation/scale and maintain appropriate hierarchy.

  • Light Entities create a standard light with the appropriate data from the .xml OR creates a dummy/helper like object entities

  • Additional/Unknown entities: dummy/helper with position/rotation/scale and maintain appropriate hierarchy.

  • Entities with missing positional data: do not create any dummy/helper or with default pos/rot/scale.

Current Star Citizen .socpak to xml conversion as found here: https://www.youtube.com/watch?v=1wQWaif5DUc&list=PLr5XU4B6R4l7fvfdTehSfAZb2QDd0HFjH&index=9

Archeage models

~~I know I've already messaged you about this on reddit, but I figured I should leave this here too.

It looks like the converter does not support Archeage models (Cryengine 3). When trying to convert a .cgf file, it outputs the following error:

Object reference not set to an instance of an object.

in CgfConverter.COLLADA.WriteLibrary_Effects() in C:\Source\Repos\cgf-converter\CgfConverter\Renderers\Coll ada\COLLADA.cs:line 405 in CgfConverter.COLLADA.Render(String outputDir, Boolean preservePath) 
in C:\Source\Repos\cgf-converter\Cgf Converter\Renderers\Collada\COLLADA.cs:line 89 in CgfConverterConsole.Program.Main(String[] args)

^^^^^^^^^^^^^ RESOLVED ^^^^^^^^^^^^^

Trying it on a .chr file displays this:

Version 801 of ChunkCompiledBones is not supported

   in CgfConverter.CryEngine_Core.Chunk.New[T](UInt32 version) in C:\Source\Repos\cgf-converter\CgfConverter\CryEngine_Core\Chunks\Chunk.cs:line 0
  in CgfConverter.CryEngine_Core.Model.Read_Chunks(BinaryReader reader) in C:\Source\Repos\cgf-converter\CgfConverter\CryEngine_Core\Model.cs:line 292
   in CgfConverter.CryEngine_Core.Model.Load(String fileName) in C:\Source\Repos\cgf-converter\CgfConverter\CryEngine_Core\Model.cs:line 180
   in CgfConverter.CryEngine..ctor(String fileName, String dataDir) in C:\Source\Repos\cgf-converter\CgfConverter\CryEngine\CryEngine.cs:line 59
   in CgfConverterConsole.Program.Main(String[] args)

Again, I know you're aware of this because of my reddit message, but on Xentax forum I saw people asking about AA models too, so I'm opening the issue here. Feel free to remove/close it if you're already working on it. It may actually be me using the -objectdir command wrong.

Here's the sample if you'd like to test it out yourself:
https://ufile.io/hqrz98wj
EDIT: I've added another sample for convenience:
https://ufile.io/eispk0ym

Messed up rigs?

So, after my last issue, I discovered that, since the older models were the ones causing issues, I should use a version of this converter that supported an older version of CryEngine, and as expected, It worked.

Now I have a different issue: The models are working just fine: the mesh is there, the skeleton and the materials too, but it has two problems:

  • The mesh is "separated". For some reason, there are some places where the mesh is "cut", which means that, when I move the armature, it looks broken.
    brokenhand
    This one is not much of a deal, since I can just use the "Remove Doubles" tool to fix it. But I'd be better if there was a fix to it, since the model loses some detail.

  • The rig is messed up, or sometimes completely gone. For example, when I select the vertex group Bip01_L_Calf, this is what is selected:
    brokenrigs
    For some reason, it looks like the selections of multiple vertex groups are merged in just some of them. I must add that all the VGs are there, but most do not select any vertexes at all.
    This is really a problem, since it makes the model explode as soon as I move a bone that is not the Root.

Is there anything it could be done?

"Index was outside the bounds of the array"?

I'm not really sure if I'm doing something wrong, but since I don't know anything about C#, I'm having issues figuring out what the problem is.

I've been trying to convert some Evolve models to Collada files, and since there are no .cgf files, I just rename the .skin files, because if I don't, I get the "Object reference not set to an instance of an object" error someone commented below. The weird thing is, for some models it works properly, but when converting most of them, I get this error:


There was an error rendering C:\Users\User\Desktop\TodasLasCarpetas\User\SFM\EvolveModels\Bucket_Raw\bucket.cgf

Index was outside the bounds of the array.

at CgfConverter.COLLADA.WriteLibrary_Controllers()
at CgfConverter.COLLADA.Render(String outputDir, Boolean preservePath)
at CgfConverter.Program.Main(String[] args)


Also, this only happens when I try to export the file as .dae; when I export it as a .obj it outputs a "blank" object.
Am I messing something up? Or is it just that it doesn't support those .skin files after being converted? If that was the case... none of the models would work, right?

float_type uses coma instead of period

Issue: All floating point numbers that appear in the final DAE file use coma (,) as decimal separator instead of a period (.).

Hi,

First and foremost, thank you for this tool. It has its temper at first, but when you get the hang of it, it does the job. My main criticism so far is that every time I need to export to DAE, I need to replace with a text editor all comas with periods before importing it into Blender (v2.78).

I looked at the COLLADA standard1 Ch.11 p. 501, and it seems Blender is correct to refuse floats with comas. as float_type seems to inherit from xs:double which is by the XML standard 2 "4.4.1. Decimal types" supposed to only accept period as decimal separator.

For now, I can live without a fix, using Search&Replace, not a big deal.
Best regards,

CGF may not contain Specular data

Issue: cgf-converter crashes when a CGF has no specular data.

cgf-converter.exe -objectdir xxxxx xxxxx\Objects\Weapons\Shells\shell_scargrenade\scar_gl_grenade.cgf
Data directory set to xxxxx
Input file set to xxxxx\Objects\Weapons\Shells\shell_scargrenade\scar_gl_grenade.cgf

********************************************************************************
There was an error rendering xxxxx\Objects\Weapons\Shells\shell_scargrenade\scar_gl_grenade.cgf

Null reference exception

   in CgfConverter.COLLADA.WriteLibrary_Effects()
   in CgfConverter.COLLADA.Render(String outputDir, Boolean preservePath)
   in CgfConverter.Program.Main(String[] args)
********************************************************************************

Using Visual Studio to debug yields to this line:
capture

Where __Specular seems to be null. I suppose the object has no specular attribute. Might be worth adding several guards before referencing to parsed data.

Adding conditions to prevent the null pointer ref prevents the crash:
capture

Blender Import Error

image

Working on using CryEngine Importer and trying to nail down the errors and notice that when Importing (using the standard Collada Importer, not he CryEngine Importer).

Workaround: Used Noesis to convert the dae to dae. Blender will load the *_out.dae.

Not an issue with Max.

General question

I am trying to open up the .cgf file for ppcs inside gamedata/objects/weapons so i can change the color (which im hoping should be simple) of the ppc projectile/beam with a diffuse.
I cant figure out how to get it open >.<
Would i be able to create a .mtl txt file to put a color shading over the projectile/beam?
Or would i have to find a way to get that .cgf open? if so, how would i go about getting it into a usable program?

(i'm extremely new at this sort of thing, so be gentle ;p)

Error when converting any objects

Whenever I try to convert something, the program gives me this error:


There was an error rendering
"file to convert"

Object reference not set to an instance of an object.

at CgfConverter.Program.Main(String[] args)


"Merged" Object and no Hierarchy

image

Common error with some Star Citizen files. An objected "merged" is imported that contains the geometry, but has no parent.

Loading objects individual in Max is easily fixed, but using the Blender Importer Prefab function may cause missing objects.

Normals aren't correct for SC datastreams with 16 byte structures.

The normal part of the VertsUV struct seem to have been changed to Color, and the Normal is a calculated value from the Tangents datastream. Need to calculate the correct normals from the Tangents datastream by taking the cross product of the tangent and bitangent.

Collada files being overwritten by same name cgf and cga files

Hi,

here I will try to merge 2 issues/doubts to try to reduce my noise.

  • Is your tool currently managing separate cga+cgam, cgf+cgfm, etc?

  • I see that you use a Powershell command to batch convert all cga, cgf, chr & skin extensions. On my case, a directory holds a file "test.cga" + "test.cgam", and creates a DAE file. But the problem comes when it also holds a "test.cgf" + "test.cgfm", because the previous DAE file gets overwritten, as same output name applies "test.dae".
    Am I missing something there, or there's no way to use under that condition? Or maybe I am wrong and it merges everything into the same DAE file?

Thanks in advance,
Draakuns

MWO: Atlas extract failing leading to impossible import

I know this tool is probably on its last legs, but wanted to share an issue I found.

When running the cfg-converter tool on certain mechs run into an error. This is currently based off the newest version of the of both tools. (downloaded 2 days ago from this post). For this example I'm using the atlas.

foreach ($file in (get-childitem -recurse *.chr)) { cgf-converter $file -throw -objectdir "D:MWO Assets" }
Input file set to D:\MWO Assets\Objects\mechs\atlas\body\atlas.chr
Exceptions thrown to debugger
Data directory set to D:MWO Assets

********************************************************************************
There was an error rendering D:\MWO Assets\Objects\mechs\atlas\body\atlas.chr

Unable to read beyond the end of the stream.

   at System.IO.BinaryReader.FillBuffer(Int32 numBytes)
   at System.IO.BinaryReader.ReadSingle()
   at CgfConverter.CryEngine_Core.ChunkCompiledPhysicalProxies_800.Read(BinaryReader b)
   at CgfConverter.CryEngine_Core.Model.Read_Chunks(BinaryReader reader)
   at CgfConverter.CryEngine_Core.Model.Load(String fileName)
   at CgfConverter.CryEngine_Core.Model.FromFile(String fileName)
   at CgfConverter.CryEngine..ctor(String fileName, String dataDir)
   at CgfConverter.Program.Main(String[] args)
********************************************************************************

Input file set to D:\MWO Assets\Objects\mechs\atlas\body\atlas_LOD1.chr
Exceptions thrown to debugger
Data directory set to D:MWO Assets 

Looking through the error, I think it comes back to these three lines. Because its rolling back into the ChunkCompiledPhysicalProxies_800.cs file, and its in the FillBuffer call after a ReadSingle and these are the only 3 in the file.

for (Int32 j = 0; j < PhysicalProxies[i].NumVertices; j++)
                {
                    PhysicalProxies[i].Vertices[j].x = b.ReadSingle();
                    PhysicalProxies[i].Vertices[j].y = b.ReadSingle();
                    PhysicalProxies[i].Vertices[j].z = b.ReadSingle();
                }

I'm not a C# Dev but reading through the docs it appears like its reading 4Bytes (aka Int32), and a "Unable to read beyond the end of the stream." error is thrown when you read past what is actually there, I'm not entirely sure if that is what it means in C#, but that is my guess.

It seems like another project seemed to have something similar go on. Not exactly the same issue, but might offer some help. Perfare/AssetStudio#177

If I go to import the mech in blender, the blender console throws the following error. Probably because the above process didn't work, but I figured I'd throw it in there for completeness.

found bundled python: C:\Program Files\Blender Foundation\Blender\2.79\python
Import Mech
D:\MWO Assets\Objects\mechs\atlas\atlas.cdf
I/O warning : failed to load external entity "file:///D:/MWO%20Assets/Objects/mechs/atlas/body/atlas.dae"
Couldn't open file
Schema validation error: Critical error: ERROR_COULD_NOT_OPEN_FILE Additional: D:\MWO Assets\Objects\mechs\atlas\body\atlas.dae
COLLADAFW::Root::loadDocument() returned false on 1st pass
Error: Errors found during parsing COLLADA document (see console for details)
Error importing armature at: D:\MWO Assets\Objects\mechs\atlas\body\atlas.dae
RuntimeError: class IMPORT_SCENE_OT_mech, function execute: incompatible return value , str(, Function.result expected a set, not a bool)

location: <unknown location>:-1

location: <unknown location>:-1

The file atlas.dae doesn't exist, most likely because of the converter failing. Let me know if you need more info/help I'll gladly help you out.

Render Error .skin Unsupported FileSignature #ivo

Unsupported FileSignature #ivo

at CgfConverter.CryEngineCore.Model.Read_FileHeader(BinaryReader b) in C:\Users\Geoff\Source\Repos\cgf-converter\CgfConverter\CryEngine_Core\Model.cs:line 198
at CgfConverter.CryEngineCore.Model.Load(String fileName) in C:\Users\Geoff\Source\Repos\cgf-converter\CgfConverter\CryEngine_Core\Model.cs:line 163
at CgfConverter.CryEngine..ctor(String fileName, String dataDir) in C:\Users\Geoff\Source\Repos\cgf-converter\CgfConverter\CryEngine\CryEngine.cs:line 108
at CgfConverterConsole.Program.Main(String[] args)

helping a friend make a ravager Gel Blaster from Star Citizen and it can't read the files

Enable Converter to write existing Vertex Color data + include Physics Proxy mesh

Some Cryengine assets depend heavily on painted Vertex Color data. e.g. vegetation assets that use detail bending based on RGB painted vertex color.
Atm exported meshes do not contain any vertex color set in them and it would be very helpful if they would.
https://docs.cryengine.com/download/attachments/24285894/final_blend.jpg?version=2&modificationDate=1473087581000&api=v2
Assets in question e.g. would be the GameSDK samples that come with Lumberyard. e.g. trees, palm trees coming from the old GameSDK, the original assets dating back to Crysis times even but then were converted for CE3.

Another addition that would be super helpful would be to include the physics proxy mesh.
Atm programs like NinjaRipper can include the physics proxy if a Cryengine user has switched to "show Proxies" before ripping, but getting those proxies found and sorted in the mess that is NinjaRipper .rip files is more than cumbersome!

These 2 additions would make Converter a complete tool to use!
Thank you so much for working on this tool in the first place!
Cheers!

Garbled Vertex Positions of .cgf Files

Vertex positions come out wrong when trying to use the converter on Crucible cgf files. Different vertex bufffer offset/format?
Other file types might be affected? Couldn't try them out.
Attached some sample input and output files.

Cgf2DaeOutput

CrucibleCgf.zip

Materials not found in locations other than current or parent folder

It appears cgf files can reference material files in specific locations, however it appears cgf-convert only looks in the current or parent folder for a mtl file. If no materials are found, the library_materials within the DAE is then empty, and the file will fail to load in Blender with the following scheme error:
Schema validation (Error): Error: ERROR_REQUIRED_ATTRIBUTE_MISSING Element: instance_material, Attribute: symbol, Line: 140, Column: 35, Additional:

I can send over a few examples if needed.

Additionally, it'd be really nice if the full path to that mtl was written in an tag for further processing later :)

Pervasive "Conflict in Chunk definition" errors render mechs unable to be imported.

Wasn't quite sure whether this was a problem with the converter or the importer, but when I try to import the results of running a conversion on a mech, all I get a bunch of empty hierarchies, presumably because the files necessary to build everything are missing or corrupted. I'm using the latest version of Blender and the Importer, so I don't think they're the issue here, and like the title says, when I run a batch conversion job, maybe half the files return that error.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.