Grasshopper

algorithmic modeling for Rhino

Hi everyone.  So i've run into a probelm when baking lines which have been given a shader into rhino.  Attached is the example of the GH output in rhino and when I go to bake the final step it always bakes to the layer color.  Ive downloaded and used the Studio Mode- Mode tool which has a bake color and bake material component.  The bake material componet allows the lines to bake into rhino but the colors are lost.  The colors of the lines are vital to the success of this project.  Your help is appreciated as always. 

 

Evan

GSAPP

Views: 2684

Attachments:

Replies to This Discussion

I don't have studio mode tools but it seems you are baking the object with a custom material and not a custom object color.

Nevertheless, it's pretty easy to make a vb.net component to bake curves with colors. Add a vb.net component to the canvas, connect the list of curves to the x input and the list of colors to the y input, double click on it and paste this code:

Dim att As New docobjects.ObjectAttributes
att.ColorSource = Rhino.DocObjects.ObjectColorSource.ColorFromObject
att.ObjectColor = y
doc.Objects.Addcurve(x, att)
owner.Locked = True

The code also disables the component so it only runs on demand (to avoid baking curves every time the definition updates). So to run it you have to right click on it and select "enable".
I think this is better than the boolean toggle that creates some anxiety having to remember to turn it off every time the code runs.
High!
do you have an idea how to get the lines also on a different layer? For example current layer + index...
hi Armin!

here you will find a c# custom script to bake geometry on specify layer with specify colour...

http://www.grasshopper3d.com/forum/topics/bake-color-gradient

best
[u

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service