Jump to content

Photo

LDR Importer


  • Please log in to reply
29 replies to this topic

#1
le717

LDR Importer

 
LDR Importer is an Blender 2.6 importer script for models created in the LDraw Model (.ldr, .dat) format. There are currently three developers working on this, with myself as the lead developer.
 

 

History

 

Spoiler

 

Downloads

 

Features

 

This list is by no means complete. There may be features I have forgotten to add.

  • General
  • Supports all versions of Blender 2.67 onward
  • Automatically preserves installation path to LDraw Brick Library through use of a configuration file
  • Attempts to detect installation path to LDraw Brick Library (Windows only, can be expanded to other platforms if data can be supplied)
  • Non-programmer understandable error messages are thrown for the majority of errors
  • Import on any scale (default: 0.05)
     
  • Library & Models
  • Fully supports library folder structure, including unofficial, p/48, and p/8 folders
  • Supports models in .dat and .ldr format; Multi-part DAT (.mpd) and Bricksmith models do not work properly.
  • Ability to choose between high-resolution, low-resolution, and normal-resolution primitives
  • Model optimization option available by default to clean up the mesh, in addition to using the original mesh
     
  • Colors
  • Uses LDConfig.ldr for color list rather than internal list, providing up-to-date and accurate colors
  • Supports most of the LDraw colors for Blender Internal, including transparent, chrome, pearlescent, rubber, and metal
  • Experimental support for Cycles Engine materials
  • Automatically detects render engine and uses the appropriate materials

Edited by le717, 19 January 2014 - 08:12 AM.


#2
JrMasterModelBuilder

JrMasterModelBuilder

    LR, LR2, LDR, and LDD Extractor Creator

  • Crystal Members
  • PipPipPipPip
  • 537 posts
Yay! Minifig head exports to ldr files now!

P.S. I can make OS X instrucitons if you want.

#3
le717

Yay! Minifig head exports to ldr files now!

P.S. I can make OS X instrucitons if you want.


Yes, the minifg head now exports.

Please do! I run Windows only, so I could not write OS X instructions myself. Just paste them here or PM me with it, and I'll add it to the Readme upon the next release of the scripts. ;)

EDIT: Perhaps now that's I've released it, someone might be able to figure out how to import alpha colors into Blender... ;P

Edited by le717, 21 October 2012 - 09:36 AM.


#4
JrMasterModelBuilder

JrMasterModelBuilder

    LR, LR2, LDR, and LDD Extractor Creator

  • Crystal Members
  • PipPipPipPip
  • 537 posts
Editing the path to LDraw works the same.


The easiest way to install scripts in Blender on OS X would be to place them here:

~/Library/Application Support/Blender/<BLENDER_VERSION_NUMBER>/scripts/addons/

The "/scripts/addons/" folders probably won't exist by default. Also, as a quick explaination of the "~", it means the home folder on Unix systems, so /Users/<USERNAME> is what it translates to. Also, ~/Library is a hidden folder as of OS X 10.7 so the easiest way to get to that folder would be to open finder and click Go > Go to Folder... and enter "~/Library/Application Support/Blender/"

The scripts will then appear in the addons menu.



To change the ldraw.xml file, go to the place "LEGO Digital Designer.app" was installed (probably /Applications/LEGO Digital Designer.app), right click "LEGO Digital Designer.app" (or control+click if you're don't have right click enabled :?: O_O ) and select "Show Package Contents". Then open "Contents/Resources/" and replace the "ldraw.xml" file.

#5
le717

Thanks JMMB! I've got it, and am currently adding it into the Readmes.

or control+click if you're don't have right click enabled


What? You have to enable right-click on OS X? Man, the more I hear about OS X, the less and less I'm happy Dad has aways bought Windows, and think that Windows 8 will actually be a nice OS...

O.T.
Nobody start a OS war here. I am just stating my view, and I do not wish to debate with you about which OS is better. ;)


#6
JrMasterModelBuilder

JrMasterModelBuilder

    LR, LR2, LDR, and LDD Extractor Creator

  • Crystal Members
  • PipPipPipPip
  • 537 posts

Thanks JMMB! I've got it, and am currently adding it into the Readmes.

or control+click if you're don't have right click enabled


What? You have to enable right-click on OS X?

Apple mice, yes. It varies with trackpads and third party mice. What confuses me is that some people like it that way. That and the "natural" (read "backwards") scroll wheel direction.

Complaints about default configuration aside, Apple's trackpads are really amazing devices. Their under-leveraged with the system software, but with the Better Touch Tool addon it's insane what gestures you can add to it.


Man, the more I hear about OS X, the less and less I'm happy Dad has aways bought Windows, and think that Windows 8 will actually be a nice OS...

O.T.
Nobody start a OS war here. I am just stating my view, and I do not wish to debate with you about which OS is better. ;)

I think you mean more and more happy?

#7
le717

I think you mean more and more happy?


Yea, that's what I meant. I typed that incorrectly. :P

Editing the path to LDraw works the same.


