Giuseppe Flora's profile

Lego Study and EzBricks Generator HDA

Lego Study and EzBricks Generator HDA
EzBricks is a custom HDA tool I started working on a while ago. The intention was to create a tool to create Lego pieces on the fly, and as I was adding more pieces, the tool was getting bigger and bigger...
In the actual state, it can generate a lot of different Lego bricks but obviously, a lot more can be added so it will be probably improved in the future as I will create more Lego sets.
The current state of the HDA:
Of course, a lot of organization was needed to don't get lost inside the HDA itself, and that required a lot of effort.
The top Green part is where the common parts are; like the top and bottom stud and other parts which are shared among almost every piece; so they can be all edited and adjusted in one go.
All the purple blocks are the main piece types. I used Leocad to have some references for the measures and also for the categories to organize the different pieces.
On the bottom, everything is merged and handled by the controls of the HDA.
The idea was to have not only the brick geometry but also some useful controls for it. Right now the HDA creates the regular Geometry, a low-poly Collider for simulation, and an edge Bevel group.
In addition, it can hide the bottom stud and the collider (for visualisation and memory purposes), it can control the Normal Angle for the output geometry, it has a global scale, and the option to pack the geometry (which makes the whole thing very fast). Finally, it gives you the option to assign a Material name, a Name attribute and a Color to the piece.
All of this is in the general controls.
On the second panel, you have the core of the HDA, this is where the pieces are generated, by choosing the main part category, the type of piece inside of that category, and if available, the desired unit in length, width and height for it.
LEGO Iron Man Helmet
After building the HDA, I used it to build a couple of Lego Sets: the first, as an old Marvel fan, was the Iron Man Helmet:
This set was fairly easy to build, there aren't a lot of pieces in it and I tried to use the HDA as it is, creating a copy of the HDA for each different brick I needed. And although it was very fast to work with and the scene ran pretty smoothly, the scene loading and every update to the tools itself required 2-3 minutes of loading time. Of course, this can be improved by a lot with some Python (it's on the to-do list), but this method wasn't the best solution.
Anyway, the building process was actually fun to do.
After building the set, I created an animation using some Vex code to move the pieces along a set of curves and used Mops to add a delay to the different pieces and groups. Everything is animated using the low-poly collider and then transferred to the bevelled pieces with a Transform Pieces node:
This is the resulting animation:
___________________________________
LEGO Jazz Club
After the first set, I moved on to this one. This set was way more complicated, it actually has 2899 pieces in it, so it required some time to build.
To avoid a huge loading time for the HDA, this time I first saved all the different pieces I needed as .bgeo files, this resulted in a very fast time to open the scene, and whenever I needed to fix something, all I needed to do was to re-save the desired brick. I also added a convenient Name field to the Rop Geometry Output to input just the piece name.
I also created a secondary HDA tool to import the bricks and linked all the controls to a global Null.
Nevertheless, this set was a huge thing to build in a traditional way, as you can see from the final Network, so probably the next phase will be to use Python to create a faster solution for the building process:
Anyway, I'm pretty happy with the result, I also added some lighting to create some night renders and these are the result, hope you enjoy it ^^:
If you want to see how the HDA started, here's the link to my YouTube tutorial on how to create some basic Lego bricks:
Lego Study and EzBricks Generator HDA
Published:

Owner

Lego Study and EzBricks Generator HDA

Published: