Public Member Functions
SIObject Class Reference

Detailed Description

SIObject derives from CBase and acts as the base class for the Softimage Object Model library. Unlike CBase, this class provides some high-level services such as object naming. It also provides accessors to the object parent and to the Application object.

See also:
Application
Example:
Converting between SIObject and CRef
        using namespace XSI;

        Application app;

        SIObject siObj(app);
        CString strName(L"MyName");
        siObj.PutName( strName );
        app.LogMessage( CValue(siObj.GetFullName() == strName).GetAsText() );
        app.LogMessage( CValue(siObj.GetName() == strName).GetAsText() );
        app.LogMessage( CValue(siObj.GetUniqueName() == strName).GetAsText() );
        app.LogMessage( CValue(siObj.GetType() == strName).GetAsText() );

        SIObject siObjCopy(siObj);
        app.LogMessage( CValue(siObj.IsEqualTo(siObjCopy)).GetAsText() );

        CRef refParent = siObj.GetParent();

        Command cmd;
        SIObject siObjCmd(cmd);
        SIObject siObjCmd2(siObjCmd);
        siObjCmd2.IsEqualTo(siObjCmd);

        SIObject siObjApp(app);
        CRef ref(siObjApp.GetRef());
        SIObject siObjFromRef(ref);
        siObjFromRef.IsEqualTo(ref);

#include <xsi_siobject.h>

Inherits CBase.

Inherited by ActionDelta, ActionDeltaItem, AnimationSource, AnimationSourceItem, Application, Argument, ArgumentHandler, CKnotArray, ClipEffect, ClipEffectItem, Command, ConstructionHistory, Desktop, Dictionary, EventInfo, Facet, Factory, FCurveKey, FileReference, Filter, Geometry, GraphicDriver, HardwareSurface, ICEAttribute, ICENodePort, MappedItem, MetaShaderRendererDef, NurbsCurve, Parameter, Particle, ParticleAttribute, Plugin, PluginItem, PluginRegistrar, Point, Port, PortGroup, Preferences, Project, ProjectItem, RenderChannel, Renderer, Sample, Segment, ShaderballOptions, ShaderDef, ShaderParamDef, ShaderParamDefContainer, ShaderParamDefOptions, StaticSource, SubComponent, Triangle, TriangleVertex, UIObject, UpdateContext, and ValueMap.

List of all members.

Public Member Functions

  SIObject ()
  ~SIObject ()
  SIObject (const CRef &in_ref)
  SIObject (const SIObject &in_obj)
bool  IsA (siClassID in_ClassID) const
siClassID  GetClassID () const
SIObject operator= (const SIObject &in_obj)
SIObject operator= (const CRef &in_ref)
Application  GetApplication () const
CString  GetFullName () const
CString  GetName () const
CStatus  PutName (const CString &in_name)
CString  GetUniqueName () const
CString  GetType () const
CRef  GetParent () const
bool  IsEqualTo (const CRef &in_ref) const
CString  GetHelp () const
CString  GetOriginPath () const
siInstallationPath  GetOrigin () const
CStringArray  GetCategories () const
CRefArray  GetNestedObjects () const

Constructor & Destructor Documentation

SIObject ( )

Default constructor.

~SIObject ( )

Default destructor.

SIObject ( const CRef in_ref )

Constructor.

Parameters:
in_ref constant reference object.
SIObject ( const SIObject in_obj )

Copy constructor.

Parameters:
in_obj constant class object.

Member Function Documentation

bool IsA ( siClassID  in_ClassID ) const [virtual]

Returns true if a given class type is compatible with this API class.

Parameters:
in_ClassID class type.
Returns:
true if the class is compatible, false otherwise.

Reimplemented from CBase.

Reimplemented in ActionDelta, ActionDeltaItem, ActionSource, AnimationSourceItem, AnimationSource, Annotation, Application, Argument, ArgumentHandler, ArrayParameter, Camera, CameraRig, ChainBone, ChainEffector, ChainElement, ChainRoot, Clip, ClipContainer, ClipEffect, ClipEffectItem, ClipRelation, Cluster, ClusterProperty, Command, ConstructionHistory, Constraint, ControlPoint, CustomOperator, CustomProperty, Delta, Desktop, Dictionary, Directed, Edge, Envelope, EnvelopeWeight, EventInfo, Expression, Facet, Factory, FCurve, FCurveKey, FileReference, Filter, Framebuffer, Geometry, GraphicDriver, Group, HairPrimitive, HardwareSurface, ICEAttribute, ICECompoundNode, ICEDataModifierNode, ICEDataProviderNode, ICENode, ICENodeContainer, ICENodeInputPort, ICENodeOutputPort, ICENodePort, ICETree, ImageClip, ImageClip2, InputPort, Joint, Kinematics, KinematicState, CKnotArray, Layer, Layout, Library, Light, LightRig, MappedItem, Material, MaterialLibrary, MemoCamera, Menu, MenuItem, MetaShaderRendererDef, Mixer, Model, Null, NurbsCurve, NurbsCurveList, NurbsSample, NurbsSurface, NurbsSurfaceMesh, Operator, OutputPort, Override, Parameter, Particle, ParticleAttribute, ParticleCloud, ParticleCloudPrimitive, ParticleType, Partition, Pass, PassContainer, Plugin, PluginItem, PluginRegistrar, Point, PolygonFace, PolygonMesh, PolygonNode, Port, PortGroup, Preferences, Primitive, Project, ProjectItem, Property, ProxyParameter, RenderChannel, Renderer, Rig, Sample, Scene, SceneItem, SceneRenderProperty, Schematic, SchematicNode, Segment, Shader, ShaderArrayParamDef, ShaderArrayParameter, ShaderballOptions, ShaderDef, ShaderParamDef, ShaderParamDefContainer, ShaderParamDefOptions, ShaderParameter, ShaderStructParamDef, ShapeClip, ShapeKey, SimulationEnvironment, Source, StaticKinematicState, StaticSource, SubComponent, Texture, TextureLayer, TextureLayerPort, TimeControl, TimerEvent, Track, Transition, Triangle, TriangleVertex, UIObject, UIPersistable, UpdateContext, UserDataBlob, UserDataMap, UVProperty, ValueMap, Vertex, View, and X3DObject.

