Jump to content

Photo

LDR Importer


  • Please log in to reply
29 replies to this topic

#16
JrMasterModelBuilder

JrMasterModelBuilder

    LR, LR2, LDR, and LDD Extractor Creator

  • Contributors
  • PipPipPipPip
  • 531 posts
Since the python script is now a single file, these instructions should be easier.

1. Download the LDraw complete.zip from here: http://www.ldraw.org.../downloads.html and extract it.
2. Take the ldraw folder inside and put it somewhere relatively permanent.
3. In Finder, select the Readme.txt file inside the ldraw folder and from the application bar click File, Get Info.
4. Under General, copy the folder path (ends in "ldraw") listed under Where.
5. Open "ldraw_import.py" in a text editor (TextWrangler, TextEdit, etc.) find the line starting with "ldraw_base" and paste the ldraw path copied in step 4 between the quotes after it.
6. Open Blender and open File > User Preferences > Addons > Install Addon...
7. Browse for "ldraw_import.py" and open it.
8. Find the LDraw imported under the Addons window and click the check mark.

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.

That feature actually doesn't exist in the OS X version (not sure about the Linux version). To do that, you would need to open Terminal and do the following:
cd "<the folder blender.app is in>"
cd blender.app/Contents/MacOS
./blender


#17
sinthetic

sinthetic

    Newbie

  • Members
  • Pip
  • 4 posts
JrMasterModelBuilder, thank you very much for the info I really appreciate it. I finally figured out what I had wrong. I had already made an Automator key command to copy the file path so I knew that was correct, but whenI pasted it where the original text was on line 28, there was an extra ' which I thought was supposed to be there since it is in the original. I looked at the syntax of other lines and it didn't make sense I tried removing it and BAM! I can now check the box! I could always see the box, it just wouldn't react with a check mark, just stayed blank. I just did a quick import test with blender and it works great!!!! Thank you so much JrMasterModelBuilder and le717!

#18
le717

JrMasterModelBuilder, thank you very much for the info I really appreciate it. I finally figured out what I had wrong. I had already made an Automator key command to copy the file path so I knew that was correct, but whenI pasted it where the original text was on line 28, there was an extra ' which I thought was supposed to be there since it is in the original. I looked at the syntax of other lines and it didn't make sense I tried removing it and BAM! I can now check the box! I could always see the box, it just wouldn't react with a check mark, just stayed blank. I just did a quick import test with blender and it works great!!!! Thank you so much JrMasterModelBuilder and le717!


You're welcome! You know, last night after I went to bed, I thought about the fact that there may be an extra ' added, I just didn't think about it being in the original script!

Glad to know you got it working. But keep checking back here! We are trying to continue to improve the script as much as we can! :D

P.S. I'll take a look at the script and remove that extra '. I don't want anyone to have any more errors!

EDIT: Fixed the upload. The extra ' has been removed.

#19
le717

I am happy to announce a new, special version of the SpBlender script, Blender 2.6 LDraw Importer Special BMesh Edition. I've taken the V0.7.1 code and changed it to import LDraw models using BMesh, which basically means you can import models use N-gons (up to a 150-gon, the highest I allowed). This is meant to be a research tool, not for general purpose use. Many programs do not support BMesh, and Blender itself supports it as of 2.63+. If you use the script for 3D work, please contine to use the normal release. Again, this is a research tool. I have no plans to make it part of the normal script.

Download Blender 2.6 LDraw Importer Special BMesh Edition from here. I've also upload sample Blender 2.64 BMesh models. And if that isn't enough, here is a large (1080p) clay render of a normal and BMesh LDraw 3001.dat

Spoiler


Enjoy the research.



#20
sinthetic

sinthetic

    Newbie

  • Members
  • Pip
  • 4 posts
Yes, everything is working very well right now, thanks again guys! I just need to learn blender more, I ordered their Blender Inside Out DVD, I know many applications, just not blender. It has so much power for a free app, I had to dedicate some time to it. I used your LDraw import to make a really crude LEGO rubber duck splashing into some water simulation in blender, so fun to play with!

I'll check back here more after i have learned blender better so I can utilize everything properly.

-sinthetic

#21
JrMasterModelBuilder

JrMasterModelBuilder

    LR, LR2, LDR, and LDD Extractor Creator

  • Contributors
  • PipPipPipPip
  • 531 posts

I am happy to announce a new, special version of the SpBlender script, Blender 2.6 LDraw Importer Special BMesh Edition. I've taken the V0.7.1 code and changed it to import LDraw models using BMesh, which basically means you can import models use N-gons (up to a 150-gon, the highest I allowed). This is meant to be a research tool, not for general purpose use. Many programs do not support BMesh, and Blender itself supports it as of 2.63+. If you use the script for 3D work, please contine to use the normal release. Again, this is a research tool. I have no plans to make it part of the normal script.

Download Blender 2.6 LDraw Importer Special BMesh Edition from here. I've also upload sample Blender 2.64 BMesh models. And if that isn't enough, here is a large (1080p) clay render of a normal and BMesh LDraw 3001.dat

Spoiler


Enjoy the research.

EDIT: It seems the [img][/img] tags are broken, so here is the link to the image.

http://triangle717.f...ompare-clay.png


Is there some advantage to supporting N-gons? Is it necessary to import certain models? N-gons are really bad practice in 3D modeling.

#22
le717

Is there some advantage to supporting N-gons? Is it necessary to import certain models? N-gons are really bad practice in 3D modeling.


