algorithmic modeling for Rhino
Hey guys,
I am trying to write a script which changes an objects material color. Then when the object is baked into rhino, the material will retain this color, so it shows up when I render the object.
Here is my script:
Private Sub RunScript(ByVal Geom As List(Of System.Object), ByVal Color As List(Of Color), ByVal Activate As Boolean, ByRef A As Object)
If (Activate)
For i As int32=0 To Geom.Count() - 1
Dim att As Rhino.DocObjects.ObjectAttributes = New Rhino.DocObjects.ObjectAttributes()
Dim mTemp As Rhino.DocObjects.Material
mTemp.DiffuseColor = color(i)
doc.Materials.Add(mtemp)
att.MaterialSource = Rhino.DocObjects.ObjectMaterialSource.MaterialFromObject
doc.Objects.AddSurface(Geom(i), att)
Next
End If
a = geom
Any help will be greatly appreciated.
Thanks
Tags:
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2025 Created by Scott Davidson.
Powered by