JrMasterModelBuilder

LEGO Digital Designer LIF Extractor

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.

Share this post


Link to post
Share on other sites
bublible

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

Share this post


Link to post
Share on other sites
LP20

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

Share this post


Link to post
Share on other sites
JimbobJeffers

It could be that you modified the wrong db.lif file? There are two copies install with LDD.

 

Try following >this tutorial and see if it helps. :thumbsup:

Share this post


Link to post
Share on other sites
LP20

It could be that you modified the wrong db.lif file? There are two copies install with LDD.

 

Try following >this tutorial and see if it helps. :thumbsup:

OMG Thanks you so much! :D

Share this post


Link to post
Share on other sites
azagwen4500unt

where the software extracting the files ?

Edited by azagwen4500unt

Share this post


Link to post
Share on other sites
InksterRogers

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

 

Share this post


Link to post
Share on other sites
EC3879

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sluicer

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...

 

 

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Teabox
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 :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now