Jump to content

LEGO Digital Designer LIF Extractor


JrMasterModelBuilder
 Share

Recommended Posts

JrMasterModelBuilder

On Windows 8 this is what happens to me :

 

C:Program FilesLEGO CompanyLEGO Digital Designer>lifextractor.exe assets.lif

PROCESSING: assets.lif

        EXTRACTING: Please wait.

Traceback (most recent call last):

  File "C:Python32_32bitlibsite-packagescx_FreezeinitscriptsConsole3.py",

line 27, in <module>

  File "LIFExtractor.py", line 142, in <module>

  File "LIFExtractor.py", line 115, in extract

  File "C:Python32libos.py", line 152, in makedirs

WindowsError: [Error 5] Accesso negato: 'assets'

Looks like a permissions error. Copy the LIF file you want to extract to somewhere in your user folder (i.e. your desktop), and extract it there. You could probably also run it as administrator.

Link to comment
Share on other sites

hey guys, still no way of packing our modyfied db folder back to db.lif? reason why I asking is that I use LDD2Povray for LDD rendering and being a drag to manually overwriting all decorations via LDD2Povray GUI, so it'd be really helpfull if one could pack back that modified db folder and that way there would be no need for manual decors overwriting as all of them would be right in db.lif

Link to comment
Share on other sites

  • 2 months later...
  • 3 months later...

Sorry for bumping this but i need help.

I am on LDD 4.3.8 and i am on Windows 8 which is 64-bit.

I did all the things with extracting db.lif into LIFExetractor.

I have done it all successfully but when i make a decoration in the Decorations folder.I edit the DecorationMapping and When i enter LDD the decal doesn't show up.

I have done everything and it doesn't work  :S

Link to comment
Share on other sites

  • 6 months later...
  • 10 months later...
InksterRogers

GUYS: I KEEP GETTING AN ERROR: The Application Tried To Run The Runtime In An Unusual Way..

 

Link to comment
Share on other sites

  • 1 year later...

Does this program work with python 3.6.2? When I try to open the db.lif with the lif extractor, the lif extractor opens for about half a second, then closes, and it does not create a new folder with extracted files.

Link to comment
Share on other sites

  • 2 weeks later...
BowtiedTrombone

Talk about attempting to resurrect a dead thread.

What program are you guys using to open up the .g files? I'm interested in finding out exactly how textures are assigned to each piece; I understand that it has to do with the .g1 and .g2 files. I'm wondering if there is a way to create these files for different pieces that don't have textures assigned to them; i.e. parts like 60803 or 30350.

Link to comment
Share on other sites

The file format is very simple. At the beginning of each file there is the GB10. After that there comes the number of points (int32) and the number of indices (int32). Then there are some kind of flags (int32) that define what is the content of the file.
 

struct GB10
{
  char    fourCC[4];
  dword   dwCntPoints;
  dword   dwCntIndices;
  dword   dwFlags;
  if (dwFlags & 0x08)
  {
    struct  Vector3D positions[dwCntPoints];
  };

  if (dwFlags & 0x02)
  {
    struct  Vector3D normals[dwCntPoints];
  };

  if (dwFlags & 0x01)
  {
    struct Vector2D uv[dwCntPoints];
  };

  dword   aIndices[dwCntIndices];

  if(dwFlags & 0x10) // here I am not sure
  {
    dword   dwUnknown1;
    float   aUnknownFloats1[dwUnknown1];
    dword   aUnknownIndices2[dwCntIndices];
  };

  if(dwFlags & 0x20) // here I am not sure
  {
    dword   dwUnknown2;
    struct Vector3D aUnknown3[dwUnknown2];
    dword   aUnknown2[dwCntIndices];
  };

  dword   dwCntGroups;
  dword   dwSizeGroups;
  struct Group Groups[dwCntGroups];

};

 

This is the same for all files: g, g1, g2 ...

 

As you can see it is not the file extention that decides if it is possible to add a texture. The flags define this. I can imagine, that if you change the flags in a file, you can make every part texture assignable. You will just have to add the UV-Set...

 

 

Link to comment
Share on other sites

  • 2 weeks later...
BowtiedTrombone
On 3/2/2018 at 4:14 PM, Sluicer said:

The file format is very simple. At the beginning of each file there is the GB10. After that there comes the number of points (int32) and the number of indices (int32). Then there are some kind of flags (int32) that define what is the content of the file.
 


struct GB10
{
  char    fourCC[4];
  dword   dwCntPoints;
  dword   dwCntIndices;
  dword   dwFlags;
  if (dwFlags & 0x08)
  {
    struct  Vector3D positions[dwCntPoints];
  };

  if (dwFlags & 0x02)
  {
    struct  Vector3D normals[dwCntPoints];
  };

  if (dwFlags & 0x01)
  {
    struct Vector2D uv[dwCntPoints];
  };

  dword   aIndices[dwCntIndices];

  if(dwFlags & 0x10) // here I am not sure
  {
    dword   dwUnknown1;
    float   aUnknownFloats1[dwUnknown1];
    dword   aUnknownIndices2[dwCntIndices];
  };

  if(dwFlags & 0x20) // here I am not sure
  {
    dword   dwUnknown2;
    struct Vector3D aUnknown3[dwUnknown2];
    dword   aUnknown2[dwCntIndices];
  };

  dword   dwCntGroups;
  dword   dwSizeGroups;
  struct Group Groups[dwCntGroups];

};

 

This is the same for all files: g, g1, g2 ...

 

As you can see it is not the file extention that decides if it is possible to add a texture. The flags define this. I can imagine, that if you change the flags in a file, you can make every part texture assignable. You will just have to add the UV-Set...

 

 

Interesting. For some reason, whenever I try to open the .g file with notepad, it just gives me a bunch of illegible symbols that I can't make any sense out of.

Link to comment
Share on other sites

On 3/2/2018 at 10:14 PM, Sluicer said:

The file format is very simple. At the beginning of each file there is the GB10. After that there comes the number of points (int32) and the number of indices (int32). Then there are some kind of flags (int32) that define what is the content of the file.
 


struct GB10
{
  char    fourCC[4];
  dword   dwCntPoints;
  dword   dwCntIndices;
  dword   dwFlags;
  if (dwFlags & 0x08)
  {
    struct  Vector3D positions[dwCntPoints];
  };

  if (dwFlags & 0x02)
  {
    struct  Vector3D normals[dwCntPoints];
  };

  if (dwFlags & 0x01)
  {
    struct Vector2D uv[dwCntPoints];
  };

  dword   aIndices[dwCntIndices];

  if(dwFlags & 0x10) // here I am not sure
  {
    dword   dwUnknown1;
    float   aUnknownFloats1[dwUnknown1];
    dword   aUnknownIndices2[dwCntIndices];
  };

  if(dwFlags & 0x20) // here I am not sure
  {
    dword   dwUnknown2;
    struct Vector3D aUnknown3[dwUnknown2];
    dword   aUnknown2[dwCntIndices];
  };

  dword   dwCntGroups;
  dword   dwSizeGroups;
  struct Group Groups[dwCntGroups];

};

 

This is the same for all files: g, g1, g2 ...

 

As you can see it is not the file extention that decides if it is possible to add a texture. The flags define this. I can imagine, that if you change the flags in a file, you can make every part texture assignable. You will just have to add the UV-Set...

 

 

Thanks for the info.

 

I have been trying to make sense of the file format myself. But not having any prior experience with reverse-engineering file format or 3D models, I haven been able to figure out as much as you. I managed to figure out counts, points and triangles, didn't think that a value could represent flags. That knowledge will help when I pick up my investigation again :)

Link to comment
Share on other sites

  • 2 years later...
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.