Welcome Guest!

Did you know you that by registering, you can gain access to new special powers? You’ll be able to reply to Topics, create your own Topics, talk in our Chatbox, message members, manage your profile, access extra content and much more! Best of all, this message & ads will vanish!

JimbobJeffers

Tutorial: Adding Custom Decals into LDD

41 posts in this topic

Adding Custom Decals into LEGO Digital Designer

 

As great as LEGO Digital Designer is, it doesn't contain all the textures ever produced by the LEGO group. This tutorial will show you how to mod in custom textures to LDD so that you can use them in your models, and includes a little section at the end on setting these models up for rendering in POV-Ray.

 

In order to add custom decals into LDD, you will need the following:

 


 

Step 1: Preparing LDD

Before you can add in custom decals, you'll need to prepare LDD for modding. To do this, you will use the LIF Extractor you downloaded previously. Navigate to your Application Data directory, and locate LDD's folder. On Windows 7 this path should be:

C:\Users\YOURUSERNAME\AppData\Roaming\LEGO Company\LEGO Digital Designer

Inside you will find, among other files, a large file called db.lif. This file contains all the decorations that are loaded into LDD, in addition to various other files.

gallery_5738_300_3053.png

Now open the LIF Extractor in a new window. Navigate inside the folder relevant to your operating system - for my 32 bit computer, this is LIF_Extractor_Win_32bit. Drag the db.lif file onto the LIFExtractor.exe file inside, and it will begin the extraction process. This might take a while depending on your computer - on my Windows 7 netbook it took almost an hour, but on my old Windows XP laptop it took about a minute - so feel free to pop off to the nearest Support Station for a sandwich. Do not get impatient; just wait for the command window to disappear. Once it does, the extraction is complete.

gallery_5738_300_1955.png

Ta-da! You'll see a shiny new folder called db sitting next to the db.lif file. Now, to set LDD to run from this folder rather than the db.lif file, simply rename the db.lif file to something else (don't delete it - you'll want to keep it as a backup). In this example I'll rename it to originaldb.lif. Your folder should now look like this:

gallery_5738_300_55700.png

That's it, Step 1 is complete and you're all set!

 


 

Step 2: Adding Custom Decals

Now to the main part of this tutorial. Adding custom decals into LDD is actually very easy, and you probably won't need to refer to this tutorial any more after your first few tries.

 

Open the db folder you extracted in Step 1. There are several files and folders here, but the only two we're concerned with are Decorations and DecorationMapping. I have highlighted them in the image below.

gallery_5738_300_76001.png

The Decorations folder contains over 1,500 PNG images, all of which are used as decals on bricks and minifigure parts. The DecorationMapping.xml file is just one big list of all these files, and tells LDD which parts these decals should be available to.

To add your own decal into LDD, simply save it in PNG format (if it isn't already) and copy it into the Decorations folder. The important thing is that you must now name it with a unique 5-digit number (plus the extension, of course). You can give it any number, so long as no other file in that folder already has it, so in this example I will use 10001.

gallery_5738_300_16730.png

Here you can see I've created a masterpiece of a face decal and placed it in the Decorations folder. Now that the decoration is in the correct location, go back out into the db folder, and open DecorationMapping.xml in Notepad++ (or another decent text editor). You will see, after the first two lines, an indented list many lines in length. The format is:

        <Mapping decorationID="54580" designID="3626" surfaceID="1"/>

The decorationID number is the name you gave your decal in the Decorations folder, excluding the extension. If you remember, in this example it is 10001. The designID number refers to the part that the decoration can be placed onto - in this case, it is 3626, which is the minifigure head piece.

Tip: To find out the number of a particular piece, look for a decal that the relevant piece currently uses in the Decorations folder (for example, 55071). Then search this number in the DecorationMapping.xml file, and the associated designID is the part's ID (55071 has designID 3070, hence the 1x1 tile piece's ID is 3070).

 