Yea, but what do OS X users use to edit plain text files? This is no Notepad++ port for Mac (and their won't be without a complete rewrite), so IDK what to tell them to open it with. I'm thinking more about built-in software than stuff you have to download (although I could mention one, just like I do for Windows...)

#8
le717

V0.7 of the Blender LDraw Import script is released! V0.6 was a bug fix release, but V0.7 is a feature release! I've added the ability to import bricks from every single folder, including Unofficial bricks! JMMB and ProfessorBrickkeeper also helped me write OS X installation instructions. Get V0.7 from on the Topic Post!

#9
JrMasterModelBuilder

JrMasterModelBuilder

    LR, LR2, LDR, and LDD Extractor Creator

  • Crystal Members
  • PipPipPipPip
  • 537 posts

I think you mean more and more happy?


Yea, that's what I meant. I typed that incorrectly. :P

Editing the path to LDraw works the same.


Yea, but what do OS X users use to edit plain text files? This is no Notepad++ port for Mac (and their won't be without a complete rewrite), so IDK what to tell them to open it with. I'm thinking more about built-in software than stuff you have to download (although I could mention one, just like I do for Windows...)

OS X comes with TextEdit, which is like a Wordpad/Notepad hybrid, so it would need to be open in text mode and not rich text mode. Personally, I rarely use the thing, TextWrangler is a much better OS X text editor.

#10
le717

Thanks for the OS X apps, JMMB. I'll add that to the readme. ;)

BUG REPORT

Blender 2.6 LDraw Importer V0.7 cannot be loaded in Blender 2.64. Why? IDK, I still have to look at the console messages. No planned bug-fix date has been set. In the mean time, if you have updated to Blender 2.64, download the ZIP archive of Blender 2.63 to import your LDraw models/bricks.

#11
le717

I've fixed the Blender 2.6 LDraw Import script. I don't have time to explain what I did, plus I did a bunch of other stuff. Just take a look at Readme.html for more info. Get it on the Topic post.

#12
JrMasterModelBuilder

JrMasterModelBuilder

    LR, LR2, LDR, and LDD Extractor Creator

  • Crystal Members
  • PipPipPipPip
  • 537 posts

I've fixed the Blender 2.6 LDraw Import script. I don't have time to explain what I did, plus I did a bunch of other stuff. Just take a look at Readme.html for more info. Get it on the Topic post.

That's cool that you were able to embed the add_utils in the script, that should make it easier to install.

#13
sinthetic

sinthetic

    Newbie

  • Members
  • Pip
  • 4 posts
Hi le717,

First of all, thank you very much for your time and effort. I am a long time 3D designer that just last week found Lego Digital Designer and couldn't figure out how I could export the files to a useable format (i.e. blender). I am using Blender 2.6.4 (aware of previous bug) and followed your instructions in the Read Me very closely. The only issue I am having is that in blender I can't actually check the box for your importer, it refuses to let me select it, so I am not sure what I did wrong as I thought I did it all right. I am using Mac OSX and the only little stumble I had was which part (how much) of line 29 needed to be replaced. I just replaced the parts you had in the " " with my newly created path which is LDRAWDIR = ~/Library/Application Support/Blender/2.64/scripts/addons does that look right? I didn't want to bother you, but after reading that you updated your script to work with 2.6.4 specifically, I can't figure out what I did wrong or why I can't check the box under User Preferences in blender for your script. Any help would be greatly appreciated, thanks and have a great weekend!

PS: I was using your 0.7.1 version that was uploaded 2 hours before I downloaded it so I am sure it was the latest.

#14
le717

Hi sinthetic! Welcome to RRU! Please stick around for a while!

Thanks for your interest in my Blender 2.6 LDraw Importer. It's always nice to hear from someone who has used my stuff!

First off, Line 29 (LDRAWDIR) should be the path to your LDraw Brick Library. You will need to download the LDraw Brick Library for Mac, and replace Line 29 (only the stuff in " ") with that path. For Windows, the default installation path is C:\LDraw. I do not own a Mac, so I'm not sure where LDraw is installed to by default. In the near future, I hope to fix this method of setting the LDraw path from editing the script to doing it from within Blender. The path you typed is where the script itself belongs. I need to get with JMMB (JrMasterModelBuilder) a bit more on making Mac instructions, as well as Linux ones.

Second, when was it exactly did you download V0.7.1? After the initial upload, I released I forgot to change bl_info to make it work with Blender 2.63 (it said 2.64), as well as to reset the LDrawPath line. I reuploaded it late yesterday, and the currently uploaded version is the corrected one.

As for the bug, I'm not exactly sure what is happening. Can you provide some more info? When you load the script into Blender files, and right after you open Blender itself, open the Console Window (Window>Toggle System Console) and the Addons menu. With the addons and console side by side, click the check box once to write text in the console. Click it only once, because clicking it more than once will reprint the info. Whatever prints, please copy that exactly and paste that here. The info basically says why the script cannot be loaded. I'll take a look at it, and see what I can do to fix it. I won't be able to take a look at it tonight or tomorrow, but I'll look as soon as I can. ;)

Thanks!

-le717

#15
sinthetic

sinthetic

    Newbie

  • Members
  • Pip
  • 4 posts
Hi le717,

Thanks for the reply. I do believe I have the latest version of your script (looking at creation date), but I am going to start all over from scratch to make sure I have it right. I think having JrMasterModelBuilder in the mix would be really helpful as I only use Windows at work at home I primarily run OS X, which has a "console" and the "terminal", but they aren't quite the same as Windows so I'm not sure how to get the text you were referring to. After reading your reply I saw something that stood out and may be my issue, the "LDraw Brick Library". I only have what LEGO Digital Designer installs, so I will first start there and then recreate my path. I am sure this is something I have done wrong, it's just a little foreign to me. Thanks again, I will definitely post a reply if I figure out what I did wrong so not to waste your time, and if I still can't get it right I will just wait for when you and JrMasterModelBuilder have time to help me out if you don't mind. Thanks again!