Public Member Functions
Application Class Reference

## Detailed Description

The Application object represents the running instance of the Softimage application and it is the top most entity of the C++ API object hierarchy. Application contains properties that return other Softimage objects such as the active scene root.

See also:
  CustomUITest/netview_CustomUITest Custom UI Test

Unlike most other C++ API objects, it is not necessary to intialize this object based on a CRef(), as soon as you create this object is it ready for use, as shown in the example below.

Example:
  Using the Application class

              using namespace XSI;
              Application app;
              Model root = app.GetActiveSceneRoot();

              CameraRig myCamRig;
              root.AddCameraRig( L"Camera", L"", myCamRig );

              Camera myCam(myCamRig.GetCamera());
              X3DObject myCamInterest(myCam.GetInterest());

              CString strCamName( myCam.GetName() );
              app.LogMessage( L"Camera interest" );
              app.LogMessage( strCamName + L".interest.name: " + myCam.GetInterest().GetName() );

              app.LogMessage( strCamName + L"'s near parameter: " + myCam.GetParameterValue(CString(L"near")).GetAsText() );
              app.LogMessage( strCamName + L"'s far parameter: " +  myCam.GetParameterValue(CString(L"far")).GetAsText() );
              app.LogMessage( strCamName + L"'s orthoheight parameter: " + myCam.GetParameterValue(CString(L"orthoheight")).GetAsText() );
              app.LogMessage( strCamName + L"'s fov parameter: " + myCam.GetParameterValue(CString(L"fov")).GetAsText() );

`#include <xsi_application.h>`

Inheritance diagram for Application:
[legend]

List of all members.

## Public Member Functions
| Application ()
| ~Application ()
| Application (const CRef &in_ref)
| Application (const Application &in_obj)
bool | IsA (siClassID in_ClassID) const
siClassID | GetClassID () const
Application & | operator= (const Application &in_obj)
Application & | operator= (const CRef &in_ref)
Selection | GetSelection () const
CRefArray | GetFCurveSelection () const
Dictionary | GetDictionary () const
Project | GetActiveProject () const
CStatus | PutActiveProject (const CString &in_Project) const
Model | GetActiveSceneRoot () const
CString | GetInstallationPath (siInstallationPath in_pathType) const
CString | GetVersion () const
CString | GetLicense () const
CStatus | InstallAddon (const CString &in_strFileName, siInstallationPath in_eInstallDir, bool in_bNoUI=false)
CStatus | UnInstallAddon (const CString &in_strFileName)
Command | CreateCommand (const CString &in_CommandName, siCommandCategory in_category=siNoCategory)
CStatus | AddCommand (const CRef &in_Cmd)
CStatus | RemoveCommand (const CString &name)
CommandArray | GetCommands () const
Command | GetCommandByScriptingName (const CString &scriptingName) const
CStatus | ExecuteCommand (const CString &in_name, CValueArray &in_args, CValue &io_val) const
CStatus | ExecuteCommand (const CString &in_name, const CValueArray &in_args, CValue &io_val) const
CScriptErrorDescriptor | ExecuteScript (const CString &in_ScriptFilename, const CString &in_ScriptLanguage, const CString &in_ScriptProcedure, CValueArray &in_args, CValue &out_returnval)
CScriptErrorDescriptor | ExecuteScriptCode (const CString &in_ScriptCode, const CString &in_ScriptLanguage)
CScriptErrorDescriptor | ExecuteScriptProcedure (const CString &in_ScriptCode, const CString &in_ScriptLanguage, const CString &in_ScriptProcedure, CValueArray &in_args, CValue &out_returnval)
CRefArray | GetEventInfos () const
CStatus | LogMessage (const CString &in_Message, siSeverityType in_Sev=siInfoMsg) const
CStatus | CreateProject (const CString &in_ProjectPath, Project &out_rProject) const
Preferences | GetPreferences () const
Desktop | GetDesktop () const
Factory | GetFactory () const
CString | GetActiveToolName () const
UIToolkit | GetUIToolkit () const
CRefArray | GetFilters () const
CRefArray | GetPlugins () const
bool | IsInteractive () const
Plugin | LoadPlugin (const CString &in_pluginPath)
CStatus | UnloadPlugin (const CString &in_pluginPath, bool in_bRemove)
CStatus | UpdatePlugins ()
CStatus | AddWorkgroup (const CString &in_workgroupPath)
CStatus | RemoveWorkgroup (const CString &in_workgroupPath)
CStringArray | GetWorkgroups ()
CStatus | RescanWorkgroups ()
CStatus | ActivateWorkgroup (const CString &in_workgroupPath, bool in_bActivate)
CRefArray | GetRenderers ()
ProjectItem | GetObjectFromID (ULONG in_nID) const
CSIObjectRefArray | FindObjects (const XSI::siClassID &in_nClsID) const
CSIObjectRefArray | FindObjects (const CString &in_sCLSID) const
ShaderDef | GetShaderDef (const CString &in_progID)
CRefArray | GetShaderDefinitions ()
CStatus | RegisterShaderFamily (const CString &in_strName, const CString &in_strDisplayName, const CString &in_strDescription, unsigned char in_nodeRed, unsigned char in_nodeGreen, unsigned char in_nodeBlue, bool in_bShaderball)
CStatus | RegisterShaderCustomParameterType (const CString &in_strName, const CString &in_strDisplayName, const CString &in_strDescription, unsigned char in_portRed, unsigned char in_portGreen, unsigned char in_portBlue, const CStringArray &in_typeFilter, const CStringArray &in_familyFilter)
CStatus | OpenUndo (const CString &in_sComplexName)
CStatus | CloseUndo ()
bool | IsUndoing () const
ULONG | GetCustomPropertyCount (const CString &in_strType) const