My custom decoration is intended to be used on a minifigure's head, so I'll leave it as 3626. Copy any line you wish and paste it at the top of the list, after the first two lines (or manually type a new one). Then change the decorationID to your decal's name, and the designID to your part's ID. By placing your decoration at the top of the list, LDD will read it first, so it will appear at the top of the decorations list in the application.

gallery_5738_300_16644.png

Save the file, close it, and you're done!

 


 

Step 3: Checking Out Your New Decal

Launch LDD and enter LDD Extended mode. You can do this by selecting View > New themes > LDD Extended. Place the part you added a new decal to, select the Decoration tool (found by first selecting the Paint tool), and click on your model. If all goes well, the first decoration in the list should be your newly modded one!

gallery_5738_300_53006.png

But what happens if you want to distribute this file? Well, the decoration ID of each part is saved to the file. If you save your model with a custom decal on it, then load it into an unmodded (or modded without the current decal in it) version of LDD, it simply won't appear. The part is still registered as containing that decal though, as mentioned previously, and therefore if you open the file in a correctly modded version of LDD it will reappear again.

This means that you can distribute your .LXF files either with standard decals, for users with unmodded version of LDD, or containing the modded files so that other people can use them too. Or both, which is probably better.

One final note: le717 pointed out that updating LDD will cause any current mods to be lost, so you will need to backup your decals somewhere else and reinsert them into LDD each time there is an update, starting from Step 1 of this tutorial.

 


 

Rendering Models with Custom Decals

You've just finished building an AWESOME model using custom decals, and want to render it in POV-Ray*. But the POV-Ray converter requires that you use an unmodded version of LDD, so what do you do? It's very simple. After saving your model, change all the decals in it to any standard decals that LDD uses by default. Save a new copy of the file, and then rename your originaldb.lif file back to db.lif. When you load the LDD-to-POV-Ray converter, there is an option to render with custom decals. Just tick this, and replace all the decals with your own ones.

Remember, if you want two of the same part (a minifigure's head, for example) to use different decals in the same model, you will need to give them both different standard head decals. The LDD-to-POV-Ray converter changes each individual decal for all parts that use it in a model.

*Not sure how? Check out le717's tutorial here.

8 people like this

Share this post


Link to post
Share on other sites

Two things:

  • The position of the decal in DecorationMapping.xml matters. If you it near the bottom of the list, the texture will be listed near the bottom of list. Because of the varying amount of decals (mainly on heads), doing this can make the GUI selector cut off (even further) on smaller screens. Putting it near the top of the list (thus near the top of the selector) is always advised. :)
  • That is the second time you have linked to that tutorial. Sounds like I need to back on updating it for the newest version. ;P
1 person likes this

Share this post


Link to post
Share on other sites

Two things:

  • The position of the decal in DecorationMapping.xml matters. If you it near the bottom of the list, the texture will be listed near the bottom of list. Because of the varying amount of decals (mainly on heads), doing this can make the GUI selector cut off (even further) on smaller screens. Putting it near the top of the list (thus near the top of the selector) is always advised. :)
  • That is the second time you have linked to that tutorial. Sounds like I need to back on updating it for the newest version. ;P

Er.... your counting is off.

Also, LDD has a scrollbar in the decal window now, so nothing gets cut off.

2 people like this

Share this post


Link to post
Share on other sites

The position of the decal in DecorationMapping.xml matters. If you it near the bottom of the list, the texture will be listed near the bottom of list. Because of the varying amount of decals (mainly on heads), doing this can make the GUI selector cut off (even further) on smaller screens. Putting it near the top of the list (thus near the top of the selector) is always advised. :)

I did kind of say that here, but maybe it isn't clear enough:

By placing your decoration at the top of the list, LDD will read it first, so it will appear at the top of the decorations list in the application.

 

That is the second time you have linked to that tutorial. Sounds like I need to back on updating it for the newest version.

Yes you do! ;)

 

