To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.lddOpen lugnet.cad.ldd in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / LDD / 8
7  |  9
Subject: 
LDD to LDRAW Conversion Fixes
Newsgroups: 
lugnet.cad.ldd, lugnet.lego, lugnet.trains, lugnet.town, lugnet.build
Followup-To: 
lugnet.cad.ldd
Date: 
Wed, 28 Jun 2006 12:09:18 GMT
Highlighted: 
!! (details)
Viewed: 
34861 times
  
I've been tinkering with the "ldraw.xml" file in LEGO Digital Designer (LDD),
and have come up with the following list of fixes for good LDD/LDRAW conversion.

In case you hadn't already discovered, if you append ".ldr" to the end of the
file name when saving from LDD, it will save it in LDRAW format.  You can then
load and edit it in MLCAD.  If you save a ".ldr" file in your "My Documents\LEGO
Creations\Models" directory, you can open it in LDD.  If you tinker with the
parts order and building steps in MLCAD, these are preserved in the LDD native
file format.  It's much easier to tweak the instructions with MLCAD than it is
with LDD.

Note: you only get a thumbnail index picture for ".ldr" files if they were
originally saved from LDD.  If you load a ".ldr" file in LDD, it will be loaded
with its own parts palette.  To upload the model to LEGO Factory, you have to
open the palette window, select the Factory palette, then de-select the model
palette.  It will translate the bricks into the Factory palette as best it can;
it's up to you to spot if anything  disappears or changes colour.

The big problem is that some parts and colours don't transfer properly at all.
1x1 round tiles are exported as the wrong part, and 1x1 slopes disappear
completely.  1x4 tiles export OK, but when imported back into LDD turn into the
printed train control tile, which can't simply be recoloured as it's an entirely
separate part from the plain version.

Finally, new light and dark grey don't come up as the right colours.

So, to fix all this, go to where you've installed LDD, then go into the
"database" directory.  In there you'll find a file named "ldraw.xml".  This
controls the part conversions from LDD to LDRAW files and back again.  Bring it
up in a text editor.


1x4 Tiles
~~~~~~~~~

