Scrubs

[Software] MecaBricks - Online Design Tool

Recommended Posts

Hi,

I am considering contributing to Mecabricks, but I cannot find out how to create my own parts. Is there some documentation on how to do that?


Ok, I found that I have to export to JSON from Blender and store the file in data/parts/json/number.js

But I would need to create a full local copy of www.mecabricks.com (at least the workshop files) to test my parts...

Is there a simple way to do this? Or do you recommend a different approach?

Share this post


Link to post
Share on other sites

Hello,

As you already found, the parts are made with blender and exported to json using the export script from Threejs.

There is currently no actual documentation on how to design a part but if needed I can provide samples of Blender files as well as the few rules that I use as a guideline when modeling them. Besides, If you want, I could put together a page including a simplified script to test your parts locally.

Then to put them online, the only solution for now is to send me the blender file(s) and I will include them in the appropriate section of the part library :classic: .

I'm currently working on a part tracker section for mecabricks where registered people could request parts/submit new parts-textures/download the blender 3D files. However it will take me some time before finishing it!

Any help for part design is welcome as it is a big job to maintain & improve the website as well as modeling parts!

Share this post


Link to post
Share on other sites

Hello,

I reworked the user account pages including the account settings and the user library (file manager to organise/publish personal models).

Log in to your account to access the new pages.

Edited by Scrubs

Share this post


Link to post
Share on other sites

I made an embed player last week so that anybody can display public models from mecabricks on their websites. it's pretty simple to use. Just copy and paste the following code:

<iframe frameborder="0" allowFullScreen webkitallowfullscreen="true" mozallowfullscreen="true" src="http://www.mecabricks.com/embed/[iD]?autostart=0&animation=1&transparent=0&white=0&antialias=1"></iframe>

Replace [iD] by the mecabricks Id of the model (e.g. 438 for the Mini Tie Fighter). You can also use the lego set number (e.g. 6240-1) or bricklink reference of minifigs (e.g. ww021).

You can customise the player with the following parameters:

  1. autostart: 1 or 0 - To automatically start loading the model (Default is 0)
  2. animation: Time in seconds - Duration of the animation when the model is loaded (Default is 1sec)
  3. transparent: 1 or 0 - To display a transparent background behind the model(Default is 0)
  4. white: 1 or 0 - To use the white color scheme (Default is 0 - black)
  5. antialias: 1 or 0 - To activate antialiasing if user browser supports it (Default is 1)

I tried it today on a Galaxy Tab 2 and with the few models I loaded, it worked perfectly! I was able to rotate (1 finger), zoom (2 fingers) and pan (3 fingers).

It made me want to buy one of them as Apple doesn't seem to be ready to open WebGL on iOS...

Here are a couple of links you can play with:

http://www.mecabricks.com/embed/col139

http://www.mecabricks.com/embed/lor013

http://www.mecabricks.com/embed/sh003

http://www.mecabrick...m/embed/10232-1

http://www.mecabricks.com/embed/6755-1

http://www.mecabrick...m/embed/31004-1

Edited by Scrubs

Share this post


Link to post
Share on other sites
I tried it today on a Galaxy Tab 2 and with the few models I loaded, it worked perfectly! I was able to rotate (1 finger), zoom (2 fingers) and pan (3 fingers).

Maybe it means you have worked on a touch friendly interface? :classic:

That would be a very good news!

Share this post


Link to post
Share on other sites

I think it's pretty good now to display the existing models on touchscreen devices.

If you have a capable android phone/tablet, you can try one of the links from my previous post.

But it's not possible to build yet.

Share this post


Link to post
Share on other sites

Oh, what a pity!

I hope you will add the touch interface soon.

PS: is there a technical reason why you choose to use iframes to integrate your player?

Iframes are considered unsure and deprecated.

PPS: does the Mecabricks site offers a gallery that uses your embedded player, so that it is possible to exploere models from a mobile device?

Share this post


Link to post
Share on other sites

[...]

PS: is there a technical reason why you choose to use iframes to integrate your player?

Iframes are considered unsure and deprecated.

[...]

Well, that's not totally true. For the most part you are right, it's not very modern to make a website using iFrames (for example the SR3D Builder site), but using a plugin that is a small iFrame isn't very weird at all.

Share this post


Link to post
Share on other sites
PS: is there a technical reason why you choose to use iframes to integrate your player?

Iframes are considered unsure and deprecated.

iframes are completely legit for usage in this case, as they are intended to display external content on a page that is on a different site/server. It's when they're used as layout elements (like separate iframe for the site header, navigation and content) that is considered bad form.

Share this post


Link to post
Share on other sites

Í just read about the 3d viewer on Brickset. Nice work! :thumbup:

It looks very good, although (as also said in the Brickset comments), the viewer doesn't work with very big sets like the Taj Mahal: it crashes at the end of the loading screen (both Chrome and FF).

I'm wondering; are you able to import LDraw files? If so, you know where to get your 3d sets :wink:

EDIT: about the crash: the Taj Mahal suddenly worked after about 5 minutes loading... It worked in Chrome, but FF thinks the script has crashed so it will never finish in FF

Share this post


Link to post
Share on other sites

Thank you :-) Yep I saw your post on brickset. I just tried with the Taj Mahal and effectively it can be pretty long to display (a min or so on my computer from the moment I reached 100%). I changed the method of loading and displaying the parts in this player. It is a lot quicker than before on small/medium models but for big ones, not that great. I have a few ideas that I can try to fix it!

I started to think about importing/exporting other software files like Ldraw/LDD. I'll see how feasible it is.

Share this post


Link to post
Share on other sites

I saw on brickset that Mecabricks has been included in the set's database. That's really great!