Also, LDD has a scrollbar in the decal window now, so nothing gets cut off.

I did not know that, thanks. 

Share this post


Link to post
Share on other sites

Thanks for this! Now when people ask me how to do this, I will direct them here!

 

This might take a while depending on your computer - on my Windows 7 netbook it took almost an hour, but on my old Windows XP laptop it took about a minute - so feel free to pop off to the nearest Support Station for a sandwich.

Ouch! I can't imagine why it would have taken that long.
1 person likes this

Share this post


Link to post
Share on other sites

Thanks for this! Now when people ask me how to do this, I will direct them here!

Thank you!

 

This might take a while depending on your computer - on my Windows 7 netbook it took almost an hour, but on my old Windows XP laptop it took about a minute - so feel free to pop off to the nearest Support Station for a sandwich.

Ouch! I can't imagine why it would have taken that long.

I'm not sure either, it can run programs such as Adobe Flash CS6, LDD, Minecraft (just about)... Maybe it's just the sheer number of files it had to search through froze it up. That, and I had several RRU tabs open along with Word and Paint.net...

Share this post


Link to post
Share on other sites

One thing that should probably be mentioned, is that it is best the not have the custom image touching the edge, if that makes sense. The pixels on the edge of an image may be stretched or cut off depending on the part.

Share this post


Link to post
Share on other sites

Ah yes, thank you. In addition to that I'll add that LDD stretches decals, if it isn't obvious already looking at the textures.

Share this post


Link to post
Share on other sites

Ah yes, thank you. In addition to that I'll add that LDD stretches decals, if it isn't obvious already looking at the textures.

I meant more that the pixels on the edge of a decal can be distorted, or whatever. Best way to explain is with an example, if you look at this picture from one of my models, and look at the vest on the minifig (which is a custon decal) you can see the line on the bottom is thicker than the others, despite being the same size in the image itself, simply because it touches the edge and got stretched. Similarly, the black 'v' shape on the yellow plate (also a custom decal) is ever so slightly cut off on the edges (though it's hard to tell by how much as it's a little cut off in the original...)

So what I'm saying is, when making the decal it would help to leave a one-pixel border around it that's totally empty, for good measure.

1 person likes this

Share this post


Link to post
Share on other sites

This sounds like a stupid question, but what is an extension?

 

I did everything except that, thinking it's nothing. But I think it is important since my face didn't show up in LDDE. So...

Share this post


Link to post
Share on other sites

This sounds like a stupid question, but what is an extension?

 

I did everything except that, thinking it's nothing. But I think it is important since my face didn't show up in LDDE. So...

I'm so sorry that I never saw this question. The extension is just the file type, e.g. .PNG, .JPG, and so on. In this case it'll always be .PNG.

Share this post


Link to post
Share on other sites

I have been trying to decorate LEGO part number 30366, as that part has various existing prints, but I can't seem to put anything on it when I am in Lego Digital Designer. When I try to click on that part with the decoration tool nothing happens, it doesn't pick anything up. 

I followed your directions and it worked for al LEGO parts in Lego Digital Designer so far, with the first excpetion of said part. I also tried changing the "surfaceID" to different variables, without results. Am I doing something wrong when it concerns element number 30366? Or is it simply not meant for decoration? Similar semi-spherical elements, e.g. part 50747, have no trouble being decorated though.

Share this post


Link to post
Share on other sites

If the part does not have any decorations by default, you can't add them, unfortunately. Even if the pieces come with printing IRL. 

Share this post


Link to post
Share on other sites

Yup, as Sushigidoge said. In order to add decorations to a part without them I believe you'll need to modify the 3D files of the part in question, which I have no knowledge in, sorry.

Share this post


Link to post
Share on other sites

That's unfortunate, however there exist parts in Lego Digital Designer which do not have a decoration by default - e.g. part  50747 like I previously referred to - but can be decorated by the method you described. I presume one is just out of luck when it comes down to specific non-decoratable parts.