The first fix comes courtesy of Christopher Masi (see:
http://news.lugnet.com/trains/?n=27469&t=i&v=a).
First find the line that refers to "2431" and replace with the following:

  <!-- 1x4 TILE, fixed by Christopher Masi 24.May.06 -->
  <geometry tabulaname="2431">2431</geometry>

This will import and export 1x4 tiles correctly.


1x1 Tiles
~~~~~~~~~

Add the correct mapping at the end of the "geometry" section:

  <!-- 1x1 TILE, fixed by Jason Railton 28.Jun.06-->
  <geometry tabulaname="30039">3070b</geometry>

This will export 1x1 grooved tiles correctly.


1x1 Round Plates
~~~~~~~~~~~~~~~~

First comment out the remapping entry near the bottom:

  <!-- 1x1 ROUND PLATE - REMOVED AND PLACED ABOVE, Jason Railton 28.Jun.06 -->
  <!-- remapldraw tabulaname="6141">4073</remapldraw -->

Next add the correct mapping in at the end of the "geometry" section:

  <!-- 1x1 ROUND PLATE, fixed by Jason Railton 28.Jun.06 -->
  <geometry tabulaname="6141">4073</geometry>


1x1 Slope
~~~~~~~~~

First, go and download part 50746 from the LDRAW parts tracker, put it in your
PARTS directory and run MKLIST again:
http://www.ldraw.org/cgi-bin/ptdetail.cgi?f=parts/50746.dat

Next, add the following to the end of the "origin" section:

  <!-- 1x1 SLOPE, added by Jason Railton 28.Jun.06 -->
  <origin x="0.000" y="0.000" z="0.000" axisx="0" axisy="1" axisz="0"
angle="3.141593">50746</origin>

Then, add the following to the end of the "geometry" section:

  <!-- 1x1 SLOPE, added by Jason Railton 28.Jun.06 -->
  <geometry tabulaname="50746">50746</geometry>

This will import and export 1x1 slopes correctly, and add them so you can use
them in MLCAD.  Note that this may need adjusting once the 1x1 slope becomes an
official part.


Old and New Greys
~~~~~~~~~~~~~~~~~

This is a preference thing, but I like LDD's new light and dark grey to map onto
LDRAW's old light and dark grey, for convenience.  If you want the same, here's
how to do it:

First, comment out the old grey translations:

  <!-- OLD LIGHT GREY, removed by Jason Railton 28.Jun.06 -->
  <!-- colour tabulaname="2">7</colour -->
  <!-- OLD DARK GREY, removed by Jason Railton 28.Jun.06 -->
  <!-- colour tabulaname="27">8</colour -->

Next, comment out the new grey translations:

  <!-- NEW LIGHT GREY, removed by Jason Railton 28.Jun.06 -->
  <!-- colour tabulaname="194">71</colour -->
  <!-- NEW DARK GREY, removed by Jason Railton 28.Jun.06 -->
  <!-- colour tabulaname="199">72</colour -->

Then, paste in these new-old translations at the end of the "colour" section
(note that it's the English spelling of 'colour'):

  <!-- NEW TO OLD LIGHT GREY, remapped by Jason Railton 28.Jun.06 -->
  <colour tabulaname="194">7</colour>
  <!-- NEW TO OLD DARK GREY, remapped by Jason Railton 28.Jun.06 -->
  <colour tabulaname="199">8</colour>

This may interfere with any LDD parts that are in the old colours, but so far
that only applies to train track.


The way the XML file works is as follows:

"<colour>" tags - these map a specified LDD colour onto an LDRAW colour, with
varying degress of accuracy.

"<origin>" tags - these describe the translation and rotation of LDD parts to
align the LDRAW equivalent in the same position.  The most common fix is a 180°
rotation (Pi radians) about the Y-axis.  Note that if a part doesn't appear in
this list, it won't be exported or imported at all.

"<geometry>" tags - these map a specified LDD part shape onto its LDRAW
equivalent.  A part must have an "<origin>" tag, but it doesn't need a
"<geometry>" tag if LDD and LDRAW use the same part number.

"<remaptabula>" tags - these are extra LDD import tags, for mapping several
LDRAW parts onto the same LDD part.  For example, you could map ungrooved tiles
onto grooved tiles.  Unfortunately, you don't seem to be able to do the same
trick with colours.

"<ignoreUnknown />" tag - this is what makes the translator ignore any parts
that don't have an "<origin>" tag.


Please comment and share any fixes you find, so we can build up a running, fully
referenced list.  You'll find 'plain text' is best for replying as 'FTX' posts
don't take too kindly to XML.


Jason Railton



Message has 5 Replies:
  Re: LDD to LDRAW Conversion Fixes
 
(...) Hey Jason, If this really works, and I believe you if you say so, would you mind posting your ldraw.xml file? It would save people time to retype (and perhaps mistype) your adjustments. Thanks. Jaco (18 years ago, 28-Jun-06, to lugnet.cad.ldd)
  Re: LDD to LDRAW Conversion Fixes
 
Wicked awesome, Jason! I'm planning to convert a ton of ldd models over to dat for BrickSpace and this'll help immensely! -Stefan- (18 years ago, 28-Jun-06, to lugnet.cad.ldd)
  Re: LDD to LDRAW Conversion Fixes
 
(...) <snip> (...) Good idea to publicize these changes. I have fixes for some other parts as well but I'm out of town at the moment and won't be back for the next week and a half. Once I get back I'll contribute any of my changes that haven't (...) (18 years ago, 28-Jun-06, to lugnet.cad.ldd)
  Re: LDD to LDRAW Conversion Fixes
 
Apologies to anyone who didn't follow this post. It always bugs me when people post technical stuff with no explanation, and just expect everyone to 'get it'. In this case, a lot of people aren't going to be familiar with XML files, so here's a (...) (18 years ago, 29-Jun-06, to lugnet.cad.ldd)
  Re: LDD to LDRAW Conversion Fixes (another fix)
 
Here again is an optional fix. This will convert new brown in LDD models to old brown in LDRAW, which is more convenient to edit in MLCAD: First, comment out the old brown definition: <!-- OLD BROWN, removed by Jason Railton 30.Jun.06 --> <!-- (...) (18 years ago, 30-Jun-06, to lugnet.cad.ldd)

10 Messages in This Thread:





Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR