## CreateSubprojection

### Description

Creates a subprojection on an existing UV property. Use this command to reproject portions of an object. Portions of the object not included in the input object list will not be affected.
Subprojections simplify the texturing process by allowing you to apply a planar, spherical, or cylindrical projection to a selection of sample points in an existing texture projection. The sample points are reprojected onto the current texture, leaving you with a single set of UV coordinates to manage.
You could use this command to texture a human body. For example, if the body already has a planar projection on it, you could perform a cylindrical subprojection on the arm. The UVs on the rest of the object will be unchanged.
Note: This command uses output arguments. C# and some scripting languages (such as JScript, PerlScript and Python) don't support arguments passed by reference so you need to use the best workaround for your situation:
For scripting languages this command returns an ISIVTCollection which you can use to get the output arguments.
For C# you can use the XSIApplication.ExecuteCommand method to call this command. ExecuteCommand packs the output arguments into a C# System.Object containing an Array of the output arguments (see Calling Commands from C#).

### Scripting Syntax

    CreateSubprojection( InputObjs, TextureProjection, [Type], [Plane], [SupportName], [Parenting], [Fitting], [FitToImage], [MaintainAspect], [TextureAspectRatio], [3DObjTexture] );

### Parameters

Parameter | Type | Description
--- | --- | ---
InputObjs | String | List of objects to which the texture support is applied. Default Value: Selected objects
TextureProjection | String | Texture projection to modify.
Type | siTxtProjType | Projection type Default Value: siTxtPlanar
Plane | siTxtProjPlane | Projection plane Default Value: siPlaneXY
SupportName | String | Name for the texture support object. Default Value: Texture_Support
Parenting | Boolean | True to parent the texture support to the objects. Default Value: True
Fitting | siTxtProjFitMethod | Fitting Method Default Value: siRelBestFit
FitToImage | Boolean | If true, modify the uvs after projecting to fit the image. Default Value: False
MaintainAspect | Boolean | If true, correct for aspect ratio distortion caused by the projection and/or the image aspect ratio. Default Value: False
TextureAspectRatio | Double | The aspect ratio (x resolution/y resolution) of the image for which the UVs are being used. If specified (see MaintainAspect), the command performs a scaling to compensate for the aspect ratio. Default Value: 1.0
3DObjTexture | X3DObject | Returns the new texture projection. Default Value: False

### Examples

#### VBScript Example

    CreatePrim "Sphere", "MeshSurface"

    SetValue "sphere.polymsh.geom.subdivu,sphere.polymsh.geom.subdivv", Array(16,16)

    ApplyShader , , , , siLetLocalMaterialsOverlap

    SIApplyShaderToCnxPoint "Image", "sphere.Material.Phong.diffuse"

    CreateProjection "sphere", siTxtSpherical, siTxtDefaultSpherical, "Texture_Support", "Texture_Projection"

    SetInstanceDataValue , "sphere.Material.Phong.Image.tspace_id", "Texture_Projection"

    SetDisplayMode "Camera", "texturedecal"

    ActivateRaycastPolySelTool

    SelectGeometryComponents "sphere.poly[57,58,73,74]"

    CreateSubprojection "sphere.sample[221-228,283-290]", "sphere.polymsh.cls.Texture_Coordinates_AUTO.Texture_Projection", siTxtPlanar, siPlaneXY, , True, siRelBestFit

### See Also

CreateProjection FitSubcomponentUVsToImage