Some aspects of using textures have not been implemented in the object model yet. For that reason, the only example in this section concerns using both the object model and the native Softimage commands in the same code.
This code demonstrates how to create a cube and add a UV texture support to it so that it can print the coordinates for the texture UV points:
Set oRoot = Application.ActiveProject.ActiveScene.Root Set oObject = oRoot.AddGeometry( "Cube", "MeshSurface" ) BlendInPresets "Image", oObject, 1, False CreateTextureSupport oObject, siTxtUV, siTxtDefaultSpherical, "Texture_Support" Set oUVWProp = oObject.Material.CurrentUV ' Output uv text coords aUVW = oUVWProp.Elements.Array For iIndex = 0 to oUVWProp.elements.count-1 LogMessage "UV(" & aUVW(0,iIndex) & "," & aUVW(1,iIndex) & ")" Next
Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License