LDraw.org Discussion Forums

Full Version: I’d like to introduce our new Digital LEGO builder called MOC Builder.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Dear fellow digital builders,

I’m Henry Park, a member of BrickLink's tool development team.
I’d like to introduce MOC Builder, our new Digital LEGO builder, that was developed based on LDraw's library of virtual LEGO bricks. It allows you to build a virtual LEGO creation on your Windows, Mac, or Linux computer. It also helps you order real LEGO bricks to turn your virtual creation into a physical model. To make that possible, we added part connectivity on top of the LDraw library and integrated BrickLink's marketplace within the tool.

[Image: MOCBuilder.png]

[Image: MOCBuilder_price.png]

Here are key features of MOC Builder:
  • Drag-and-drop building
  • Building with Connectivity
  • Undo, Redo, Cut, Copy and Paste
  • Loads both LDraw and LDD (Lego Digital Designer) models
  • Search parts by name and description either from LDraw library or BrickLink Catalog
  • Part Browser with customizable category
  • Supports all LDraw colors (as of 10/30/2014)
  • Find and replace (with color) parts within a working Set
  • Step browsing for building instructions
  • Automatic grouping
  • Overlap Check
  • Import a set as a model from local file system
  • Import a set from the Set Inventory of BrickLink
  • Export parts to BrickLink Wanted List
  • Calculate price of model based on BrickLink market price of the parts
  • +Connectivity Editor

MOC Builder is an open source, free software. Any ideas, comments, or bug reports will be greatly appreciated. If you are a developer of existing tools on LDraw platform and wish to integrate your tools with MOC Builder, I’d love to hear any suggestions from you.
Please feel free to contact me.

MOC Builder is licensed under The BSB 3-Clause License.

MOC Builder can be download following link:

Henry Park
I just played a little bit with this new tool. Seems to be a good approach. It should support also mpd content files, but I can not find a way to modify mpd content files.
I just also quickly played with it on PC. These are my initial thoughts to it:

I was confused that all parts have a "chain link" icon in the parts tree and in the model parts list.
I would have preferred some nicer icon, for example, a 1x1 plate.

All part aliases (for example "= Animal Dragon Wing") are displayed with a yellow exclamation mark
overlay icon. Why? And can you do something about polishing the title a little? The initial special character "="
should be suppressed IMHO. Part aliases are alternative part numbers of a part that already exists with a different number.

The "Option" menu should be named "Options" IMHO, and the menu item "Option/Shortcut" renamed to
"Options/Keyboard Shortcuts".

I can not see any studs!?

Ugh, the loading of .ldr scenes needs improvement.
When I load some .ldr scene from some folder on my harddisk (outside the LDRAW installation folder),
and that file uses some other *.ldr files (which lie next to the scene), these are not found
and shown with a red X icon. This is frustrating, because I cannot load my .ldr scenes.......
When fixing this, please also make sure that the ldraw "models" folder is also sought for part files,
as this is also a standard LDRAW search location. Additionally, I would like to be able to add more custom
part search folders, for example I want to use LSYNTH primitives. ----> Can you add a .ini file
where I can edit the part search folders manually?

Thank you for your valuable comments!
I'd like to reflect it in the next release.

p.s I can't understand the meaning of "(4)I can not see any studs!?" Please give me more example(screenshot or description etc).

Henry Park.
Open source, free, available on Linux, WOW! I'm so going to test this tonight. Thank you for the "open"ness of this project. That should help keep it alive for years to come.
I'm only seeing the Apple and Windows packages, does it need to be compiled for Linux distros? I have no idea how to do that yet.
Well, LEGO bricks have the small connectors on their top. These are called "studs",
and as you can see in the screenshot above, your LEGO renderings do not have these,
they just appear as a blue box, but there are no cylindrical connectors at the top.
Or did I do something wrong?
just tested it, look really impressive actually. love the snapping of parts and the collision detection.
I'll try and model a complete build later.. I hope it could become my default editor Smile

I'll check the sources too.
Could you add a "LEdit/MLCAD" mode? By this I mean the part movement and rotation keyboard controls of LEdit and MLCAD, as well as the flat-sided orthographic views. These are the main things I'm missing in recent LDraw editors.
I've found my first bug: it looks like when you write floats into the file, they get the decimal separator defined by Locale, instead of the dot. Here's what i find in a file saved with MOC Builder:

0 Name: spaceship2.ldr
0 Author:
0 ROTATION CENTER 0 0 0 1 "Custom"
1 8 0,000 -8,000 -10,000 1,000 0,000 0,000 0,000 1,000 0,000 0,000 0,000 1,000 3032.dat
1 8 0,000 -8,000 40,000 1,000 0,000 0,000 0,000 1,000 0,000 0,000 0,000 1,000 3666.dat

