Git Product home page Git Product logo

i3dshapestool's Introduction

I3DShapesTool

Tool used for extracting the binary .i3d.shapes files used by the GIANTS engine

Usage

  1. Download the pre-built binaries under releases (click on I3DShapesTool.exe) https://github.com/Donkie/I3DShapesTool/releases
  2. Extract the zip to some folder on for example your desktop
  3. Open windows command line in this folder
  • Run I3DShapesTool -h to see a list of all available options
  • Example extraction: I3DShapesTool someShapesFile.i3d.shapes where someShapesFile.i3d.shapes is located in the same folder as the I3DShapesTool application.
  • You can also simply drag-drop a .i3d.shapes file onto the extracted .exe in order to directly export it to .obj.

i3dshapestool's People

Contributors

donkie avatar thraidh avatar virrus77 avatar

Stargazers

 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

i3dshapestool's Issues

Ubuntu 22.04 / .NET6 support

Currently the application does not work on Ubuntu 22.04, because it only supports .NET 6.
I tried replacing all instances of netcoreapp3.1 in .csproj files with net6.0 and that works for me, but I don't know what would break, so I would not dare making a PR for that.
From how I understand the Microsoft documentation it should be possible to provide multiple target frameworks.

Rename unknown parts

I have some information about the "unknown" flags other parts. If you are interested I'll write it down.

Add glTF exporting

glTF is a well-documented standardized text-based 3d asset format (see https://www.khronos.org/gltf/, scroll down to "Resources").
It is probably easier to implement than FBX, which is officially not even a public format. There do not seem to be importers for Maya or 3ds max, though, only for Blender.

Parse .i3d file

By parsing the transformation structure we can export to for example .obj with the correct position and rotational transforms, like what the editor does.

4xUV maps & VertexColor

Hi,
I have functional loading of all four UV maps from the I3D file
but I don't have the VertexColors loaded correctly (there is some shift).
Please send me your contact and I will give you my code (including blender addon)
I don't know how to work with github and I don't want to learn :-)

image

[email protected]
By.

Error Unsupported Version 144

Everytime i get the same error. I can not extract the shapes file. I use the ShapeTool Version 1.5.0

[FATAL] Unsupported version: 144
Unhandled exception. System.NotSupportedException: Unsupported version
at I3DShapesTool.Lib.Container.ShapesFileReader..ctor(Stream inputStream, ILogger logger, Nullable1 forceSeed) at I3DShapesTool.Lib.Model.ShapesFile.Load(Stream inputStream, Nullable1 forceSeed, Boolean strict)
at I3DShapesTool.Program.LoadFileBruteForce(String filePath)
at I3DShapesTool.Program.LoadFile(String filePath)
at I3DShapesTool.Program.ProcessFileInput(CommandLineOptions options)
at I3DShapesTool.Program.Run(CommandLineOptions options)
at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult1 result, Action1 action)
at I3DShapesTool.Program.Main(String[] args)

[FATAL] Unsupported version: 15

PS C:\Users\Scarlett\Downloads\quickbms\test\vehicles\koller\k307> .\I3DShapesTool k307.i3d.shapes
[INFO] File is I3D, parsing data from XML.
[INFO] Loading file: k307.i3d.shapes
[INFO] Failed decrypting file. Attempting to brute-force the seed...
[FATAL] Unsupported version: 15
Unhandled exception. System.NotSupportedException: Unsupported version
at I3DShapesTool.Lib.Container.ShapesFileReader..ctor(Stream inputStream, ILogger logger, Nullable1 forceSeed) at I3DShapesTool.Lib.Model.ShapesFile.Load(Stream inputStream, Nullable1 forceSeed, Boolean strict)
at I3DShapesTool.Program.LoadFileBruteForce(String filePath)
at I3DShapesTool.Program.LoadFile(String filePath)
at I3DShapesTool.Program.ProcessFileInput(CommandLineOptions options)
at I3DShapesTool.Program.Run(CommandLineOptions options)
at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult1 result, Action1 action)
at I3DShapesTool.Program.Main(String[] args)
PS C:\Users\Scarlett\Downloads\quickbms\test\vehicles\koller\k307>

Platinum DLC, using Koller k307

Skinning information

Hi. After decode shapes file I can get model geometry information from obj and restore this into i3d file with "IndexedTriangleSet" element. But this element can include "Vertices" elements with attribute for skinning – "bw" and "bi". Is there any way to get this information from shapes file?
Скриншот 25-06-2021 134242

Position UV

Hi after export the UV grid is in the wrong place. It should be in the place of the green square like in the picture.

UV_preview

Multiple UV maps

Hi,
is it possible to export multiple uv maps at once or choose which one I want (vehicle shader or building shader uses two uv maps).

Thanks.

File version 5?

Tried to dump a shapes file. File version 5, Unsupported version. Any plans of supporting this version?

Add automatic splitting of merged objects