Share this post


Link to post
Share on other sites

PLEASE HELP!! I've been at this for a few hours now and it doesn't work. I followed the direction to the point and when insert the custom decals into the file and save and open LDD i cant access the decoration tool in the paint thingy. So now LDD decorations dont work. I checked if the file had a mistake in the coding in notepad++ but it checks out so im stumped. Can someone help me out?

Share this post


Link to post
Share on other sites

That's unfortunate, however there exist parts in Lego Digital Designer which do not have a decoration by default - e.g. part  50747 like I previously referred to - but can be decorated by the method you described. I presume one is just out of luck when it comes down to specific non-decoratable parts.

​Really? I never knew of this, I guess I haven't really messed around with it much. Would you be able to list those parts? Maybe they had decorations before which were removed in an update if outdated, or alternatively they could be preparing them for future, I don't know.

 

PLEASE HELP!! I've been at this for a few hours now and it doesn't work. I followed the direction to the point and when insert the custom decals into the file and save and open LDD i cant access the decoration tool in the paint thingy. So now LDD decorations dont work. I checked if the file had a mistake in the coding in notepad++ but it checks out so im stumped. Can someone help me out?

​Are you able to provide a screenshot of the program? I've never heard of the decoration tool disappearing. I don't know if I'll be able to help but it's a start.

Share this post


Link to post
Share on other sites

Hi guys, I really need some help(hoping that someone will see this).The lif extractor doesn't work properly because in the roaming folder the Lego Company folder is enteierly missing and when i extract the things from the assets.lif file it extracts only the folders(which are empty) and the db file which I can't extract no matter how many times I try (it just start and stops without extracting the db folder).  I have the LDD from the Lego site with the last updates, but the Lego Company folder, along with the other files, won't show in the roaming folder.Please help me and sorry for my english which isn't very good.

Share this post


Link to post
Share on other sites

PLEASE HELP!! I've been at this for a few hours now and it doesn't work. I followed the direction to the point and when insert the custom decals into the file and save and open LDD i cant access the decoration tool in the paint thingy. So now LDD decorations dont work. I checked if the file had a mistake in the coding in notepad++ but it checks out so im stumped. Can someone help me out?

I've encountered this before as i constantly add decals into LDD. The cause is that you mistyped the following:

The ID number

The "<Mapping decorationID="#" designID="#" surfaceID="1"/>" code itself

However i have no clue how to fix the inability to check again thing though.

Hi guys, I really need some help(hoping that someone will see this).The lif extractor doesn't work properly because in the roaming folder the Lego Company folder is enteierly missing and when i extract the things from the assets.lif file it extracts only the folders(which are empty) and the db file which I can't extract no matter how many times I try (it just start and stops without extracting the db folder).  I have the LDD from the Lego site with the last updates, but the Lego Company folder, along with the other files, won't show in the roaming folder.Please help me and sorry for my english which isn't very good.

I have no idea how to fix this: I've never encountered it before. Maybe you're using some other version of LDD and the file is named differently?

Share this post


Link to post
Share on other sites

I'm having a problem of my own with this process now. I'd made it work in the past, before an update wiped out those changes, so I've been trying it again recently.

I unzipped the LIF file and checked to be sure all it's internal files and folders were in order in the new db folder, as the instructions said to do. I also made sure to remove the original db.lif file from the Lego folder and put it elsewhere as a backup. With the db folder in place in the correct folder, I opened Lego Digital Designer to test and be sure it was working.

First, LDD crashed. When I opened it a second time, it ignored the db folder and began downloading every single update again, creating a brand new db.lif file right there in the Lego folder. This process took forever, and the newly created db.lif file naturally didn't have any custom decals in it. I have tried this several times now, and keep having this same problem - rather than reading out of the db folder, LDD is creating a brand new db.lif file. I also tried re-compressing the db folder with decal edits into a new db.lif file on it's own, and LDD proceeded to overwrite that file in this same manner upon opening the program (after an initial crash).