The problem is in the method in LDrawUtilities, here's one of the possible solutions:

public static String outputStringForFloat(float f) {
        // Locale.US ensure using dot as decimal separator
        return String.format(Locale.US, "%.3f",
                Math.round(f / LDrawGlobalFlag.DecimalPoint)
                        * LDrawGlobalFlag.DecimalPoint);
Ubuntu 12.04LTS 64bit.

Been playing around a bit. A few things that I'm struggling with.

1. The preview color palette closes after I select a part, it would be nice to have an option for it to not.
2. It would be nice if both palettes could be re-sizable.
3. It would be nice if both palettes could be dockable.
4. May just be a Linux thing but MOC B always opens in a small window. It doesn't remember the previous set up. Even just a open in a fully expanded state option would be nice.
5. The right mouse button rotates the camera view but [shift] LEFT button moves the camera view. This confuses me a little bit, for me logically [shift] right mouse button seems more natural.

6. The biggest issue however is when I try and open any model (ldr). The model will open in the editor but the open file browse window stays and never goes away. I can't find a way around that so I have to force close MOC B. When I open after a force close it detects a temp file and asks if I want to open it. If I click YES, the same problem happens and that dialog never goes away, force close again. If I say no, and no model loads then the dialog goes away and I can use the program. So I can build a model, just can't open one.
also the unnecessary trailing zeros should be avoided to reduce filesize
Well, I think it is might be a bug came from your running environment.
Please let me know your environment for the MOC Builder.
(The above screenshot is the MOC Builder.)

Henry Park.
Sure, I'll reflect your suggestions in the next few releases.

Thanks Michael.
Thanks Nicola Smile
I fixed the bug by based on your suggestion.
Thanks Jason for your great suggestions.

I fixed the bug(6.), and published a new release.
And, I reflected your suggestions into my issue list(you can show it at https://github.com/MOCBuilderOrg/MOCBuilder/issues). I'll try to provide features that you suggested.
Thank you very much Henry, looking forward to trying out the new build. That was fast!
RE: Public Release_20141201-1(BugFix) on Ubuntu 12.04LTS 64Bit

I can now open a file without issue, thank you for this quick fix.

- Bug #39 is still present, window continues to open small.

- After closing and reopening the MB I sometimes get the Temporary Saved File notification even if I have saved right before exit.

[Image: Screenshot%20from%202014-12-01%2020%3A43%3A17.png]

I think there may be something strange going on with autosave. The first couple of times I opened MB it became unresponsive and couldn't close it and had to force quit. That issue seems to have gone away on it's own. MB also continued to look for the LDraw library for the first few starts as well but that has gone away as well.
I think the exit process of MB on linux has a bug. The "Auto Save" message box is opened if the MB is not terminated in normal.
I'll check it more.

Thanks Jason.
Finally, I fixed the bug.
New Release For Linux.

Thanks Jason.
Thank you Henry, it opens to whatever size I left it at now.

In respect to the "Auto Save" bug, if I [Save As] and select a file I already have, MB crashes as soon as I hit "Yes" in the overwrite dialog window. If I hit "No" all is fine, the window goes away.
One more thing Henry, should MB be asking me to save any unsaved work before I close? Right now it isn't doing that.
Thanks Jason.
I uploaded a fixed version.
Thank you for the quick update Henry.

The overwrite bug is fixed and it also asks me now to save if I haven't done so before exiting, that's great.

When I exit and say yes to saving the file that I opened and edited it brings up the overwrite dialog. Should it do this or should it just save and exit without the overwrite dialog since it was the original and same file that I opened?

When I'm opening any model that seems to be more than just a few parts MB becomes unresponsive. Maybe it has to do with a model having more than one step, not sure.

I tried to open many files and all caused the issue. If they were smaller like this one: http://dl.dropbox.com/u/59864198/LDraw/M...Falcon.ldr
from here (http://www.eurobricks.com/forum/index.ph...try1293573)

the file will load and become unresponsive just after it loads up. Models that are bigger, MB will become unresponsive while loading and I'll never see them. In all cases I have to force quit.

Here is my Terminal output during the opening of the above file, not sure if it will help you.

Quote:SWTAccessor.<init>: GTK Version: 2.8.10
at Exports.CompatiblePartManager.loadBricklinkInfo(CompatiblePartManager.java:473)
at Exports.CompatiblePartManager.<init>(CompatiblePartManager.java:97)
at Exports.CompatiblePartManager.getInstance(CompatiblePartManager.java:499)
at LDraw.Support.PartCache.getPartLists2(PartCache.java:265)
at LDraw.Support.PartCache.getPartLists(PartCache.java:127)
at LDraw.Support.PartCache.addCacheItemForSearchCacheTable(PartCache.java:95)
at LDraw.Support.PartCache.access$2(PartCache.java:92)
at LDraw.Support.PartCache$1.run(PartCache.java:78)
at java.lang.Thread.run(Thread.java:745)
Num Of Compatible Item From compatible.js:5680
Accumulated Num Of Compatible Item From Bricklink:5680
search Cache table is ready
unrecognized LDraw line type:
unrecognized LDraw line type:
unrecognized LDraw line type:
unrecognized LDraw line type:
unrecognized LDraw line type:
unrecognized LDraw line type:
unrecognized LDraw line type:
unrecognized LDraw line type:
unrecognized LDraw line type:
Generating Conn Info for 6190.dat requires 3ms
Generating Conn Info for 44375.dat requires 3ms
1.7102555 seconds to load.
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String index out of range: -1)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Unknown Source)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at Window.MOCBuilderUI.open(MOCBuilderUI.java:182)
at Window.MOCBuilder.main(MOCBuilder.java:107)
... 5 more
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1875)
at Window.GroupEditorView$1.run(GroupEditorView.java:198)
at org.eclipse.swt.widgets.RunnableLock.run(Unknown Source)
... 10 more
Something is dying, what does that mean? This text shows in Terminal after each part placement. Just curious, seems bad.