First question, no not really. I just made this for research. Second question: Not at all. In fact, the models look worse when imported with the BMesh script. I do not plan on adding this to the normal script. Third part: Um, not always. rioforce and I use N-gons in all our stuff. Example: Add>Mesh>Circle, use 32 vertices. Enter Edit mode, select all vertices, and press F. The entire circle has a one-piece face. :)

BUG REPORT!

Bricksmith LDR models do not properly import. This is due to a different layout of the model. Details are on the topic post.

#23
Xiron

le717 just finished an update on the conversion table, but since he had to go at that moment, he asked me to post the update for him. Here ya all go!
http://sourceforge.n...31.zip/download
  • le717 thanked this

#24
le717

Thanks for the post, Sega! You did the best post you could, considering that I didn't tell you anything about it. ;P

Three months after the last release, I have updated the LDraw Conversion Table for LDD. Since the last update, Mike has release V4.29 and 4.30 of his table. I have merged his changes into mine. In the process, I have updated the table requirements to LDD 4.3.5, but unlike Mike, I did not remove any bricks, so it theoretically should continue to work with LDD 4.2.5. If anyone has the version and the table does/doesn't work, please let me know.

However, the biggest changes to the table is not related to bricks, it deals with Colors. Mike's color chart, even in the newest release, is completely broken. It is outdated, and uses a bunch of colors that no longer exist. In addition, he has some colors defined twice, which creates confusion when exporting/importing models, kinda like a tangled extension cord. I fixed some errors in the last version, but in this one, I have completely revamped the table. Using LDConfig.ldr Release 9-13-12 (the newest one), I have added new colors, corrected colors, and removed a few older colors (yes, that is contradictory to what I said about LDD 4.2.5, but leaving them would tangle the cord up even more) by adding them to a commented section.

All these changes continue to make this table the best one around, at least for now. I have contacted Mike about this table, and asked about a possible merge with his, so we will see what happens. For now, enjoy leaving the Black-and-White world of Kansas and enter into the colorful world of Oz. ;P

#25
le717

New update!

Blender 2.65 came out a few days ago, and another bug fix of the LDraw importer is released. I thought for sure it would have broken, since I had to removed old Blender 2.5 Python code in order to support Blender 2.64. but this time, it worked! Nevertheless, I had a few changes to make, so I just released V0.7.2.

No new features in this one (hence the minor version bump), but I did discover that the script can be placed in the scripts/startup folder, thus removing the need to activate it manually, or saving a default.blend with the script. Cool, no?

I've also switched back to LDConfig.ldr for the color definitions. It had trouble locating the other file a few times, although it was present.

Finally, for changes not related directly to the script, I've added separate CSS code to the Readme to remove all the inline code. Also of note: A new Planned Features section, which gives a glimpse of the planned changes.

I've also signed up for the Blender Wiki, and completely updated the Wiki page for the script. You can read it here, although the Readme file looks waaay better than that thing. :P

Download Blender 2.6 LDraw Importer V0.7.2 from the Topic Post!

#26
le717

New release!

V0.8 Beta 1 of the Blender 2.6 LDraw Importer script has been uploaded. This is completely a feature release, the most notable new functions being:


  • Simplified code
  • Completely removed the add_utils code, as I found the functions that it was being used for, and when they were disabled, nothing was different
  • Restored and corrected code that was present in the original version and removed in V0.6. After there was a lot of requests on how to remove Doubles Vertices and recalculate the Vertex Normals, I added back the code and corrected it so it would work properly. Some bricks still have Normals issues, but this is due to the construction of LDraw bricks and not the script.
  • The script has been placed under the GPL V2. Why not V3? Why did you place it under it in the first place? Well, most of the other Blender scripts are under V2, and having it under a legal license better insures that credit is given where credit is due. ;)

But why a Beta and not a final release? A lot of features I had hoped to add in this version did not make it, mainly due to my lack of Python knowledge (although Python 3 lessons are helping me a lot). As I've added in the Planned Features section, I hope to have the ability to skip the import of bricks that can not be found instead of stopping and setting the LDraw path from within Blender in V0.8 Beta 2, and the ability to import Bricksmith LDR's in V0.8 final. Past V0.8 final, the plans are a bit fuzzier, but I've assigned a few features past that. However, if someone is able to implement any of this planned features, please do not hesitate to do so, even if we are nowhere near the planned version number. ;)

As always, link is on the Topic Post.



#27
le717

I've simplified the topic post for your reading pleasure. I'm also glad to announce that the Blender 2.6 LDraw Importer script is now available on GitHub, and has some exciting new changes coming in the next release.



#28
le717

LDR Importer v1.1 has been released! I've updated the topic post with most of the relevant information, but you can view the changes new in this release and get it from https://github.com/l...porter/releases

And no, before anyone asks, Bricksmith models are not supported yet. It will be a while until that happens due to various issues. :(

#29
JimbobJeffers

Just to break the quintuple-post, this is great! I haven't used Blender before but I may have to give it a try just to check this out.



#30
le717

LDR Importer v1.1.5 was released today. Thanks to the MinnieTheMoocher's sharp eye, this intermediate release's change log is only artificially small. The patches that went into the changes were actually quite large. Thanks to MinnieTheMoocher, the entire library layout should be supported, including unofficial, p/48, and the new p/8 folders. In addition, support for high-res and low-res primitives are supported, again thanks to MinnieTheMoocher.

This is an intermediate release because the development team is planning on perform major refactoring on the script in v2.0, and MinnieTheMoocher's reports pushed back those plans (for the better, mind you). The plan of action is still under development.

You can get the newest release from the topic post or from the Releases page directly.


  • Quisoves Pugnat thanked this