BlendClipsInTextureLayersWithPortsInsp

Introduced

4.0

Description

Creates and returns layers with the requested clips, and adds the provided ports to the layers.

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

Note: This command is the same as BlendClipsInTextureLayersWithPorts except that it also inspects the newly created shaders.

Scripting Syntax

BlendClipsInTextureLayersWithPortsInsp( ClipList, [InputObjs] )

Parameters

Parameter

Type

Description

ClipList

String

List of clips to connect

InputObjs

String

List of shader connections to add the layers to.

Default Value: Current selection

Return Value

Returns the layers created as an XSICollection.

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, inspect the result
Dim result, item
set result = BlendClipsInTextureLayersWithPortsInsp(oClipObj, oBox.material & ".Phong.diffuse")
for each item in result
   logmessage "Added layer " & item
next 

' Blending in a source automatically creates a clip
set result = BlendClipsInTextureLayersWithPorts(oSourceObj, oBox.material & ".Phong.ambient")
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 XSI logos shifted relative to each other.
' If you open up the texture layer editor or rendertree on the cube, you will see two layers,
' one bleneded into the ambient port and one into the diffuse port.

' Output from this script:
'INFO : "Added layer Sources.DefaultLib.Material.Phong.XSIlogo_Clip_Layer"
'INFO : "Added layer Sources.DefaultLib.Material.Phong.XSIlogo_Layer"
'---------------------------------------------------------

See Also

BlendClipsInTextureLayers

BlendClipsInTextureLayersInsp

BlendClipsInTextureLayersWithPorts

BlendInTextureLayers

BlendInTextureLayersInsp

BlendInTextureLayersWithPorts

 

 



SOFTIMAGE|XSI v6.01     

Return to Softimage XSI Index