Damien, Visose...great stuff...... to do both:
If blnBake Then 'Bake Object Dim mObj As New MRhinoBrepObject mObj = doc.AddBrepObject(obj) 'Set Material Dim att As New MRhinoObjectAttributes(mObj.Attributes()) att.setmaterialsource(1) att.m_material_index = doc.m_material_table.AddMaterial (material) 'Modify the attributes Dim objref As New MRhinoObjRef(mObj.Attributes.m_uuid) doc.ModifyObjectAttributes(objref, att) Dim att2 As New MRhinoObjectAttributes(mObj.Attributes()) att2.SetColorSource(1) 'set color source to From Object Dim rColor As New OnColor (color) 'make OnColor att2.m_color = rColor 'Set Object Color doc.ModifyObjectAttributes(objref, att2) End If -This works with my tossed together knowledge of vb.net/rhino sdk (is there a cleaner way?... To color curves would it work by changing the MRhinoBrepObject to its curve correspondent? I have not tried, just wondering coneptually... Luis On Apr 13, 8:36 pm, Pablo Morales <olba...@gmail.com> wrote: > and i can't open the file with grasshopper can you upload a image of the > grasshopper view please > > Thanks, Pablo Morales > > On Mon, Apr 13, 2009 at 8:11 PM, Pablo Morales <olba...@gmail.com> wrote: > > hi, my version of grasshopper is 0.5.0099 > > > On Mon, Apr 13, 2009 at 7:41 PM, visose <vic...@gmail.com> wrote: > > >> I modified the above script to actually bake the material for > >> rendering purposes. You need to add an input called 'material' and > >> connect it to the shader. > > >> If blnBake Then > > >> 'Bake Object > >> Dim mObj As New MRhinoBrepObject > >> mObj = doc.AddBrepObject(obj) > > >> 'Set Material > >> Dim att As New MRhinoObjectAttributes(mObj.Attributes()) > >> att.setmaterialsource(1) > >> att.m_material_index = doc.m_material_table.AddMaterial > >> (material) > > >> 'Modify the attributes > >> Dim objref As New MRhinoObjRef(mObj.Attributes.m_uuid) > >> doc.ModifyObjectAttributes(objref, att) > > >> End If > > >> Damien, in relation to my problem about baking vertex colors. At least > >> i can render something using this method and lots sub-surfaces (one > >> per texel). It will be ridiculously inefficient though :P > > >> On Apr 13, 4:01 pm, damien_alomar <dominos...@gmail.com> wrote: > >> > Some one asked this a little while ago, so I cooked up a custom > >> > definition for it. > > >> >http://grasshopper3d.googlegroups.com/web/bakeWcolor.ghx?hl=en&gda=Bx. > >> .. > > >> > -Damien > > >> > On Apr 12, 11:07 am, Pablo Morales <olba...@gmail.com> wrote: > > >> > > hi, > >> > > Is posible to conserve the colour of grasshopper when i bake? I mean > >> is > >> > > posible to render the colours of grasshopper in Rhino? > > >> > > Thanks