Description
Creates a new texture projection and support, if appropriate, on the given object. Texture projection helps editing a 2D texture by precisely controlling every part of the 2D texturing pipeline.
Note: This command uses output arguments. Some scripting languages don't support arguments passed by reference (such as JScript and Python). For more information on how to handle getting output arguments through a return-value array, see Output Arguments, Return Values and Output Value Arrays.
Scripting Syntax
CreateProjection( [InputObjs], [Type], [UVDefaultType], [SupportName], [PropertyName], [Parenting], [Fitting], [Camera] )
Parameters
|
Parameter |
Type |
Description |
|
InputObjs |
List of objects to which the texture support is applied. Default Value: Selected objects |
|
|
Type [in/out] |
Projection type Default Value: siTxtPlanarXY |
|
|
UVDefaultType [in/out] |
Default projection type for mesh objects. Default Value: siTxtDefaultSpherical |
|
|
SupportName [in/out] |
Name for the texture support object, if appropriate. Returns the actual name. Default Value: Texture_Support |
|
|
PropertyName [in/out] |
Name for the texture projection name. Returns the actual name. Default Value: Texture_Projection |
|
|
Parenting [in/out] |
True to parent the texture support to the objects. Default Value: True |
|
|
Fitting [in/out] |
Method to use to fit the new texture support on the objects (only relevant for planar, cylindrical, spherical and lollipop). Default Value: siRelObject |
|
|
Camera [in/out] |
Camera to use if Type is siTxtCamera. Default Value: Starts a pick session |
Examples
VBScript Example
' Create a sphere, assign default image to scene's material: oSphere = CreatePrim( "Sphere", "MeshSurface" ) SIApplyShaderToCnxPoint "Image", "Sources.Materials.DefaultLib.Scene_Material.Phong.diffuse" ' Create the Texture projection: dim sSupportName, sPropertyName sSupportName = "NewSupport" sPropertyName = "NewProjection" CreateProjection oSphere, siTxtPlanarXY, siTxtDefaultPlanarXY, sSupportName, sPropertyName, True LogMessage "Texture support created: " & sSupportName LogMessage "Texture projection created: " & sPropertyName ' View the results: SetDisplayMode "Camera", "textured" ' Running this script should log the following: ' --------------------------------------------- 'INFO : "Texture support created: NewSupport" 'INFO : "Texture projection created: NewProjection"
See Also
SOFTIMAGE|XSI v6.01