XSIApplication
v1.5
The XSIApplication object derives from the Application; its properties and methods are
specific to Softimage, whereas Application contains only generic properties
and methods. XSIApplication manages access to high-level objects
such as the Softimage active Project,
Selection object, Softimage Command objects, etc.
XSIApplication is an intrinsic object that represents the running
instance of the Softimage application. An intrinsic (global) object
is one that you can refer to by name in your code without creating
an instance of it first; in this case the name is Application. In
other words, script writers can assume that there is a global
variable with the name 'Application' of type
'XSIApplication'.
However, within NetView scripts this object is not available as an
intrinsic so it is neccessary to explicitly create an instance of
the XSIApplication object. The
scripting syntax for explicitly creating an XSIApplication object
within NetView is illustrated below in the examples.
In normal (non-Netview) VBScript and JScript code it is possible to
drop the "Application." prefix and call methods and properties of
this object directly. For example calling "LogMessage" is actually
a short form for "Application.LogMessage". This syntactic shortcut
is not available to Python or PerlScript.
It is also possible to invoke all Softimage Commands as if they were methods of
XSIApplication. This is the best way to invoke commands inside
Python and PerlScript and for all script languages that run inside
Netview.
' ' hello world from vbscript ' Application.LogMessage "Hello Softimage world" 'In vbscript we don't need to specify 'the Application. prefix LogMessage "Shortcut of Hello World" |
' ' How to create an instance of the Application Object ' from VBScript for use within a NetView html page. ' Dim oApplication set oApplication = CreateObject("XSI.Application") 'Use SIObject.Application to convert from Application object 'to XSIApplication Dim oXSIApplication set oXSIApplication = oApplication.Application oXSIApplication.Application.LogMessage "Hello from Netview" |
/* hello world from jscript */ Application.LogMessage("Hello Softimage world"); //This shortcut is equivalent LogMessage("Hello from ShortCut code"); |
/* How to create an instance of the Application Object from JScript for use within a NetView html page. */ var oApplication = new ActiveXObject("XSI.Application"); var oXSIApplication = oApplication.Application; oXSIApplication.LogMessage( "There are " + oXSIApplication.Plugins.Count + " plugins installed" ) ; |
# # hello world from pythonscript # Application.LogMessage("Hello Softimage world") |
#Python script example, using the global Application #object to invoke the NewScene command. Application.NewScene( "",0 ) |
# # How to create an instance of the Application Object # from pythonscript for use within a NetView html page. # # Normally you create a instance of an automation object using: # import win32com.client; # o=win32com.client.Dispatch('XSI.Application') # however win32com is not a trusted module so you get around # this by defining a vbscript function called getXSIApp() # that returns the Application object. try : Application = window.getXSIApp() except : print("No browser") # Note: Python is not a fully functional choice for web programming. # We recommend writing the Python code as Softimage Custom Commands # which are invoked using a little JScript or VBScript embedded in the # html. |