ldr_tools_blender addon import LDraw into Blender


ldr_tools_blender addon import LDraw into Blender
#1
The first release of the ldr_tools_blender addon is available on github. The goal of this project is to provided a reliable and performant way to import digital LEGO models into modern versions of Blender for rendering. Both .ldr and .mpd files are supported. You can even import and render very large scenes with hundreds of thousands of pieces using a special instancing option on import.

I've attached a render made of the UCS Millennium Falcon using the addon. The addon creates PBR materials for use with Blender Cycles. You'll need to create your own lights, however. This render is using an HDRI for the environment and a sun lamp with a softer lighting angle to create the shadows. Working directly in Blender has a bit of a learning curve compared to something like Studio's renders. The advantage is better control and being able to take full advantage of your hardware for rendering. I plan on updating the github WIKI with a tutorial for rendering at some point.

The basic installation process and usage is the same as previous importer addons like https://github.com/TobyLobster/ImportLDraw or https://github.com/cuddlyogre/ExportLDraw. Supporting older Blender versions is not a goal of this project, so these are still your best options for Blender versions prior to 3.3. Some releases of ldr_tools_blender will have to break compatibility with previous Blender versions if Blender updates its Python version. This doesn't happen often, so it shouldn't be a big issue. Previous addon releases will still be available to download when this happens.

[Image: 225458929-e1870792-6125-443b-af49-fc047b6c8167.jpg]

This is the first release, so there will be bugs. Please let me know if you have any questions, comments, or concerns. Making an issue on github is the best way to notify me and others of of feature requests or bug reports. This is also how I track if something has already been reported or fixed. I'll still check this thread, but I won't always be as quick to respond as github notifications.

While most of the core LDraw spec is implemented like MPD, I'm hoping to get feedback on what additional extensions or features need to be added. The last time I did digital lego modeling, LDD was still getting updates. The LDraw tools are still very new to me. I do most of my testing with OMR models or exports from Studio. Please let me know if any of your models don't import or don't import in the way you would expect.

The addon is a thin Python wrapper over some LDraw processing code written in Rust. The components are all open source. Check the github link for information on how to develop and contribute or figure out how it works. Most of the code is written in Rust for performance reasons and to take advantage of existing libraries. Splitting up the code like this means the actual addon itself has very little code and also allows components to be reused in other projects. Sadly, some implementation quirks in Blender prevent the importer from being as fast as it could be. The code is still substantially faster than any of the existing Blender importers and can even outperform the Mecabricks importer. Differences are most noticeable on large scenes.

Some quick benchmarks using a stopwatch. I've done my best to use comparable quality options for all importers. I'm not including memory usage, but memory usage was also substantially lower in ldr_tools_blender. You can get comparable memory usage in the other two addons by disabling any options that create modifiers, since this doesn't play nicely with sharing meshes in Blender.

10179-1 - Millennium Falcon - UCS, Logo4
ExportLDraw - 68s
ImportLDraw - 100s
ldr_tools_blender - 7s
ldr_tools_blender (instance on faces) - 5s

31203-1 - World Map, Logo4
ExportLDraw - 24s
ImportLDraw - 58s
ldr_tools_blender - 6s
ldr_tools_blender (instance on faces) - 2s

Repository
https://github.com/ScanMountGoat/ldr_tools_blender

Download:
https://github.com/ScanMountGoat/ldr_too...r/releases

Report bugs or request new features:
https://github.com/ScanMountGoat/ldr_too...der/issues
Reply
RE: ldr_tools_blender addon import LDraw into Blender
#2
Is it possible to add multiple LDraw paths for this addon to work for?
Reply
RE: ldr_tools_blender addon import LDraw into Blender
#3
(2023-04-07, 22:30)Max Murtazin Wrote: Is it possible to add multiple LDraw paths for this addon to work for?

Do you mean changing the entire library path or adding additional parts folders to search like for unofficial parts? The addon already allows you to edit the library path when importing and saves it for next time. I should be able to make some adjustments for the next release once I understand the use case a bit better.
Reply
RE: ldr_tools_blender addon import LDraw into Blender
#4
(2023-04-07, 23:13)Jonathan N Wrote: Do you mean changing the entire library path or adding additional parts folders to search like for unofficial parts? The addon already allows you to edit the library path when importing and saves it for next time. I should be able to make some adjustments for the next release once I understand the use case a bit better.

Adding additional parts folders, yes
Reply
RE: ldr_tools_blender addon import LDraw into Blender
#5
Version 0.2.0 of the addon has now been released. This release fixes some bugs related to part transforms, improves the quality of materials, and improves import times. You can download the appropriate version of the addon based on your operating system from https://github.com/ScanMountGoat/ldr_too...ses/latest. Windows users will need to follow the instructions listed to properly uninstall and upgrade to the latest version. Let me know if anyone has any comments or questions.
Reply
RE: ldr_tools_blender addon import LDraw into Blender
#6
Any way of getting a brief tutorial on how to get a render like your 10179 example, basically the out-of-the-box render you would get from Studio/Eyesight? Maybe a starter package with the same light and camera controls? I don't really need any more functionality than that, but what would be helpful is reliability and openness of support. (Studio has this habit of introducing new bugs a quickly as it fixes them—once you've solved a rendering problem, you can't count on it always being that way!)
Reply
RE: ldr_tools_blender addon import LDraw into Blender
#7
(2023-08-22, 0:17)N. W. Perry Wrote: Any way of getting a brief tutorial on how to get a render like your 10179 example, basically the out-of-the-box render you would get from Studio/Eyesight? Maybe a starter package with the same light and camera controls? I don't really need any more functionality than that, but what would be helpful is reliability and openness of support. (Studio has this habit of introducing new bugs a quickly as it fixes them—once you've solved a rendering problem, you can't count on it always being that way!)
+1
Fighting with quirky Studio LDraw import is also painful 😣
Reply
RE: ldr_tools_blender addon import LDraw into Blender
#8
(2023-08-22, 0:17)N. W. Perry Wrote: Any way of getting a brief tutorial on how to get a render like your 10179 example, basically the out-of-the-box render you would get from Studio/Eyesight? Maybe a starter package with the same light and camera controls? I don't really need any more functionality than that, but what would be helpful is reliability and openness of support. (Studio has this habit of introducing new bugs a quickly as it fixes them—once you've solved a rendering problem, you can't count on it always being that way!)

While I can't promise presets that fully cover the functionality of eyesight, I can start adding a tutorial to the project wiki for rendering. A lot of rendering needs can be covered by setting up a simple scene and reusing it in each project by importing a blend file or overriding Blender's default scene. A render setup like I did for the falcon should be pretty simple to explain in a tutorial. Lego models vary wildly in scale, so I'm not sure if I can provide a starter scene that will work well in most cases.
Reply
RE: ldr_tools_blender addon import LDraw into Blender
#9
(2023-08-23, 21:34)Jonathan N Wrote: While I can't promise presets that fully cover the functionality of eyesight, I can start adding a tutorial to the project wiki for rendering. A lot of rendering needs can be covered by setting up a simple scene and reusing it in each project by importing a blend file or overriding Blender's default scene. A render setup like I did for the falcon should be pretty simple to explain in a tutorial. Lego models vary wildly in scale, so I'm not sure if I can provide a starter scene that will work well in most cases.

Your scene is pretty close to the Eyesight default, and that's all I'd really need to get started. Basically I just need to work out how to set the camera and lighting positions using the lat/long, zoom, FOV and so on that the Studio render panel uses. I don't go in for any fancy stuff myself. :-)
Reply
RE: ldr_tools_blender addon import LDraw into Blender
#10
I've created a tutorial on the wiki for how to set up renders in Cycles, including basic scene setup and some more advanced techniques like transparent renders and depth of field. I understand that people will have varying levels of familiarity with Blender, so please let me know if there's anything else that should be covered. I've included some screenshots for most of the settings I've used. I'd like for people to learn how to make their own sample scene to use for renders, but I'm not against uploading one in the future.

https://github.com/ScanMountGoat/ldr_too...es-Renders
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 2 Guest(s)