## CreateProjection

### 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 | String | List of objects to which the texture support is applied. Default Value: Selected objects
Type | siTxtCreationType | Projection type Default Value: siTxtPlanarXY
UVDefaultType | siTxtDefaultCreationType | Default projection type for mesh objects. Default Value: siTxtDefaultSpherical
SupportName | String | Name for the texture support object, if appropriate. Returns the actual name. Default Value: Texture_Support
PropertyName | String | Name for the texture projection name. Returns the actual name. Default Value: Texture_Projection
Parenting | Boolean | True to parent the texture support to the objects. Default Value: True
Fitting | siTxtProjFitMethod | Method to use to fit the new texture support on the objects (only relevant for planar, cylindrical, spherical and lollipop). Default Value: siRelObject
Camera | String | 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

ConnectToSupport ConnectToProjection CreateSubprojection