Maybe this could give a great push about creating official models using Mecabricks.

The main problem in this context could be the miss of specific parts, especially decorated ones.

Create these parts could be too heavy for a single person (you!), and maybe the importing from LDRAW parts could be very helpful.

But maybe the best way would be to promote and explain how other willing users could create parts, so that you should validate them only.

Share this post


Link to post
Share on other sites

Thank you :-) Yep I saw your post on brickset. I just tried with the Taj Mahal and effectively it can be pretty long to display (a min or so on my computer from the moment I reached 100%). I changed the method of loading and displaying the parts in this player. It is a lot quicker than before on small/medium models but for big ones, not that great. I have a few ideas that I can try to fix it!

I started to think about importing/exporting other software files like Ldraw/LDD. I'll see how feasible it is.

Well, it was not my post on Brickset, I was just referring to someone with the same problem. I'm just called legolijntje on Brickset as well :wink:

Share this post


Link to post
Share on other sites

The main problem in this context could be the miss of specific parts, especially decorated ones.

Create these parts could be too heavy for a single person (you!), and maybe the importing from LDRAW parts could be very helpful.

But maybe the best way would be to promote and explain how other willing users could create parts, so that you should validate them only.

Yes, it's what I'm thinking for a little while now. I am considering making a part tracker for new parts and new decorations. Decorations for existing parts are easy enough to be made. For example for minifig heads, the process looks like that:

Get the UV Map for this part:

eg_head_1.png

Draw the decoration with the colours from the mecabricks/Lego palette and rescale it to fit the UV Map:

eg_head_2.png

Save the final file as a PNG file. Done!

eg_head_3.png

Share this post


Link to post
Share on other sites

It looks very good, although (as also said in the Brickset comments), the viewer doesn't work with very big sets like the Taj Mahal: it crashes at the end of the loading screen (both Chrome and FF).

I just spent some time looking at the issue and I found a nice sneaky bug in the code loading the parts. It was even more obvious on big models. It is now fixed and all the models even big shall be loaded correctly now!

Share this post


Link to post
Share on other sites

I just spent some time looking at the issue and I found a nice sneaky bug in the code loading the parts. It was even more obvious on big models. It is now fixed and all the models even big shall be loaded correctly now!

Well, the bug is gone in FireFox, but it's still loading for a very long time in Chrome...

Thanks for your work, though! :classic:

Share this post


Link to post
Share on other sites

Wow! I was looking at the Mecabricks website for the first time and you guys have done a great job. The official LEGO sets look really fantastic. Looking at Enchanted Island and it was so much cooler than I could do it with LDraw. Sure the LDraw rendering may look closer to the real thing, but you have really made an abundance of parts and even without the stud logos the end product looks really nice. My commendations!

I think I'm stuck too deep into LDraw to get out. *oh2*

I wish they'd make all the parts that you have though.

Share this post


Link to post
Share on other sites

Thank you for your comment :classic:

Live rendering in mecabricks is pretty good, but I know that it could be even better - shadows, shading, textures... The 3D engine I use allows awesome things but I will have to expand my knowledge of the subject.

I'm still way behind Ldraw in term of brick number, but it's a lot quicker for me to add new and decorated parts. Everything is instantly available for everybody as it is web based.

The enchanted island is one of my favourite set - that I even brought from my parent's house to down under when I moved. So gave it a particular attention when I built it!

Share this post


Link to post
Share on other sites

About the rendering, when you will expand your knowledge of this subject, it would be interesting to have a "screenshot mode", where a single frame is rendered with all there effects that would be to heavy for a 3D animated scene.

I mean, if for a fluid movement the scene should be produced at 30fps (1/30 of a second to render a single frame), it would good to have a button that repaint the scene even in few seconds, but with a better graphics, so that you can make a wonderful screenshot.

Any news about the touch-friendly GUI?

I added mecabricks to the bookmarks of some friend's browsers in their tablet, but it was very difficult to use it with the touchscreen.

Share this post


Link to post
Share on other sites

Yep, it wouldn't be an issue. I can generate a single frame with a different rendering, save it as a png file and go back to normal settings.

It's already what happens when you use the screenshot button in the workshop except that the rendering is the same.

For touch devices, I agree that it's not very usable as it is.

I'm in touch with a friend who is a android lecturer at Uni to see if we can maybe make a native android app.

To follow...

As a cool feature, I'm also coding a first person control to visit the inside of the model. It's pretty nice to visit the modular buildings!

Share this post


Link to post
Share on other sites

Very good! It would be more interesting if that happened in two separated stages: at first mechabricks displays the hight quality render and then you can take the screenshot. In this way you can view the hight quality graphics in live view and not only in the screenshot.

The app for Android would be very interesting, but it seems to me that in this way mecabricks looses his webapp identity, and the feature would no be accessible from other mobile OS, especially the minor ones. But probably it would be the best user experience for Android users.

The first person control is a great idea.

Share this post


Link to post
Share on other sites

I'm still way behind Ldraw in term of brick number, but it's a lot quicker for me to add new and decorated parts. Everything is instantly available for everybody as it is web based.

I was especially impressed by the sails and the baseplate. The lack of a decorated mounted baseplate in LDraw was a little frustrating.

Share this post


Link to post
Share on other sites

Touch friendly. iPad perhaps? If not what's the likelihood of developing this or Lego developing LDD etc., for it? It'd be great to not have to use to the laptop sometimes.

Edited by grum64

Share this post


Link to post
Share on other sites
Touch friendly. iPad perhaps?

Not iPad, the integrated browser engine don't support WebGL (unless you jailbreak it and install a recompiled version of Safari, read here).

A touch friendly version would be useful for other tablet devices and hybrid PC/notebook with touchscreen.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.