How to bake 2-color block?

Hi!

Just a quick question about baking.

It’s more of a yes or no question but asking ‘how’ just in case I’m in luck!

I have X amount of object pairs + corresponding color pairs (materials)—can I bake them grouped and colored into Rhino?

As you know, just grouping the model object with group + baking gets rid of the color.

Can you point me to an example done natively?

Thanks!

HUMAN plugin can do it:


[find HUMAN in packagemanager]

bake groups and colors.gh (30.2 KB)

grp input (Group Index) wants a different group_id (an int) for each group: if your Rhino drawing already has some groups in it, then I would make the Serie component start from a higher value, like 10K in order to not insert these baked geometries into any eventually existing group

I believe there’s no “natural” R8 way to handle Rhino groups at the moment, not even in the R8 GH last-released components

The other option would be to bake blocks.

Here’s an example: Block material confusion - #3 by martinsiegrist

Dear @martinsiegrist,

I’ve edited the title in order to target the problem more effectively.

Your example felt very promising—I checked your file and tried to apply to my situation, but when I push/bake, something weird happens.

I should be getting all these as pairs of rectangles (each pair has one blue and one green):

I thought I had gotten it right because each pair is ONE instance, as it should:

After push…all blocks “are there” but represented by one (same) pair??

Here’s the example:
bake_2-color_block.gh (102.1 KB)

If you’re able to point at the issue I will be eternally grateful.

In your file, all block definitions have the same name, the surfaces are not model objects and the blocks are baked into a standard Grasshopper layer.

I’d do it like this instead:

bake_102_2-color_blocks.gh (112.3 KB)

Wow.

Thanks for showing me that I haven’t learned s@#t about these components.

stare-confused
wtf-is-going-on-confused
patrick-star-shocked
Thanks man

Haha all good :slight_smile:

Blocks can be complicated.

I added a second option to your file with all surfaces defined as non-uniform scaled instances of a 1x1 unit surface. There are two differences. Firstly we have just one block definition and it has one color. Green and blue are only added as material on the block instances. It’s like having 204 pieces of wood with two different paints. The second difference is the file size. One block definition is much less geometry data. The non-uniform scaling might not be the norm however.

image

bake_102_2-color_blocks_vs_1-def.gh (145.5 KB)

Thank you again @martinsiegrist, this has been quite helpful for baking grouped colored objects—I was just thinking of this while working on something else now, but involving text instead of color; pretty much what’s mentioned here 12 years apart lol. Can sets of objects+text be baked grouped and would they have to be blocks as well?

For instance, here are 22 curves:

They would preferably be grouped (to be baked) with these text objects:

Yes this is doable. Not with groups but with blocks it works and I think it is not much different to work with afterwards.