Returns or modifies a material's texture bitmap filename.
rhinoscriptsyntax.MaterialTexture (material_index, filename=None)
rhinoscript.material.MaterialTexture (material_index, filename=None)
material_index |
Required. Number. The zero-based source material index. |
filename |
Optional. String. The texture bitmap filename. |
String |
If filename is not specified, the current texture bitmap filename if successful. |
String |
If filename is specified, the previous texture bitmap filename if successful. |
None |
It not successful, or on error. |
import rhinoscriptsyntax as rs
obj = rs.GetObject("Select object")
if obj:
index = rs.ObjectMaterialIndex(obj)
if index>-1:
rs.MaterialTexture( index, "C:\\Users\\Steve\\Desktop\\textureimage.png" )