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.
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.
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 |
SIObject | ( | ) |
Default constructor.
~SIObject | ( | ) |
Default destructor.
bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
Returns true if a given class type is compatible with this API class.
in_ClassID | class type. |
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.
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.
Creates an object from another object. The newly created object is set to empty if the input object is not compatible.
in_obj | constant class object. |
Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.
in_ref | constant class 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.
CString GetFullName | ( | ) | const |
Returns the full name of the object.
CString GetName | ( | ) | const |
Returns the name of the object.
Reimplemented in ActionDelta, ActionDeltaItem, and FileReference.
Sets the name of the object.
in_name | new name for the object. |
CString GetUniqueName | ( | ) | const |
Returns the unique name of an object
CString GetType | ( | ) | const |
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.
bool IsEqualTo | ( | const CRef & | in_ref | ) | const |
Compares this object with a specified object and indicates whether they are the same object or not.
in_ref | The object to compare with . |
CString GetHelp | ( | ) | const |
Returns the help file for this object.
CString GetOriginPath | ( | ) | const |
Returns the location path where this object is defined.
siInstallationPath GetOrigin | ( | ) | const |
Returns the location path where this object is defined.
CStringArray GetCategories | ( | ) | const |
Returns an array of user-defined categories.
Reimplemented in Preferences.
CRefArray GetNestedObjects | ( | ) | const |
Returns an array of objects nested under this object.
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 ); }