Quote:Clicked Brick: 3005.dat, Pos: -10.000000, -24.000002, -10.000000
Connectible other Bricks: WARNING: LDraw part is receiving a notification that its observer is dying but it thinks it should have no observer.

In respect to the unresponsiveness I checked a very small 4 part ldr file with 4 steps and it opened fine. Must be the number of parts that's causing the issue.
I downloaded Public Release_20141203-1(BugFix) and tried again,
the problem is still present.
I see no studs.

My environment:
Windows 7 Ultimate 64bit English
ATI Radon HD 4600
Steffen I'll boot up into My Windows 7 Ultimate 64bit partition and give it a try, I'm using a Nvidia GTX 460 though.
This isn't going to help but it works for me Steffen. Maybe your video card drivers? My Java install was jre-8u25-windows-x64
I tried several times but the program would freeze with the "Not Responding" message.

Windows 7 x64

I've attached an example model.
I just tried Public Release_20141203-1(BugFix) on Windows 7 x64 Home Premium.

The program would load my model just fine, but then become completely unresponsive. There is a "Not Responding" message in the program title bar.

I've attached one of the models I've been trying to view.
Hi Henry,

It's very surreal to see Bricksmith code ported to Java. :-)

Does the project have any design documents on the connectivity model? I'd be interested in porting connectivity back to Bricksmith.

Michael it seems as though you're having the same issues that I am on Linux. There must be a program wide issue causing the freezes. Open a real small model with <20 parts and see what happens.
Hi Michael, thank you for bug reports!.
I found a bug might be related to this problem and I fixed it recently.
MB has a bug in displaying a comment of no description.
I'll upload a bug-fixed release soon.

Thank you, if you don't mind creating a Linux download that would be great! Smile
Hi ben,
I have no well-formed design document for the connectivity model yet.

I need helps~~~ for documenting it.

I uploaded a Bug Fix Release.

I'm having an issue loading files. They open up fine in LDCad but not here. I've tried my own LDraw library as well as the included LDraw library within the MB folder. The issue seems like it can't find the parts as I get many red "X" in the parts section on the right.

Many models that I try and load are missing parts here and there, some worse than others. This is what happens when I try and load the attached file. As I said it opens up just fine in both LDCad and JBrickBuilder.

[Image: Screenshot%20from%202015-01-12%2014%3A29%3A47s.jpg]
Hi there, first time posting here, and I'm personally very excited about this tool!
The ability to open both files from either LDD or LDraw is great! But I have a question/idea of sorts for this tool...
would it ever be possible to export the model to a format like .obj or .3ds like LeoCAD can?
I mostly would like this feature because I would like to make high resolution/high quality renders and animations in my 3D program of choice (Blender)...
will this ever be a possible feature in the future?
(2014-12-01, 8:11)HenryPark Wrote: [ -> ]Thanks Jason for your great suggestions.

I fixed the bug(6.), and published a new release.
And, I reflected your suggestions into my issue list(you can show it at https://github.com/MOCBuilderOrg/MOCBuilder/issues). I'll try to provide features that you suggested.
Hello, I am very interested in this tool .[color=#222222][size=xx-large][font=Tahoma, Verdana, Arial, sans-serif]But I seem to be late.
... Huh can you share the source last version again?[/font][/size][/color]