BlendClipsInTextureLayersInsp

Introduced

v4.0

Description

Locates all the default texture connection points on the immediate shaders attached to the given objects. Blends the provided clips with any existing shaders on the located connection points.

If a source is provided, a clip is automatically created and connected.

Same as BlendClipsInTextureLayers except that it also inspects the newly created shaders.

Scripting Syntax

oReturn = BlendClipsInTextureLayersInsp( [ClipList], [InputObjs], [SharedMatAction], [NotifyNoResult], [Mode], [Ambient], [Diffuse], [Transparency], [Reflection] );

Return Value

Returns the layers created as an XSICollection. If Mode = siReplaceNoBlend, the first shader created is returned as a shader rather than a layer.

Parameters

Parameter Type Description
ClipList String List of clips to connect
InputObjs String List of objects to search for default texture connection points

Default Value: Current selection

SharedMatAction Integer Make shared materials local? Note: If "Beginner user" is used, the user's choice (0=No or 1=Yes) will be logged in the script window, rather than "2". When the logged command is replayed, the command will automatically answer yes or no. If "Advanced user" is used, it is logged as advanced user, and hence will pop up a dialog when replayed.

Default Value: 2 (Ask Beginner User)

Possible Values:

Description:

0 No
1 Yes
2 Ask beginner user
3 Ask advanced user
NotifyNoResult Boolean True to notify user if no presets created.

Default Value: False (no notification)

Mode siBlendInTextureLayersModes Method for blending in the new presets

Default Value: siBlendInTextureLayers (no replacement)

Ambient Boolean If true, blend in to the ambient port (if present)

Default Value: True (apply to ambient)

Diffuse Boolean If true, blend in to the diffuse port (if present)

Default Value: True (apply to diffuse)

Transparency Boolean If true, blend in to the transparency port (if present)

Default Value: false (don't apply to transparency)

Reflection Boolean If true, blend in to the reflection port (if present)

Default Value: false (don't apply to reflection)

Examples

VBScript Example

NewScene , false

' Create a default cube, add a texture projection and apply a default Phong shader:

Dim oBox

Set oBox = ActiveSceneRoot.AddGeometry( "Cube", "MeshSurface" )

CreateProjection oBox, , siTxtDefaultPlanarXY, , "Texture_Projection"

ApplyShader , oBox

' Apply a second projection, offset it

CreateProjection oBox, , siTxtDefaultPlanarXY, , "Texture_Projection"

Translate "Texture_Support1", 3.32038834951456, -4.87670131554974E-17, 0.796452068099767, siRelative, siView, siObj, siXYZ

Translate "Texture_Support1", -0.529657563043749, -2.59749993985792, 0.259749993985792, siRelative, siView, siObj, siXYZ

' First, add an image source.

Dim oSourceObj, ImageFile

ImageFile = Application.InstallationPath( siFactoryPath ) & "/Data/XSI_SAMPLES/Pictures/xsilogo.jpg"

SIAddImageSource ImageFile, "XSIlogo", oSourceObj

' Now create an image clip from the image source.

Dim oClipObj 

set oClipObj = AddImageClip( oSourceObj, "XSIlogo_Clip" )

' Blend in the clip, and inspect the image shader created to read the clip

Dim result, item

set result = BlendClipsInTextureLayersInsp(oClipObj, oBox)

for each item in result

	logmessage "Added layer " & item

next 

' Blending in a source automatically creates a clip

set result = BlendClipsInTextureLayers(oSourceObj, oBox)

for each item in result

	logmessage "Added layer " & item

next

' Change the blending mode of the newly added layer

SetValue result(0) & ".mode", 4

' Change the texture projection

Dim shader

set shader = SIGetShaderOnCnxPoint( result(0) & ".color" )

SetInstanceDataValue , shader & ".tspace_id", "Texture_Projection1"

'---------------------------------------------------------

' If you draw a region, you should see two Softimage logos shifted relative to each other

' If you open up the texture layer editor or rendertree on the cube, you will see two layers.

' Output from this script:

'INFO : "Added layer Sources.DefaultLib.Material.Phong.Image_Layer"

'INFO : "Added layer Sources.DefaultLib.Material.Phong.Image1_Layer"

'---------------------------------------------------------

See Also

BlendClipsInTextureLayers BlendClipsInTextureLayersWithPorts BlendClipsInTextureLayersWithPortsInsp BlendInTextureLayers BlendInTextureLayersWithPorts BlendInTextureLayersWithPortsInsp SIConnectShaderToCnxPoint