For reference, I am on a Macbook Pro, I have made Game Extractor work for me via jiggery pokery. Extracting the files isn't the issue, it's getting the program to actually read them from the db folder instead of creating a new db.lif file. Again, I've done this in the past and it worked, but an update reset it a while back, and I've neglected to do it all again until now. I'm beginning to wonder if Lego hasn't somehow patched the game to immediately create a new db.lif file if it senses anything has been changed or tampered with from a default of what should be in the .lif originally.

Share this post


Link to post
Share on other sites

NYK3750: I haven't ventured into LDD modding for a while. Perhaps the latest update changed the location of the db.lif file? I really have no idea but I can't believe it would have. Did you run LDD once after installing it, before trying to extract the file?

Nanoline: Again, I'm not really sure what the problem could be, but on a guess perhaps the latest version has prevented the db.lif file from being extracted? As in, if it doesn't detect the file even if you have a folder, it just creates a new one?

Maybe a recompiler is needed in addition to the decompiler for future modding.

Share this post


Link to post
Share on other sites

Yes, I runned it once and updated it and opened it once again but the extractor still doesn't work. Like Nanoline it worked for me once but after I entered in LDD it was updating again, and after this it didn't worked anymore. Besides this, the new update it's very strange, because after I install LDD (version 4.3.6) I open LDD and update it and after that a new installation opens(for version 4.3.8), thing that didn't happened me in the past updates.I tried to install in a diferent location the update and worked like an other LDD, just updated to the actual version, still no Lego Company in the roaming folder, and if I uninstall one version (no matter which one) the other works fine but my computer show it like it isn't installed(I use geek uninstaller to clean the things that remains hidden in computer). I don't know if I mess up with something when I installed the update or uninstalled with geek. Nanoline, I think that the Lego Company wants to protect their product and I think thats why it make LDD harder to mod each time it updates.Thank you for trying to help me, I apreciate that even if the problem didn't solved :).Hope I didn't took to much from your time.

Share this post


Link to post
Share on other sites

Nanoline, I think that the Lego Company wants to protect their product and I think thats why it make LDD harder to mod each time it updates.

No. They don't care about our mad tinkery with this game, and IIRC we can make custom decals per the Play Fair Policy.

Nanoline, i think that you're issue is the extractor. I know you said it works fine and you don't need the LIF Extractor but if you use it, you don't need to re-use the extractor. Plus i think your problem IS linked to the extractor you're using. And i think another source of the problem is that you made another DB file, when thats not really necessary. (You can just simply add in the decals and they won't harm anything. Just like any other normal decal.)

Edited by MaelstromIslander

Share this post


Link to post
Share on other sites

Nanoline, i think that you're issue is the extractor. I know you said it works fine and you don't need the LIF Extractor but if you use it, you don't need to re-use the extractor. Plus i think your problem IS linked to the extractor you're using. And i think another source of the problem is that you made another DB file, when thats not really necessary. (You can just simply add in the decals and they won't harm anything. Just like any other normal decal.)

The issue is that on a Mac, I cannot make use of the LIF Extractor, as it only runs on Windows. Unless there's some jiggery pokery way to make that work too (one that doesn't involve buying Windows and loading it onto the Mac with Bootcamp).

If there is a way to run the provided LIF Extractor on Mac, I'd love to learn it out.

Share this post


Link to post
Share on other sites

Hello!

I've been using this for a while, but I started drifting away from LDD. Now I'm using it again, and I wanna use this. But it looks like I can't. I've sort of forgotten how to do this, and that video tutorial must have been taken down or something. I can't seem to drag the db.lif into the LIFExtractor. Gives me a 'File not found or no read permission' error. 

I'd really like to use this again, and if anyone can help, please help ! !

 

EDIT: I found a way to copy db.lif into the LIFExtractor, but then it tells me some python thing is missing and that I should reinstall it.

??

Edited by CM4Sci

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