Specific Shader object which is a member of the Texture Shaders family (siTextureShaderFamily).
using namespace XSI; Application app; Model root = app.GetActiveSceneRoot(); X3DObject myCube; root.AddGeometry( L"Cube",L"MeshSurface",L"" ,myCube ); Material myMaterial; myCube.AddMaterial(L"Phong",false,L"",myMaterial); // Adding an image CValueArray args(4L); CValue outArg; args[0] = CValue( CString(L"Image") ); args[1] = CValue(myCube.GetRef()); args[2] = CValue((short)1); args[3] = CValue(false); app.ExecuteCommand( L"BlendInPresets", args, outArg ); // Adding a texture support args[0] = myCube.GetRef(); args[1] = (LONG)siTxtPlanarXY; args[2] = (LONG)siTxtDefaultSpherical; args[3] = CString(L"Texture_Support"); app.ExecuteCommand( L"CreateTextureSupport", args, outArg ); Texture myTexture= myMaterial.GetCurrentTexture(); app.LogMessage( L"The texture: " + myTexture.GetFullName() );
#include <xsi_texture.h>
Public Member Functions | |
Texture () | |
~Texture () | |
Texture (const CRef &in_ref) | |
Texture (const Texture &in_obj) | |
bool | IsA (siClassID in_ClassID) const |
siClassID | GetClassID () const |
Texture & | operator= (const Texture &in_obj) |
Texture & | operator= (const CRef &in_ref) |
CStatus | GetTransformValues (LONG in_flags, CDoubleArray &out_aUVWValues) |
ImageClip2 | GetImageClip () const |
Texture | ( | ) |
Default constructor.
~Texture | ( | ) |
Default destructor.
bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
Returns true if a given class type is compatible with this API class.
in_ClassID | class type. |
Reimplemented from Shader.
siClassID GetClassID | ( | ) | const [virtual] |
Creates an object from another object. The newly created object is set to empty if the input object is not compatible.
in_obj | constant class object. |
CStatus GetTransformValues | ( | LONG | in_flags, |
CDoubleArray & | out_aUVWValues | ||
) |
Calculates the UVW values. The values are read from cluster properties, and the following texture objects are used in the calculation:
You can specify the texture transformation effects you want to apply using bit flags. Note that some texture transformation effects will only be approximate, such as in the case of creating texture repeats where this method cannot resample the surface to create the additional sample points required.
in_flags | bit flags to specify which transformations to apply to the UVW cluster property content. The bit flags values are the ones located in the siTextureEffectsComputation enum. |
out_aUVWValues | array containing the UVW. This array is in the same order as the cluster property. |
ImageClip2 GetImageClip | ( | ) | const |
Returns the image clip bound to this texture.