Many models are using merged meshes, that actually comprise multiple meshes which represent the base and moving parts.
Those are represented as skinned meshes where the individual parts have different blend indices.
Modders would usually export that merged mesh as an OBJ and painstakingly split the merged object into its parts by hoping to select the correct vertices and extract them into their own object.
This tool should be able to handle that extraction process automatically. If a shape with SingleBlendWeights is detected, it can be converted into multiple OBJ groups/objects, so that all the triangles with vertices with blend index N form OBJ group $name-$N.
This should probably be an option to turn on or off.

Output Decrypted Shapes File

@Donkie Please forgive my ignorance, but is it possible for this tool to simply output a decrypted shapes file rather than a obj or bin file? What is the bin file useful for? Can it be converted to a decrypted shapes file? Thanks in advance for your help!

Export to FBX

Is there any FBX support planned? My main goal is not to lose information about bones animation and vertex color and keep the structure of scenography.

FS20

I've currently got modding on FS20, but want to decrypt the shapes. I can provide a file for you if you'd like.

Question

I have question about this I3DShapesTool does it unlock encrypted i3d.shapes files from DLC such as Platinum Expansion for FS19?

Get rid of brute forcing file seed

Currently the file seed is attempted to be brute forced if the decrypt fails. I can't imagine this is how it's actually done in the engine. Figure out how to do this properly.

Bruteforcing added here: c68a32f

crashes

oddly enough the exe seems to crash sometimes

Change struct Shape.

Shape (Type 1) has the following structure (010 Editor Template):

struct I3DTri{
  ushort P1;
  ushort P2;
  ushort P3;
};

struct I3DVector{
  float P1;
  float P2;
  float P3;
};

struct I3DUV{
  float V;
  float U;
};

struct UnkFloat3{
  float unk1;
  float unk2;
  float unk3;
};

void Align(int mod){
  local int pos = FTell();
  local int newPos = ((pos+3)/4)*4;
  if(newPos - pos != 0) {
    byte Skip[newPos - pos] <bgcolor=0x808080,fgcolor=0x0000F0>;
  }
  //FSeek(newPos);
  Printf("Seed: %d -> %d\n", pos, newPos);
}

uint nameLen;
char Name[nameLen] <fgcolor=0xF0F000>;
Align(4);

uint ShapeId <bgcolor=0x20F080,fgcolor=0x800000>;

float BoundingVolumeX  <bgcolor=0x20F0F0>;
float BoundingVolumeY  <bgcolor=0xF08080>;
float BoundingVolumeZ  <bgcolor=0x20F080>;
float BoundingVolumeR  <bgcolor=0x20F0F0>;
int VertexCount <bgcolor=0xF08080>;
int Unknown6 <bgcolor=0x20F080>;
int Vertices <bgcolor=0x20F0F0>;
int Unknown7 <bgcolor=0xF08080>;
int Unknown8 <bgcolor=0x20F080>;
int UvCount <bgcolor=0x20F0F0>;
int Unknown9 <bgcolor=0xF08080>;
int VertexCount2 <bgcolor=0x20F080>;

I3DTri Triangles[VertexCount / 3] <bgcolor=0x20F0F0>;
Align(4);
I3DVector Positions[Vertices] <bgcolor=0xF08080>;
I3DVector Normals[Vertices] <bgcolor=0x20F080>;

if(Unknown7 & 0x80) {
  float Unk2[UvCount*4]<bgcolor=0xE000F0>;
}

I3DUV UVs[UvCount] <bgcolor=0x20F0F0>;

DWORD EndDword <bgcolor=0xE000F0>;

Shape (Type 2) has the following structure (010 Editor Template):

void Align(int mod){
  local int pos = FTell();
  local int newPos = ((pos+3)/4)*4;
  FSeek(newPos);
  Printf("Seed: %d -> %d\n", pos, newPos);
}

uint nameLen;
char Name[nameLen];
Align(4);

struct Point{
  float x;
  float y;
  float z;
};

uint ShapeId;
byte unknowFlags[4];
uint PointCount;
Point Points[PointCount];

P.S. Is help needed or is the project abandoned? I need only a decryption key from the project. Just my pull request is ignored ...

LS19

Hi,

can you please update this tools for farming simulator 19?

Thx

I3dShapesTool Not Working

I unpacked the ZIP and started cmd in the folder and I executed I3dShapesTool -h with enter and the file is closed. Ask for help

Contact

Hey mate,
I don't know if you are still continuing this project, but I may have something for you, that could help...
Is there a way to contact you personal?

Position/Rotation XYZ

Hello great tool, now also works with FS22 :) but, it would be useful to change something namely, when I export a model directly from Giants Editor to obj format, then after importing e.g. to Blender the model is in the same position as in Giants Editor (only center of rotation and rotation is reset which is obvious), but when I export a model with your tool the model changes position to 0,0,0 instead of only resetting center of rotation and rotation. Is it possible to change this?

export_GE
export_I3DST

Failed to load part

When exporting larger shapes files that have more elements, a message like the one in the picture appears and all parts of the shapes file are not exported to either obj or bin.

export_bug

One way process?

Is extracting the binary data a one way process, or could one use the same bits and pieces from the codebase to make it go the other way to (i3d -> binary shapes file)?

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.