siClassID GetClassID ( ) const [virtual]

Returns the type of the API class.

Returns:
The class type.

Implements CBase.

Reimplemented in ActionDelta, ActionDeltaItem, ActionSource, AnimationSourceItem, AnimationSource, Annotation, Application, Argument, ArgumentHandler, ArrayParameter, Camera, CameraRig, ChainBone, ChainEffector, ChainElement, ChainRoot, Clip, ClipContainer, ClipEffect, ClipEffectItem, ClipRelation, Cluster, ClusterProperty, Command, ConstructionHistory, Constraint, ControlPoint, CustomOperator, CustomProperty, Delta, Desktop, Dictionary, Directed, Edge, Envelope, EnvelopeWeight, EventInfo, Expression, Facet, Factory, FCurve, FCurveKey, FileReference, Filter, Framebuffer, Geometry, GraphicDriver, Group, HairPrimitive, HardwareSurface, ICEAttribute, ICECompoundNode, ICEDataModifierNode, ICEDataProviderNode, ICENode, ICENodeContainer, ICENodeInputPort, ICENodeOutputPort, ICENodePort, ICETree, ImageClip, ImageClip2, InputPort, Joint, Kinematics, KinematicState, CKnotArray, Layer, Layout, Library, Light, LightRig, MappedItem, Material, MaterialLibrary, MemoCamera, Menu, MenuItem, MetaShaderRendererDef, Mixer, Model, Null, NurbsCurve, NurbsCurveList, NurbsSample, NurbsSurface, NurbsSurfaceMesh, Operator, OutputPort, Override, Parameter, Particle, ParticleAttribute, ParticleCloud, ParticleCloudPrimitive, ParticleType, Partition, Pass, PassContainer, Plugin, PluginItem, PluginRegistrar, Point, PolygonFace, PolygonMesh, PolygonNode, Port, PortGroup, Preferences, Primitive, Project, ProjectItem, Property, ProxyParameter, RenderChannel, Renderer, Rig, Sample, Scene, SceneItem, SceneRenderProperty, Schematic, SchematicNode, Segment, Shader, ShaderArrayParamDef, ShaderArrayParameter, ShaderballOptions, ShaderDef, ShaderParamDef, ShaderParamDefContainer, ShaderParamDefOptions, ShaderParameter, ShaderStructParamDef, ShapeClip, ShapeKey, SimulationEnvironment, Source, StaticKinematicState, StaticSource, SubComponent, Texture, TextureLayer, TextureLayerPort, TimeControl, TimerEvent, Track, Transition, Triangle, TriangleVertex, UIObject, UIPersistable, UpdateContext, UserDataBlob, UserDataMap, UVProperty, ValueMap, Vertex, View, and X3DObject.

SIObject& operator= ( const SIObject in_obj )

Creates an object from another object. The newly created object is set to empty if the input object is not compatible.

Parameters:
in_obj constant class object.
Returns:
The new SIObject object.
SIObject& operator= ( const CRef in_ref )

Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.

Parameters:
in_ref constant class object.
Returns:
The new SIObject object.

