What method can I use to apply a JPG image to a surface (Python)?
public static Rhino.Commands.Result AddMaterial(Rhino.RhinoDoc doc)
{
// materials are stored in the document's material table
var mat = new Material();
mat.DiffuseColor = System.Drawing.Color.Chocolate;
mat.SpecularColor = System.Drawing.Color.CadetBlue;
var texture = new Texture();
texture.FileName = "my_image.jpg";
mat.SetTexture(texture, TextureType.Bitmap);
var rm = RenderMaterial.CreateBasicMaterial(mat, doc);
doc.RenderMaterials.Add(rm);
// set up object attributes to say they use a specific material
Rhino.Geometry.Sphere sp = new Rhino.Geometry.Sphere(Rhino.Geometry.Plane.WorldXY, 5);
var id = doc.Objects.AddSphere(sp);
var rhinoObject = doc.Objects.Find(id);
rhinoObject.RenderMaterial = rm;
rhinoObject.CommitChanges();
doc.Views.Redraw();
return Rhino.Commands.Result.Success;
}