LDraw.org Discussion Forums
Blender LDraw import tool - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: LDraw Programs (https://forums.ldraw.org/forum-7.html)
+--- Forum: LDraw File Processing and Conversion (https://forums.ldraw.org/forum-22.html)
+--- Thread: Blender LDraw import tool (/thread-22780.html)

Pages: 1 2 3


Blender LDraw import tool - Merlijn Wissink - 2018-03-31

I just came across this Blender LDraw importer on Github: https://github.com/TobyLobster/ImportLDraw

I didn't know that one existed, I only knew of another one that only supported ldr files (and hasn't been updated in a while). This one however, supports dat, ldr and mpd files and seems to be relatively active too. It also has two modes: realistic and 'instruction style', which is a nice plus too.

I'm by far not a Blender expert, but I very quickly tried it on a small mpd file and the realistic mode produces quite a nice image without any tinkering (I just imported the model and pressed render). It's by far not as realistic as those Blender renders from Mecabricks, but pretty nice nonetheless  Smile


And just to make it extra clear: I'm not the author of this tool, just figured I'd share it here because I hadn't seen it here before (correct me if I'm wrong).


RE: Blender LDraw import tool - Steffen - 2018-03-31

wow, thank you very much for this hint!
especially the "instructions mode" looks very cool!

the only thing that I immediately noticed in the example pictures was the lack of a "primitives substitution" mode -
round cylinders look very polygonal there.

I'll happily try this out, it looks very nice and the readme.md looks very carefully written

thanks!
Smile  Smile  Smile


RE: Blender LDraw import tool - Merlijn Wissink - 2018-03-31

(2018-03-31, 8:45)Steffen Wrote: wow, thank you very much for this hint!
especially the "instructions mode" looks very cool!

the only thing that I immediately noticed in the example pictures was the lack of a "primitives substitution" mode -
round cylinders look very polygonal there.

I'll happily try this out, it looks very nice and the readme.md looks very carefully written

thanks!
Smile  Smile  Smile

There are a whole bunch of import options, one of which is a selection between 'Standard primitives', 'High resolution primitives' and 'Low resolution primitives'. Maybe the example image didn't use the high resolution ones?

This is a test image I rendered this morning: https://i.imgur.com/Ko95dLk.png
Like I said, it isn't perfect (especially the lighting on the top curves looks a bit weird), but it looks pretty nice nonetheless (imo), especially considering I have done absolutely nothing in Blender to enhance the render Smile


RE: Blender LDraw import tool - Steffen - 2018-03-31

I also tried this now Smile
I downloaded Blender 2.79b, installed that plugin and directly imported and rendered one of my 12V train test scenes,
without adjusting any settings manually:

[Image: blenderrender01.png]

I very, very much like this default result.
Rendering time was 30 minutes.
LEGO logos were turned off by default.
I notice something strange going on at the roof slopes.
The reflection there looks somehow weird.
But still: an amazing result.


RE: Blender LDraw import tool - Merlijn Wissink - 2018-03-31

About the reflection on the slopes: I had a similar effect on (sloped) tiles. Under the import option, there's a setting called 'Use curved wall normals' which is on by default. If you turn this off, the reflections should look less weird.

The github page mentions the following about this setting:

Quote:
  • Concave walls - Optionally look as if each brick has very slightly concave walls (with the photorealistic renderer), which affects the look of light reflections.

And the idea is nice, but when parts are in a certain angle to the lighting it creates this weird effect.


RE: Blender LDraw import tool - Philippe Hurbain - 2018-03-31

Interesting, but doesn't work very well for me... Using all default options, it took 45 minutes to generate this... mainly magenta image (here I post only a thumbnail, initial image was 1920x1080). Looking at it in Photoshop, the green layer is completely black, explaining the magenta hue. I then tried to change renderer from "cycles" to "blender render" and this time got a B/W shadow image (in a few seconds). And I found no way to change the viewpoint (camera position). I guess I'll find it easily in some tutorial, but I would have thought that it would be easier to find. I HATE Blender UI...

If someone has an idea about the weird colors I get...


RE: Blender LDraw import tool - Merlijn Wissink - 2018-03-31

No idea what the problem could be, but I would think it has more to do with Blender itself than the import tool. Did you freshly install Blender? Maybe remove all (previous) settings? I'm not a big fan of the Blender UI either.


I just did a new test, this time at a higher (4K) resolution: https://i.imgur.com/NFyP0eA.png

I disabled the concave walls and enabled the brick seams. Looks pretty nice, although the lever parts look a bit rough. One halve is smooth and the other halve still has visible polygons, which creates a very weird look. And I think I have to slighly lower the brick seams.


RE: Blender LDraw import tool - Philippe Hurbain - 2018-04-01

(2018-03-31, 18:26)Merlijn Wissink Wrote: No idea what the problem could be, but I would think it has more to do with Blender itself than the import tool. Did you freshly install Blender? Maybe remove all (previous) settings? I'm not a big fan of the Blender UI either.
I did an uninstall (as thorough as possible), reinstalled 2.79b... result is still the same. Only improvement: I managed to change viewpoint!


RE: Blender LDraw import tool - Santeri Piippo - 2018-04-01

(2018-04-01, 8:21)Philippe Hurbain Wrote:
(2018-03-31, 18:26)Merlijn Wissink Wrote: No idea what the problem could be, but I would think it has more to do with Blender itself than the import tool. Did you freshly install Blender? Maybe remove all (previous) settings? I'm not a big fan of the Blender UI either.
I did an uninstall (as thorough as possible), reinstalled 2.79b... result is still the same. Only improvement:  I managed to change viewpoint!

Could also be a driver issue. Often graphics drivers have bugs that manifest as strange behavior in very specific circumstances, like with here. Are your drivers up to date?


RE: Blender LDraw import tool - Philippe Hurbain - 2018-04-01

Quote:Could also be a driver issue. Often graphics drivers have bugs that manifest as strange behavior in very specific circumstances, like with here. Are your drivers up to date?
Not completely sure, but if I save the image and look at it with Photoshop, the green channel IS completely black. Why would this depend on graphics board?