Reimplemented in ActionDelta, ActionDeltaItem, ActionSource, AnimationSourceItem, AnimationSource, Annotation, Application, Argument, ArgumentHandler, ArrayParameter, Camera, CameraRig, ChainBone, ChainEffector, ChainElement, ChainRoot, Clip, ClipContainer, ClipEffect, ClipEffectItem, ClipRelation, Cluster, ClusterProperty, Command, ConstructionHistory, Constraint, ControlPoint, CustomOperator, CustomProperty, Delta, Desktop, Dictionary, Directed, Edge, Envelope, EnvelopeWeight, EventInfo, Expression, Facet, Factory, FCurve, FCurveKey, FileReference, Filter, Framebuffer, Geometry, GraphicDriver, Group, HairPrimitive, HardwareSurface, ICEAttribute, ICECompoundNode, ICEDataModifierNode, ICEDataProviderNode, ICENode, ICENodeContainer, ICENodeInputPort, ICENodeOutputPort, ICENodePort, ICETree, ImageClip, ImageClip2, InputPort, Joint, Kinematics, KinematicState, CKnotArray, Layer, Layout, Library, Light, LightRig, MappedItem, Material, MaterialLibrary, MemoCamera, Menu, MenuItem, MetaShaderRendererDef, Mixer, Model, Null, NurbsCurve, NurbsCurveList, NurbsSample, NurbsSurface, NurbsSurfaceMesh, Operator, OutputPort, Override, Parameter, Particle, ParticleAttribute, ParticleCloud, ParticleCloudPrimitive, ParticleType, Partition, Pass, PassContainer, Plugin, PluginItem, PluginRegistrar, Point, PolygonFace, PolygonMesh, PolygonNode, Port, PortGroup, Preferences, Primitive, Project, ProjectItem, Property, ProxyParameter, RenderChannel, Renderer, Rig, Sample, Scene, SceneItem, SceneRenderProperty, Schematic, SchematicNode, Segment, Shader, ShaderArrayParamDef, ShaderArrayParameter, ShaderballOptions, ShaderDef, ShaderParamDef, ShaderParamDefContainer, ShaderParamDefOptions, ShaderParameter, ShaderStructParamDef, ShapeClip, ShapeKey, SimulationEnvironment, Source, StaticKinematicState, StaticSource, SubComponent, Texture, TextureLayer, TextureLayerPort, TimeControl, TimerEvent, Track, Transition, Triangle, TriangleVertex, UIObject, UIPersistable, UpdateContext, UserDataBlob, UserDataMap, UVProperty, ValueMap, Vertex, View, and X3DObject.

Application GetApplication ( ) const

Returns the Application object.

Returns:
The Softimage Application object.
CString GetFullName ( ) const

Returns the full name of the object.

Returns:
The full name of the object.
CString GetName ( ) const

Returns the name of the object.

Returns:
The name of the object.

Reimplemented in ActionDelta, ActionDeltaItem, and FileReference.

CStatus PutName ( const CString in_name )

Sets the name of the object.

Parameters:
in_name new name for the object.
Returns:
CStatus::OK success
CStatus::Fail failure.
CString GetUniqueName ( ) const

Returns the unique name of an object

Returns:
The unique name of the object.
CString GetType ( ) const

Returns the object type.

Returns:
The object type.

Reimplemented in ActionDelta, and ActionDeltaItem.

CRef GetParent ( ) const

Returns a reference to the parent of the object. The objects that have no parent, like Application, return themselves as parent. Calling this method on an operator object will return the the target of the first output port of the operator as the parent.

Returns:
A reference to the parent of this object.
bool IsEqualTo ( const CRef in_ref ) const

Compares this object with a specified object and indicates whether they are the same object or not.

Parameters:
in_ref The object to compare with .
Returns:
true if its equal, false otherwise.
CString GetHelp ( ) const

Returns the help file for this object.

Returns:
The full file path for the help file.
Since:
4.0
CString GetOriginPath ( ) const

Returns the location path where this object is defined.

Returns:
The full path where this object is defined.
Since:
4.0
siInstallationPath GetOrigin ( ) const

Returns the location path where this object is defined.

Returns:
Installation type.
Since:
4.0
CStringArray GetCategories ( ) const

Returns an array of user-defined categories.

Returns:
Array of categories (strings).
Since:
4.0

Reimplemented in Preferences.

CRefArray GetNestedObjects ( ) const

Returns an array of objects nested under this object.

Returns:
Array of nested objects.
Since:
5.0.
Example:
This example traverses the hierarchy of a selected object and logs recursively all its nested objects.
        using namespace XSI;

        // declare function prototypes
        void VisitNestedObjects( SIObject& in_obj, LONG in_indent );
        void LogNestedObject(SIObject& in_obj, LONG in_indent )

        // iterates over the nested objects of the selected object
        Application app;
        Selection sel = app.GetSelection();
        SIObject selObject(sel[0]);
        VisitNestedObjects( selObject, 0 );

        void VisitNestedObjects( SIObject& in_obj, LONG in_indent )
        {
            LogNestedObject(in_obj, in_indent);

            CRefArray nestees( in_obj.GetNestedObjects() );
            for (LONG i=0; i<nestees.GetCount(); i++)
            {
                SIObject obj(nestees[i]);
                VisitNestedObjects( obj, in_indent+1 );
            }
        }

        void LogNestedObject(SIObject& in_obj, LONG in_indent )
        {
            CString str(in_obj.GetClassIDName());
            str += L":";
            str += in_obj.GetName();

            if (in_obj.IsA(siParameterID))
            {
                str += L":";
                Parameter paramObj(in_obj);

                str += CString(paramObj.GetValue());
            }

            const char* pStr = str.GetAsciiString();
            char szBuffer[256];
            szBuffer[255] = '\0';
            sprintf( szBuffer, "%*c%s", in_indent, ' ', pStr );

            str.PutAsciiString( szBuffer );

            Application app;
            app.LogMessage( str );
        }

The documentation for this class was generated from the following file: