## ImageClip

Object Hierarchy | Related C++ Class: ImageClip2

### Inheritance

###

SIObject

ProjectItem

Clip

ImageClip

### Introduced

v2.0

### Description

The ImageClip object represents an instance of an Image Source, which in turn is a reference to an image stored on disk. ImageClips and Image Sources are used as a means of introducing images into FxTrees, or as textures influencing Shaders. Image clips are created by calling AddImageClip or CreateImageClip.
Important information such as the File path and resolution are stored as Parameters of the Image Source, which can be retrieved by calling Clip.Source. You can read the pixel values of the image by calling ImageClip.GetImage.

### Methods

AddCustomOp | AddICEAttribute | AddProperty | AddProperty2
AddScriptedOp | AddScriptedOpFromFile | AnimatedParameters2 | BelongsTo
EvaluateAt | GetFileName | GetICEAttributeFromName | GetImage
GetScaledDownImage | GetShaderParameterTargets | IsA | IsAnimated2
IsClassOf | IsEqualTo | IsKindOf | IsLocked
IsSelected | LockOwners | RemoveICEAttribute | SetAsSelected
SetCapabilityFlag | SetLock | TaggedParameters | UnSetLock

### Properties

Application | BranchFlag | Capabilities | Categories
Effect | EvaluationID | Families | FullName
Help | HierarchicalEvaluationID | ICEAttributes | LockLevel
LockMasters | LockType | MappedItems | Model
Name | NestedObjects | ObjectID | Origin
OriginPath | Owners | PPGLayout | Parameters
Parent | Parent3DObject | Properties | Relations
Selected | Source | TimeControl | Type

### Examples

#### 1. VBScript Example

    '

    ' This example illustrates how to create an ImageClip object and connect it

    ' as the source of an image texture.

    '

    NewScene , false

    set oImage = AddImageSource( "$SI_HOME\Data\XSI_SAMPLES\Pictures\jio.jpg" )

    set oImageClip = AddImageClip( oImage )

    set oSphere = ActiveSceneRoot.AddGeometry( "Sphere", "MeshSurface" )

    set oMaterial = oSphere.AddMaterial("Phong")

    set oPhong = oMaterial.Shaders( "Phong" )

    set oColor8Mix1 = oPhong.ambient.ConnectFromProgID("Softimage.sib_color_8mix.1")

    set oColor8Mix2 = oPhong.diffuse.ConnectFromProgID("Softimage.sib_color_8mix.1")

    set oTex2D = oColor8Mix1.color1.ConnectFromProgID("Softimage.txt2d-image-explicit.1")

    call oColor8Mix2.color1.Connect(oTex2D)

    set oTex2D.tex.Source = oImageClip

#### 2. JScript Example

    /*

    	This example illustrates how to retrieve the image file name used for the texture of

    	an object. It also illustrates how to retrieve the x and y resolution of that image.

    */

    var oCube = CreatePrim("Cube", "MeshSurface", null, null);

    ApplyShader(null, null, null, siUnspecified, siLetLocalMaterialsOverlap);

    CreateProjection("cube", siTxtSpherical, siTxtDefaultSpherical, "",

    			"Texture_Projection", null, siRelDefault, "");

    BlendInPresetsInsp(null, null, null, true, siReplaceAndBlendInPreset, null, null, null, null);

    var oImageClip = oCube.Material.CurrentImageClip;

    var oImageSource = oImageClip.Source;

    LogMessage("The image filename is " + oImageSource.Parameters("FileName").Value);

    LogMessage("The image x resolution is " + oImageSource.Parameters("XRes").Value);

    LogMessage("The image y resolution is " + oImageSource.Parameters("YRes").Value);

    // Expected result:

    //INFO : "The image filename is <$factory>\Application\rsrc\noIcon.pic"

    //INFO : "The image x resolution is 256"

    //INFO : "The image y resolution is 256"

### See Also

Image AddImageClip CreateImageClip ExportImageClip FxTree.AddImageClipOperator Scene.DefaultImageClip