SIAddImageClip

導入

v1.0

カテゴリ

ファイル テクスチャ

詳細

イメージ ソースからクリップ コンテナに新しいイメージ クリップを作成、追加します。 このコマンドを実行するには、Sources コンテナにイメージ ソースが存在しなければなりません。 イメージは、AddImageSourceコマンドで作成できます。 このコマンドは、構文と動作がAddImageClipコマンドと似ていますが、関数から値を直接戻さずにパラメータから値を戻す点が異なります。

注: このコマンドは、出力引数を使用します。 C# および一部のスクリプト言語(JScript、PerlScript、Python など)は、リファレンスによって渡される引数をサポートしていません。このため、状況に応じた適切な回避策を実行する必要があります。

スクリプト言語の場合、このコマンドは出力引数を取得するために使用できる ISIVTCollection を戻します。

C# の場合は、XSIApplication.ExecuteCommand メソッドを使用してこのコマンドを呼び出すことができます。 ExecuteCommand は、出力引数を C# の System.Object (出力引数の配列を含む)にパック化します(詳細については、「C# からのコマンドの呼び出し」を参照)。

スクリプト構文

SIAddImageClip( Source, [Name], [Clip] );

パラメータ

パラメータ タイプ 詳細
Source 文字列 クリップの作成に使用するソース
Name 文字列 新しいクリップに付ける名前
Clip ImageClip 新しいクリップを戻します。

1. VBScript の例

'
' This example shows how to add an image clip from an image source.
'
option explicit
' First, add an image source.
Dim oSourceObj, ImageFile
ImageFile = XSIUtils.BuildPath( _
        Application.InstallationPath( siProjectPath ), _
        "Pictures", "xsilogo.jpg" _
)
SIAddImageSource ImageFile, "XSIlogo", oSourceObj
' Now create an image clip from the image source.
Dim oClipObj 
SIAddImageClip oSourceObj, "XSIlogo_Clip", oClipObj
' Now output some information about the clip, and its source.
Dim SourceName, SourceFile, XRes, YRes
SourceName = GetValue( oClipObj & ".Source.Name" )
Application.LogMessage oClipObj & " Source       : " & CStr(SourceName)
SourceFile = GetValue( oClipObj & ".SourceFileName" )
Application.LogMessage oClipObj & " Source File  : " & CStr(SourceFile)
XRes = GetValue( "Sources." & SourceName & ".XRes" )
Application.LogMessage oClipObj & " X Resolution : " & CInt(XRes)
YRes = GetValue( "Sources." & SourceName & ".YRes" )
Application.LogMessage oClipObj & " Y Resolution : " & CInt(YRes)
' Expected results:
'INFO : "Clips.XSIlogo_Clip Source       : XSIlogo"
'INFO : "Clips.XSIlogo_Clip Source File  : <ProjectPath>\Pictures\xsilogo.jpg"
'INFO : "Clips.XSIlogo_Clip X Resolution : 500"
'INFO : "Clips.XSIlogo_Clip Y Resolution : 513"

2. VBScript の例

'
' This example demonstrates how to create an image source. The user 
' will be prompted to select an image source.  Select the directory 
' <$XSI_HOME\Data\XSI_SAMPLES\Pictures\sprites>, and select
' the sequence <seq.[0..9;1].tga>.  Then, click OK.
'
NewScene , false
dim oSrc
set oSrc = AddImageSource( , "SourceImageExample" )
' Create and add a image clip, using the previous image source
SIAddImageClip oSrc, "ImgClipExample"

関連項目

AddImageClip CreateImageClip AddImageSource SIAddImageSource