hi all
coming back to old topics, of baking colors into curves.
i tried old forum's baking script, from damien_alomar, which is working fine for curves and breps..but.
i wonder how to set the color not to the material but rather to the object itself, to the curve itself.
thx
Sub RunScript(ByVal blnBake As Boolean, ByVal material As Object, ByVal obj As OnCurve)
If blnBake Then
'Bake Object
Dim mC As New MRhinoCurveObject
mC = doc.AddCurveObject(obj)
'Set Material
Dim att As New MRhinoObjectAttributes(mC.Attributes())
att.setmaterialsource(1)
att.m_material_index = doc.m_material_table.AddMaterial(material)
'Modify the attributes
Dim objref As New MRhinoObjRef(mC.Attributes.m_uuid)
doc.ModifyObjectAttributes(objref, att)
End If
End Sub
Tags: