DeleteUnusedImageSources

導入

v2.0

詳細

シーン内で使用されていないすべてのイメージ ソースを削除します。 イメージ ソースが使用されていない場合には、ソース名の横に「(Not Used)」と表示されます。

このコマンドはシーンのクリーン アップに使用できます。

スクリプト構文

DeleteUnusedImageSources();

VBScript の例

' 

' This example demonstrates how DeleteUnusedImageSources works by connecting

' an image clip to a cylinder (so it's protected from DeleteUnusedImageSources).

' Then it deletes the image clip (so it's unused) and then runs the

' DeleteUnusedImageSources command again, which removes the image clip and its

' source from the scene.

'

' Tip: To see the difference between running DeleteUnusedImageSources before

' deleting the clip and after, first run the example up to the PART TWO

' comment. Then run the rest of the example to see the difference.

'

' PART ONE

NewScene , false

CreatePrim "Cylinder", "MeshSurface"

' 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" )

SIConnectShaderToCnxPoint oClipObj, "Sources.Materials.DefaultLib.Scene_Material.Phong.ambient"

' Running this will have no effect

DeleteUnusedImageSources

' PART TWO

' Now delete the image clip, so the source will become un-used.

DeleteObj "Clips.XSIlogo_Clip"

' Running this will remove the image source since it un-used now.

DeleteUnusedImageSources

関連項目

DeleteUnusedImageClips