# Baking objects with groups

**URL:** <https://discourse.mcneel.com/t/baking-objects-with-groups/113892>\
**Category:** Grasshopper\
**Created:** [December 5, 2020, 8:08pm UTC](https://discourse.mcneel.com/t/baking-objects-with-groups/113892 "2020-12-05T20:08:41Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Balazs](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/balazs/32/493129_2.png) [@Balazs](https://discourse.mcneel.com/u/Balazs)\
**Post date:** [December 5, 2020, 8:08pm UTC](https://discourse.mcneel.com/t/baking-objects-with-groups/113892/1 "2020-12-05T20:08:41Z")

</div>

I am migrating my definitions to work with Rhino 6. Actually I had a script for baking which no longer works in rhino6. So I am trying to use Lunchbox’s bake. I cannot figure out how to bake grouped objects with it. I misses the group input which existed in my former script. Any idea how to do that? If I am trying to use the group widget nothing is baked. Or are there any other bake solutions stuff with groups? ![lunchbox bake](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/a/f/6/af68bfa6328dc18619ca9d0024cc03896636b96f.png)

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [December 5, 2020, 8:13pm UTC](https://discourse.mcneel.com/t/baking-objects-with-groups/113892/2 "2020-12-05T20:13:24Z")

</div>

Try this:

> [@'Bake to Layer' component with 'M' (Material) input?](https://discourse.mcneel.com/t/bake-to-layer-component-with-m-material-input/94820/21):
>
> Updated. Now handles groups. Open source Python. [mMaterial\_bake\_to\_layer\_pieces\_2020Jan30a] [mMaterial\_2020Jan30a.gh](https://discourse.mcneel.com/uploads/short-url/tT3jO02lTlkRmRzBJCzuNxWz0f6.gh) (29.5 KB) [mMaterial\_bake\_to\_layer\_2020Jan30a.gh](https://discourse.mcneel.com/uploads/short-url/y7Oqz7ADCwfvRIuaZkxLio55ltj.gh) (39.5 KB) [STEP1\_mMaterial\_bake\_to\_layer\_2020Jan30a.gh](https://discourse.mcneel.com/uploads/short-url/rKXhgsDuiVzltPQk6yIx7qWm6T0.gh) (40.0 KB) [STEP2\_mMaterial\_bake\_to\_layer\_2020Jan30a.gh](https://discourse.mcneel.com/uploads/short-url/n6jyaPrIayEJ5Z3hSZOEQxUr1Sc.gh) (16.1 KB) NOTE: The ~5 second benchmark in this video is more than three times longer than the same operation takes when not running the video capture software…? What are blocks? Again, I’d rather not be distracted …

---

<div class="post-metadata">

**Author:** ![morten1](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/morten1/32/636830_2.png) [@morten1](https://discourse.mcneel.com/u/morten1)\
**Post date:** [December 5, 2020, 8:13pm UTC](https://discourse.mcneel.com/t/baking-objects-with-groups/113892/3 "2020-12-05T20:13:26Z")

</div>

Try right clicking on the ‘quick baker’ from Heteroptera. That will give you the option to group upon bake.

> **[Quick Baker - Heteroptera - Component for Grasshopper | Grasshopper Docs](https://grasshopperdocs.com/components/heteroptera/quickBaker.html)**

---

<div class="post-metadata">

**Author:** ![Balazs](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/balazs/32/493129_2.png) [@Balazs](https://discourse.mcneel.com/u/Balazs)\
**Post date:** [December 6, 2020, 11:03am UTC](https://discourse.mcneel.com/t/baking-objects-with-groups/113892/4 "2020-12-06T11:03:35Z")

</div>

Thank you. Actually I see neither color nor group input on the Bake widget. I cant figure out how it works.

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [December 6, 2020, 11:38am UTC](https://discourse.mcneel.com/t/baking-objects-with-groups/113892/5 "2020-12-06T11:38:27Z")

</div>

> [@Balazs](#):
>
> Actually I see neither color nor group input on the Bake widget. I cant figure out how it works.

Use the standard GH Group component, of course, as shown in the example provided.

 ![mMaterial_bake_to_layer_2020Dec6a](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/1/9/9/19949e0139734f51f68f347b30be86721254bdd3.jpeg)  
[mMaterial\_bake\_to\_layer\_2020Jan30a.gh](https://discourse.mcneel.com/uploads/short-url/y7Oqz7ADCwfvRIuaZkxLio55ltj.gh) (39.5 KB)

Color is a property of material which is set using the provided mMaterial component, as demonstrated in the same code example. It’s all there, try harder. Much harder.

---

<div class="post-metadata">

**Author:** ![Balazs](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/balazs/32/493129_2.png) [@Balazs](https://discourse.mcneel.com/u/Balazs)\
**Post date:** [December 6, 2020, 2:34pm UTC](https://discourse.mcneel.com/t/baking-objects-with-groups/113892/6 "2020-12-06T14:34:43Z")

</div>

I am trying to use your [mMaterial\_bake\_to\_layer\_2020Jan30a.gh](https://discourse.mcneel.com/uploads/short-url/y7Oqz7ADCwfvRIuaZkxLio55ltj.gh) example. Alas the generated cones are colorless.

 ![bake no colors](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/d/f/8/df8b01687d464156d07874e54f26bb177729fb13.jpeg)

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [December 6, 2020, 2:39pm UTC](https://discourse.mcneel.com/t/baking-objects-with-groups/113892/7 "2020-12-06T14:39:34Z")

</div>

Colors are only visible in ‘Rendered’ mode, not ‘Shaded’ mode. Works for me.

![mMaterial_bake_to_layer_2020Dec6a22](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/b/e/1/be1ec0ae9ba71beecd4863f913c7af76cc890e9a.jpeg)

What is the error message on the red Output component?

**P.S.** Wait a second, there is no Output component in **mMaterial\_bake\_to\_layer\_2020Jan30a** , only in **STEP1\_mMaterial\_bake\_to\_layer\_2020Jan30a.gh**. It should work either way. Please be accurate.

---

<div class="post-metadata">

**Author:** ![Balazs](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/balazs/32/493129_2.png) [@Balazs](https://discourse.mcneel.com/u/Balazs)\
**Post date:** [December 6, 2020, 3:41pm UTC](https://discourse.mcneel.com/t/baking-objects-with-groups/113892/8 "2020-12-06T15:41:44Z")

</div>

Joseph, Thanks for you help. Actually in my version 5 script I could generate objects colors which worked in shaded mode. See attached image. Is it possible with your script? Usually I dont work in rendered mode if not really necessary to save computing power.

 ![color in shaded mode](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/d/9/7/d97a59c18f3d8363860e0aebb6c95d33c99d8012.jpeg)

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [December 6, 2020, 3:58pm UTC](https://discourse.mcneel.com/t/baking-objects-with-groups/113892/9 "2020-12-06T15:58:45Z")

</div>

The color _(and other material properties)_ you see in shaded mode is a “preview color” that will disappear when you close the GH file or move the baked geometry away from the GH preview. The image I posted above is ‘Rendered’ mode showing baked geometry with the GH file closed.

Start with a new empty Rhino file and look at the Layers panel when you click ‘Bake’. You will see materials being assigned to each of the new named layers. My old laptop running R5 is broken so I can’t verify what happens in R5 anymore but there is nothing about this that is unique to my Python bake component, the same things would be true if you baked objects and assigned materials to layers the old manual way _(one at a time)_ .

I don’t know what more to say. The thread I referred you to discusses all the issues extensively.

---

<div class="post-metadata">

**Author:** ![Balazs](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/balazs/32/493129_2.png) [@Balazs](https://discourse.mcneel.com/u/Balazs)\
**Post date:** [December 6, 2020, 4:47pm UTC](https://discourse.mcneel.com/t/baking-objects-with-groups/113892/10 "2020-12-06T16:47:22Z")

</div>

I dont understand. The color does not disappear in shaded mode without Grasshopper. Here is the file. [color.3dm](https://discourse.mcneel.com/uploads/short-url/qUdXn82N6V6WKTkG01iHmUS1AEn.3dm) (112.2 KB)

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [December 6, 2020, 5:05pm UTC](https://discourse.mcneel.com/t/baking-objects-with-groups/113892/11 "2020-12-06T17:05:22Z")

</div>

In R6 Shaded mode I see your blue box:

 ![mMaterial_bake_to_layer_2020Dec6a3](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/6/d/5/6d57b054c78270853d63bfe8602261daf18f8394.png)

It’s blue because you’ve set the box’s ‘Display Color Property’ to ‘Other’ instead of the default ‘By Layer’. That might be equivalent to the ‘Material Source’ _(; **mSrc** )_ input of my Bake component but there is this line 18 in the Python that limits possible values:

` if (mSrc < 0) or (mSrc > 3): mSrc = 0 #must be 0=layer, 1=object or 2=parent`

I’m not going to dig any deeper into this. Every moment I spent writing it in the first place was painful. Sorry if it doesn’t work for you, others have found it useful. Good luck.

**P.S.** Preview colors appear very different _(dull)_ in your R5 file than what I see in a new R6 Rhino file.

---

<div class="post-metadata">

**Author:** ![Balazs](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/balazs/32/493129_2.png) [@Balazs](https://discourse.mcneel.com/u/Balazs)\
**Post date:** [December 6, 2020, 5:13pm UTC](https://discourse.mcneel.com/t/baking-objects-with-groups/113892/12 "2020-12-06T17:13:11Z")

</div>

Thanks anyway. I am not a programmer. I am just an architect.

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [December 6, 2020, 5:19pm UTC](https://discourse.mcneel.com/t/baking-objects-with-groups/113892/13 "2020-12-06T17:19:28Z")

</div>

> [@Balazs](#):
>
> I am not a programmer. I am just an architect.

Neither of us should have to mess with programming this at all, the capability ought be built into standard GH - many years ago!