## Constructor & Destructor Documentation

Application | ( |  | ) |

Default constructor.

~Application | ( |  | ) | `[inline]`

Default destructor.

Application | ( | const CRef & | in_ref | ) |

Constructor. It is not normally necessary to use this version of the constructor, because the default constructor also produces an initialized Application object.

Parameters:

  in_ref | constant reference object.

Application | ( | const Application & | 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 SIObject.

siClassID GetClassID | ( |  | ) | const `[virtual]`

Returns the type of the API class.

Returns:
  The class type.

Reimplemented from SIObject.

Application& operator= | ( | const Application & | 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 Application object.

Application& 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 Application object.

Reimplemented from SIObject.

Selection GetSelection | ( |  | ) | const

Returns the Selection object holding the selected objects represented as CRef objects.

Returns:
  Selection object.

CRefArray GetFCurveSelection | ( |  | ) | const

Returns a list of FCurve objects with selected keys represented as CRef objects.

Returns:
  Array of references to FCurve objects.

Since:
  6.0

Dictionary GetDictionary | ( |  | ) | const

Not-implemented.

Note:
  CRef::Set is the C++ API equivalent of the Dictionary.GetObject method.

Project GetActiveProject | ( |  | ) | const

Returns the active Project.

Returns:
  The active project.

CStatus PutActiveProject | ( | const CString & | in_Project | ) | const

Sets the active Project.

Parameters:

  in_Project | The path of the project to set.

Since:
  5.0

Returns:
  CStatus::OK Success.
  CStatus::Fail Failure.

Model GetActiveSceneRoot | ( |  | ) | const

Returns the root model of the active scene of the active project.

Returns:
  The active scene model.

CString GetInstallationPath | ( | siInstallationPath | in_pathType | ) | const

Returns an installation path. The returned paths end with a slash character.

Parameters:

  in_pathType | Installation path type (one of the siInstallationPath values).

Returns:
  The installation path.

Since:
  4.0

CString GetVersion | ( |  | ) | const

Returns the version number of the application (eg, `6.5.170.QFE1` or `XSI_Pioneer_Beta1.234-4.0`). As of v7.0, the format of the version information is:
`{ReleaseNumber}`.{BuildNumber}.{UpdateNumber}
...where the chunks represent this information:

- `{ReleaseNumber}` which can contain alphanumeric characters, as well as decimal points (.)
  For released products, this contains `Major.Minor` designation (eg., `6.5`).
  For pre-release versions, this may be the `CodeNameMileStone` (eg., `XSI_Pioneer_Beta1`).
- `{BuildNumber}` which can also contain alphanumeric characters, but cannot contain decimal points (eg., `234` or `234-4`).
- `{UpdateNumber}` which can also contain alphanumeric characters, but cannot contain decimal points (eg., `1` or `QFE1`).

Prior to v7.0, the format of the version information is: `Major.Minor.YYYY.MMDD` (eg., `6.02.2007.0605`).

Returns:
  The version number.

Since:
  4.0

CString GetLicense | ( |  | ) | const

Returns the type of license used.

Returns:
  Advanced
  Essential
  Foundation
  Experience

Since:
  4.0

CStatus InstallAddon | ( | const CString & | in_strFileName,
|  | siInstallationPath | in_eInstallDir,
|  | bool | in_bNoUI = `false`
| ) |  |

Installs an .xsiaddon file in Softimage. An add-on file is a set of customized items (like layout, toolbar, preset, etc.) that are packaged in a single file.

Parameters:

  in_strFileName | File path of the add-on file to install.
  in_eInstallDir | Destination directory, where the add-on is installed. siUserAddonPath and siWorkgroupAddonPath are the recommended values. If siUnknownPath is specified then the add-on will be installed at the default location specified inside the add-on file. Note: In the case of multiple workgroups, this always installs to the first workgroup in the list.
  in_bNoUI | Use this optional parameter to avoid displaying the warning message boxes that are shown during the installation of certain addons.

Returns:
  CStatus::Ok Success
  CStatus::Fail Installation failure

Since:
  7.5

CStatus UnInstallAddon | ( | const CString & | in_strFileName | ) |

Uninstalls an .xsiaddon file from Softimage. This deletes all items that were previously installed by the specified add-on file.

Parameters:

  in_strFileName | File path of the add-on file to uninstall.

Returns:
  CStatus::Ok Success
  CStatus::Fail Installation failure

Since:
  7.5

Command CreateCommand | ( | const CString & | in_CommandName,
|  | siCommandCategory | in_category = `siNoCategory`
| ) |  |

Creates a new command. The details of the new command are defined by calling the functions on the returned Command object. Once completely defined the command is installed by passing the command object back to Softimage with a call to Application::AddCommand. If a command already exists by that name then this command will fail.

Note:
  Rather than calling this function, it is recommended that custom commands be defined as part of a self-installed plug-in. See PluginRegistrar::RegisterCommand.

Parameters:

  in_CommandName | The unique name identifying the new command. Note that the command is not created if one with this name already exists.
  in_category | Where (on which Softimage standard menu) the command will appear in the user interface. For more information, see the siCommandCategory enum documentation.

Returns:
  The newly created Command.

CStatus AddCommand | ( | const CRef & | in_Cmd | ) |

Installs a new Command into the system. This function is called after Application::CreateCommand.

Note:
  Rather than calling this function, it is recommended that custom commands be defined as part of a self-installed plug-in. See PluginRegistrar::RegisterCommand.

Parameters:

  in_Cmd | Command object containing the definition of the new command

Returns:
  CStatus::OK Success.
  CStatus::Fail Failure.

See also:
  Application::CreateCommand

Since:
  4.0

CStatus RemoveCommand | ( | const CString & | name | ) |

Removes a command. This is only called for cus_cmds Custom Commands .

To remove a custom command that is defined as part of a self-installed plug-in remove the script file or dll rather than calling this function. Similarly, this function cannot be used to remove custom commands that are installed as part of an add-on.

Parameters:

  name | Name of the Command, not the scripting name of the command. For example `Select` `Object` instead of `SelectObj`

Returns:
  CStatus::OK Success.
  CStatus::Fail Failure.

CommandArray GetCommands | ( |  | ) | const

Returns the CommandArray object representing all the installed commands.

Returns:
  Array of Command objects

Command GetCommandByScriptingName | ( | const CString & | scriptingName | ) | const

Returns a command by its scripting name. To return a command by its name use Application::GetCommands and CommandArray::GetItem instead.

Parameters:

  scriptingName | The scripting name of the command you want to find.

Returns:
  The matching command

See also:
  Command::ScriptingName

Since:
  5.0

CStatus ExecuteCommand | ( | const CString & | in_name,
|  | CValueArray & | in_args,
|  | CValue & | io_val
| ) |  | const

Executes a specified command identified by its scripting name.

Parameters:

  in_name | Command scripting name.
  in_args | Array of values containing the arguments to pass to the command. If the command is defined with output arguments, the array is updated with the new argument values returned by the command.
  io_val | The value returned by the command.

Note:
  If the command has no return value explicitly defined, ExecuteCommand returns all output arguments in a CValueArray object. However, if the command defines a return value, you cannot extract any output arguments from it. This is because the command is not returning an output argument array, but a specific value. You can check the Return Value section in the ref_intro C# and Scripting Reference to see whether it uses an explicit return value and what that value is.

Returns:
  CStatus::OK Success
  CStatus::Fail Failure

Since:
  3.5

Example:
  Adds a custom property to a sphere and extract the newly created property from the output argument returned by the AddProp command.

            using namespace XSI;

            CValueArray args(3);

            args[0] = CValue(L"Sphere");
            args[1] = CValue(L"MeshSurface");
            args[2] = CValue(L"MySphere");

            Application app;
            CValue valSphere;
            app.ExecuteCommand( L"CreatePrim", args, valSphere );

            args.Resize(5);
            args[0] = L"Annotation";
            args[1] = valSphere;
            args[2] = CValue(); // use default
            args[3] = L"MyAnnotation";
            args[4] = CValue(); // newly created property is returned as output arg

            app.ExecuteCommand( L"AddProp", args, outArg );

            // AddProp return the new property in a CValueArray object stored in the
            // 5th argument.
            CValueArray propArray(args[4]);

            // the property is stored in the first element of the array
            Property prop(propArray[0]);
            app.LogMessage( L"Property name: " + prop.GetFullName() );

            // create a model an get the newly created model from the ouptut argument
            args.Resize(4);
            args[0] = valSphere;
            args[1] = L"MyModel";
            args[2] = CValue(); // optional parent
            args[3] = CValue(); // newly created model

            CValue retVal;
            app.ExecuteCommand( L"SICreateModel", args, retVal );

            Model myModel(args[3]);
            app.LogMessage( L"Model name: " + myModel.GetFullName() );

CStatus ExecuteCommand | ( | const CString & | in_name,
|  | const CValueArray & | in_args,
|  | CValue & | io_val
| ) |  | const

Executes a command.

Note:
  If the command has no return value explicitly defined, ExecuteCommand returns all output arguments in a CValueArray object. However, if the command defines a return value, you cannot extract any output arguments from it. This is because the command is not returning an output argument array, but a specific value. You can check the Return Value section in the ref_intro C# and Scripting Reference to see whether it uses an explicit return value and what that value is.

Deprecated:
  3.5 This version is kept for backward compatibility, please use the new version instead.

Parameters:

  in_name | Command scripting name.
  in_args | Array of values containing the arguments to pass to the command. Because this argument is defined as const, the array cannot be updated with the output argument values returned by the command. You should use the other version of ExecuteCommand defined with a CValueArray& argument if you need to access the output argument values.
  io_val | The value returned by the command.

Returns:
  CStatus::OK success
  CStatus::Fail failure

CScriptErrorDescriptor ExecuteScript | ( | const CString & | in_ScriptFilename,
|  | const CString & | in_ScriptLanguage,
|  | const CString & | in_ScriptProcedure,
|  | CValueArray & | in_args,
|  | CValue & | out_returnval
| ) |  |

Executes a script from a file. This function can detect the script language based on the file extension.

Parameters:

  in_ScriptFilename | A string pointing to the script file to execute.
  in_ScriptLanguage | Optional. Scripting language (for example, `VBScript`, `JScript`, or `Python`). If empty, the value in in_ScriptFilename is used to detect the scripting language to use.
  in_ScriptProcedure | Optional. Name of a procedure in the script code that you want to call.
  in_args | Optional. An array of arguments to pass to the procedure. Ignored if `in_ScriptProcedure` is not specified.

Return values:

  out_returnval | Optional. Return value from the procedure. Ignored if `in_ScriptProcedure` is not specified.

Returns:
  If there was a script error this will be set to a failure status code and contain additional error details.

See also:
  Command, CComAPIHandler, Application::ExecuteScriptProcedure

Since:
  9.0 (2011)

CScriptErrorDescriptor ExecuteScriptCode | ( | const CString & | in_ScriptCode,
|  | const CString & | in_ScriptLanguage
| ) |  |

Executes a string of script code. This is a convenient way to execute script code directly from C++. For example, you may want to execute some code that is easy to implement in scripting, but hard to implement in C++. Another possible usage is in the context of a CustomDisplayHost-based script editor.

This function is best suited for small scripts or dynamically generated code. For larger scripts, you may want to consider exposing the script as a custom Command.

Parameters:

  in_ScriptCode | A string of script code to execute.
  in_ScriptLanguage | Scripting language (for example, `VBScript`, `JScript`, or `Python`).

Returns:
  CScriptErrorDescriptor object. If there was a script error this will be set to a failure status code and contain additional error details.

See also:
  Command, CComAPIHandler, Application::ExecuteCommand

Since:
  5.0

Example:
  ExecuteScriptCode and ExecuteScriptProcedure demo

          // Basic usage just executes the text directly
          app.ExecuteScriptCode(L"Logmessage \"Hello from VBScript\"", L"VBScript" ) ;

          // For more advanced usage it is possible to pass values and get a return value
          // by calling a procedure inside the script text

          CScriptErrorDescriptor status ;
          CValueArray fooArgs(1) ;
          fooArgs[0] = L"Argument Sent to Script" ;
          CValue retVal ;

          status = app.ExecuteScriptProcedure(
                      L"function foo( x ) \n Logmessage x \n foo = 45 \n end function",
                      L"VBScript",
                      L"foo",
                      fooArgs,
                      retVal  ) ;

          // Catch an intentional script error

          status = app.ExecuteScriptProcedure(
                  L"sub foo( x ) \n run time error! \n foo = 45 \n end sub",
                  L"VBScript",
                  L"foo",
                  fooArgs,
                  retVal ) ;

          // Show the error
          app.LogMessage( status.GetDescription() + CString( L" - " ) + CValue( status.GetErrorLineNumber() ).GetAsText() ) ;

CScriptErrorDescriptor ExecuteScriptProcedure | ( | const CString & | in_ScriptCode,
|  | const CString & | in_ScriptLanguage,
|  | const CString & | in_ScriptProcedure,
|  | CValueArray & | in_args,
|  | CValue & | out_returnval
| ) |  |

This is an alternative to Application::ExecuteScriptCode which supports execution of a procedure inside script code. By calling a procedure it is possible to pass arguments into the script code and get a return value back.

Parameters:

  in_ScriptCode | A string of script code to execute.
  in_ScriptLanguage | Scripting language (for example, "VBScript", "JScript", or "Python").
  in_ScriptProcedure | Optional. Name of a procedure in the script code that you want to call.
  in_args | Optional. An array of arguments to pass to the procedure. Ignored if `in_ScriptProcedure` is not specified.

Return values:

  out_returnval | Optional. Return value from the procedure. Ignored if `in_ScriptProcedure` is not specified.

Returns:
  CScriptErrorDescriptor object. If there was a script error this will be set to a failure status code and contain additional error details.

See also:
  Application:ExecuteScriptCode

Since:
  5.0

CRefArray GetEventInfos | ( |  | ) | const

Returns all events currently defined in Softimage.

Returns:
  CRefArray An array of EventInfo objects.

Since:
  5.0

CStatus LogMessage | ( | const CString & | in_Message,
|  | siSeverityType | in_Sev = `siInfoMsg`
| ) |  | const

Sends a message to the history logging mechanism. The message appears as a Message Box, in the History Window, or on the Status Bar, depending on which `Severity` parameter you used. For more information on these options, see the siSeverityType enum.

Parameters:

  in_Message | Message Text
  in_Sev | Severity of the message, the default value is siInfoMsg.

Returns:
  CStatus::OK success
  CStatus::Fail failure

CStatus CreateProject | ( | const CString & | in_ProjectPath,
|  | Project & | out_rProject
| ) |  | const

Creates a new project at a specific location. Existing projects won't be overwritten.

Parameters:

  in_ProjectPath | Full path name of the project. The name of the created project corresponds to the leaf folder of the full path.

Return values:

  out_rProject | NOT SUPPORTED, JUST PASS A DUMMY PROJECT.

Returns:
  CStatus::OK success
  CStatus::Fail failure

Preferences GetPreferences | ( |  | ) | const

Returns the Preferences object. This object is used to manage user preferences in Softimage. You can get or set preferences, import or export categories etc.

Returns:
  The Preferences object.

Since:
  4.0

Desktop GetDesktop | ( |  | ) | const

Returns the Desktop object. This object is used to manage UI objects within Softimage.

Returns:
  The Desktop object.

Since:
  4.0

Factory GetFactory | ( |  | ) | const

Returns the Factory object. This object is used to manage the creation of standalone objects within Softimage, such as unconnected scripted operators.

Returns:
  The Factory object.

Since:
  4.0

CString GetActiveToolName | ( |  | ) | const

Returns the name of the active tool. Only the following tools from the 3D view are supported: RotateTool, ScaleTool and TranslateTool. An empty string is returned if the tool is not recognized.

Returns:
  The name of the active tool.

Since:
  4.0

UIToolkit GetUIToolkit | ( |  | ) | const

Returns the UIToolkit object.

Returns:
  The UIToolkit object.

CRefArray GetFilters | ( |  | ) | const

Returns all native and custom filters currently defined in Softimage.

Returns:
  Array of Filter objects.

Since:
  4.0

CRefArray GetPlugins | ( |  | ) | const

Returns the list of all self-installable plug-ins currently loaded in Softimage.

Returns:
  Array of Plugin objects.

Since:
  4.0

bool IsInteractive | ( |  | ) | const

Returns true if the application is in interactive mode or false if it is running in batch mode.

Returns:
  True if the application is running in UI mode or false otherwise.

Since:
  4.0

Plugin LoadPlugin | ( | const CString & | in_pluginPath | ) |

Loads a self-installing plug-in file. Files with the following extensions are considered valid:

     .dllso, .vbs, .js, .pys, .py, .pls, .pl

Parameters:

  in_pluginPath | Full path name of the plugin.

Returns:
  Plugin object representing the newly installed plug-in. If the plug-in is already installed, the existing plug-in is returned.

Since:
  4.0

CStatus UnloadPlugin | ( | const CString & | in_pluginPath,
|  | bool | in_bRemove
| ) |  |

Unloads a self-installing plug-in from Softimage. All registered plug-in items are unregistered when a plug-in is unloaded; Therefore you will not be able to use these items in Softimage until you reload the plug-in.

Unloaded plug-ins can still be retrieved from Application::GetPlugins. They can be distinguished from other plug-ins by using the Plugin::IsLoaded property. An unloaded plug-in always has no registered plug-in items.

Parameters:

  in_pluginPath | Full path name of the plugin.
  in_bRemove | Delete the plug-in file on disk if true.

Returns:
  CStatus::OK success
  CStatus::False Already unloaded
  CStatus::Fail failure

Since:
  4.0

CStatus UpdatePlugins | ( |  | ) |

When invoked Softimage checks each loaded self-installed Plugin file and reloads it if it has changed on disk. It also scans the standard plug-in directories for any new plug-in files. This is identical to clicking the Update All button on the Plug-in Manager.

Returns:
  CStatus::OK success
  CStatus::Fail failure

Since:
  5.0

CStatus AddWorkgroup | ( | const CString & | in_workgroupPath | ) |

Adds a new workgroup and loads any plug-ins found in the workgroup. This function does nothing if the workgroup is already part of the workgroup list. Softimage will remember the new workgroup as part of the user Preferences.

Parameters:

  in_workgroupPath | Complete path to root directory of a workgroup

Returns:
  CStatus::OK success
  CStatus::Fail failure

Since:
  5.0

CStatus RemoveWorkgroup | ( | const CString & | in_workgroupPath | ) |

Disconnects Softimage from a workgroup. Self-installed plug-ins, SPDLs and other content will be unloaded.

Parameters:

  in_workgroupPath | Complete path to root directory of a workgroup

Returns:
  CStatus::OK success
  CStatus::Fail failure

Since:
  5.0

CStringArray GetWorkgroups | ( |  | ) |

Returns the list of workgroups to which Softimage is actively connected.

Returns:
  Array containing full paths to all active workgroups

Since:
  5.0

CStatus RescanWorkgroups | ( |  | ) |

Unloads all workgroup content and reloads it. This process can be time-consuming if the workgroup's content is large or the network connection is slow. Doing this will ensure that any duplicate plug-ins are loaded in the correct conflict resolution behavior. In normal circumstances calling Application::AddWorkgroup and Application::RemoveWorkgroup is faster and sufficient.

Returns:
  CStatus::OK success
  CStatus::Fail failure

Since:
  5.0

CStatus ActivateWorkgroup | ( | const CString & | in_workgroupPath,
|  | bool | in_bActivate
| ) |  |

Activates or deactivates a workgroup. Deactivating a workgroup is very similar to calling Application::RemoveWorkgroup except that Softimage will continue to remember the workgroup path. This makes it easier for users to remember which workgroups they have connected to in the past. Softimage will not scan a deactivated workgroup for plug-ins and it will not be included in the list returned by Application::GetWorkgroups.

Note:
  Deactivated plug-ins are still stored in the `data_management.workgroup_appl_path` preference but they are prefixed with a `!` character.

Parameters:

  in_workgroupPath | Complete path to root directory of a workgroup
  in_bActivate | True to activate the workgroup; false to deactivate it.

Returns:
  CStatus::OK success
  CStatus::Fail failure

Since:
  5.0

CRefArray GetRenderers | ( |  | ) |

Returns the list of all rendering engines currently loaded in Softimage.

Returns:
  Array of Renderer objects.

Since:
  7.0

ProjectItem GetObjectFromID | ( | ULONG | in_nID | ) | const

Returns the object whose ID is specified. If there is no object associated to the specified ID, an empty object is returned.

Parameters:

  in_nID | An object ID.

Returns:
  ProjectItem The object that matches the input ID.

See also:
  ProjectItem.GetObjectID

Since:
  7.0

CSIObjectRefArray FindObjects | ( | const XSI::siClassID & | in_nClsID | ) | const

Returns all objects found in the scene that match a class identifier. These identifiers are documented but can also be discovered by inspecting Softimage objects with the SDK Explorer. The supported class identifierss are the following:

- XSI::siAnnotationID
- XSI::siCameraID
- XSI::siClusterID
- XSI::siClusterPropertyID
- XSI::siConstraintID
- XSI::siCustomOperatorID
- XSI::siCustomPropertyID
- XSI::siEnvelopeID
- XSI::siEnvelopeWeightID
- XSI::siExpressionID
- XSI::siGeometryID
- XSI::siGroupID
- XSI::siICETreeID
- XSI::siImageClipID
- XSI::siLayerID
- XSI::siLightID
- XSI::siMaterialID
- XSI::siModelID
- XSI::siNullID
- XSI::siNurbsSurfaceMeshID
- XSI::siNurbsCurveListID
- XSI::siOperatorID
- XSI::siPassID
- XSI::siPolygonMeshID
- XSI::siPropertyID
- XSI::siShaderID
- XSI::siShapeKeyID
- XSI::siX3DObjectID

Parameters:

  in_nClassID | An object class id as defined in XSI::siClassID.

Returns:
  CSIObjectRefArray Array of objects.

See also:
  Model::FindObjects

Since:
  9.5 (2011)

Example:

            using namespace XSI;
            Application app;

            // Returns all 3d objects in the scene as X3DObjects objects
            Application app;
            CSIObjectRefArray objArray = app.FindObjects( siX3DObjectID );
            for ( LONG i=0; i<objArray.GetCount(); i++ )
            {
                app.LogMessage( "X3DObject: " + objArray[i].GetFullName() );
            }

            // Returns all lights in the scene as Light 3D objects only
            objArray = app.FindObjects( siLightID );
            for ( LONG i=0; i<objArray.GetCount(); i++ )
            {
                app.LogMessage( "Lights: " + objArray[i].GetFullName() );
            }

            // Returns all nurbs surface in the scene as NurbsSurfaceMesh geometry objects
            objArray = app.FindObjects( siNurbsSurfaceMeshID );
            for ( LONG i=0; i<objArray.GetCount(); i++ )
            {
                app.LogMessage( "NurbsSurfaceMesh: " + objArray[i].GetFullName() );
            }

            // Returns all geometries in the scene as Geometry objects
            objArray = app.FindObjects( siGeometryID );
            for ( LONG i=0; i<objArray.GetCount(); i++ )
            {
                app.LogMessage( "Geometry: " + objArray[i].GetFullName() );
            }

CSIObjectRefArray FindObjects | ( | const CString & | in_sCLSID | ) | const

Returns all objects found in the scene that match a Softimage object `CLSID`. Object CLSID are not documented but can be discovered with XSIUtils.DataRepository or by inspecting Softimage objects with the SDK Explorer.

Parameters:

  in_sCLSID | An object `CLSID`.

Returns:
  CSIObjectRefArray Array of objects.

See also:
  Model::FindObjects

Since:
  9.5 (2011)

Example:

            using namespace XSI;
            Application app;
            // Find all lights in the scene
            CSIObjectRefArray lights = app.FindObjects( "{F3705C30-5204-11D0-8298-00A0243E366B}" );

            for ( LONG i=0; i< lights.GetCount(); i++ )
            {
                app.LogMessage( "Light: " + lights[i].GetFullName() );
            }

ShaderDef GetShaderDef | ( | const CString & | in_progID | ) |

Returns a shader definition by its `ProgID`.

Parameters:

  in_progID | A shader ProgID.

Returns:
  The matching ShaderDef.

Since:
  9.0 (2011)

CRefArray GetShaderDefinitions | ( |  | ) |

Returns an array of shader definitions loaded in Softimage.

Returns:
  Array of references to ShaderDef objects.

Since:
  9.0 (2011)

CStatus RegisterShaderFamily | ( | const CString & | in_strName,
|  | const CString & | in_strDisplayName,
|  | const CString & | in_strDescription,
|  | unsigned char | in_nodeRed,
|  | unsigned char | in_nodeGreen,
|  | unsigned char | in_nodeBlue,
|  | bool | in_bShaderball
| ) |  |

Registers a new shader family. This shader family can subsequently be used to apply to new shaders using the ShaderDef::AddShaderFamily call. The family name should be kept reasonably short. The display name is shown to the user if the family is registered, for any informative messages and tooltips.

The `in_nodeRed`, `in_nodeGreen`, and `in_nodeBlue` parameters control the default display color of the family when shown in the rendertree. If multiple families are used on a given shader, the primary family dictates the color.

The family can also indicate whether the shader node will support a shaderball by default.

Parameters:

  in_strName | The family's intrinsic name. Used when creating a shader.
  in_strDisplayName | The family's descriptive name to be used in the UI.
  in_strDescription | A short description of the family for information purposes.
  in_nodeRed | The red color component for the node display (`0-255`).
  in_nodeGreen | The green color component for the node display (`0-255`).
  in_nodeBlue | The blue color component for the node display (`0-255`).
  in_bShaderball | A flag indicating whether the shader family is supported by shaderballs.

Returns:
  CStatus::OK success
  CStatus::Fail failure

Since:
  9.0 (2011)

See also:
  ShaderDef::AddShaderFamily, ShaderDef::GetShaderFamilies

CStatus RegisterShaderCustomParameterType | ( | const CString & | in_strName,
|  | const CString & | in_strDisplayName,
|  | const CString & | in_strDescription,
|  | unsigned char | in_portRed,
|  | unsigned char | in_portGreen,
|  | unsigned char | in_portBlue,
|  | const CStringArray & | in_typeFilter,
|  | const CStringArray & | in_familyFilter
| ) |  |

Registers a new custom parameter type for shaders. This custom parameter type can be used to create new shader parameter definitions that have specific connection rules. A shader parameter of a given custom parameter type can only connect to another of the same type, unless a custom type filter is specified. This type filter is a simple flat list of parameter types, which can be either custom or built-in types (see siShaderParameterDataType for the list of string representations of the built-in types).

In addition, the custom parameter type can also restrict the type of shaders connecting to it, by specifying a list of allowed family types. The family filter is applied to all shaders in the sub-tree defined by the shader (the source) being connected into the shader parameter of the custom parameter type (the target).

Parameters:

  in_strName | The port's intrinsic name. Used when creating a shader port.
  in_strDisplayName | The port's descriptive name to be used in the UI.
  in_strDescription | A short description of the port for information purposes.
  in_nodeRed | The red color component for the port display (`0-255`).
  in_nodeGreen | The green color component for the port display (`0-255`).
  in_nodeBlue | The blue color component for the port display (`0-255`).
  in_typeFilter | List of other port types from which this port type allows connections into.
  in_familyFilter | List of shader families that can connect into this port.

Returns:
  CStatus::OK success
  CStatus::Fail failure

Since:
  9.0 (2011)

See also:
  ShaderParamDef::GetDataType, ShaderParameter::GetDataType, ShaderParamDefContainer::AddArrayParamDef, ShaderParamDefContainer::AddParamDef

CStatus OpenUndo | ( | const CString & | in_sComplexName | ) |

Opens an undo complex. An undo complex can be used to undo/redo multiple undoable commands in one single operation. Once an undo complex is opened, all subsequent undoable command calls will be added to this complex. The Application::CloseUndo method should be called to close an opened complex.
OpenUndo is not meant to be used as a replacement for custom commands though but can be used in specific scenarios where the use of custom commands is not necessary. For instance, firing a script from a custom menu item could be done with an undo complex without the needs of writing a custom command for undoing the whole script in one go.
Note: Undo complexes left opened due to a missing CloseUndo call may lead to undo/redo problems. However, Softimage will try to close automatically any opened undo complexes when possible.

Parameters:

  in_sComplexName | Name of this complex displayed in the Softimage undo menu.

Returns:
  CStatus::OK success
  CStatus::Fail failure

Since:
  10.0 (2012)

See also:
  Application::CloseUndo

Example:

            using namespace XSI;
            Application app;

            app.OpenUndo("my undo complex");

            Model root = app.GetActiveSceneRoot();

            X3DObject obj;
            root.AddGeometry( "grid", "MeshSurface", "mygrid", obj );
            root.AddGeometry( "cube", "MeshSurface", "mycube", obj );

            app.CloseUndo();

CStatus CloseUndo | ( |  | ) |

Closes an open undo complex. EndUndo calls are ignored if they don't match a complex previously opened with Application::OpenUndo.
Note: Undo complexes left open due to a missing CloseUndo call may lead to undo/redo problems. However, Softimage will try to close automatically any open undo complexes when possible.

Returns:
  CStatus::OK success
  CStatus::Fail failure

Since:
  10.0 (2012)

See also:
  Application::OpenUndo

Example:

            using namespace XSI;
            Application app;

            app.OpenUndo("my undo complex");

            Model root = app.GetActiveSceneRoot();

            X3DObject obj;
            root.AddGeometry( "grid", "MeshSurface", "mygrid", obj );
            root.AddGeometry( "cube", "MeshSurface", "mycube", obj );

            app.CloseUndo();

bool IsUndoing | ( |  | ) | const

Returns true if some command is currently undoing or redoing its work.

Returns:
  True if a command is currently undoing or redoing its work.

Since:
  10.0 (2012)

ULONG GetCustomPropertyCount | ( | const CString & | in_strType | ) | const

Returns the Custom Property count for a given type.

Parameters:

  in_strType | A Custom Property type.

Returns:
  ULONG The Custom Property count.

See also:
  ProjectItem.GetObjectID

Since:
  11.0 (2013)

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

- xsi_application.h