This plug-in shows how to use C# as a scripting language from the Scripting Editor. You can use it when you need to test some simple C# code in Softimage without having to create a plug-in. To use C# scripting, just add a Script.Main method entry-point in the Scripting Editor, type C# code in the Main function and Run the code by right-clicking the C# Scripting | Run menu in the Scripting Editor window.
E.g.:class Script { public static void Main() { // Code goes here } }
The C# scripting menu contains the following entries:
Location | |
Files |
CSharpScripting.csproj
CSharpScripting.cs
|
To install the example
Connect to the Softimage SDK workgroup at %XSISDK_ROOT%\examples\workgroup.
To view the help page for an example
To run the example
public static void Main() { CXSIApplicationClass xsi = new CXSIApplicationClass(); xsi.LogMessage( "Called From Main", siSeverity.siInfo ); }
Softimage SDK includes a compiled version of C# Scripting. If you want to modify the code, you can rebuild the example by following these instructions.
To build the example on Windows
Open an Softimage command prompt, and type devenv to start Visual Studio .NET.
Starting Visual Studio .NET from an Softimage command prompt ensures that environment variables such as XSI_USERHOME are set (otherwise you'll get build and link errors).
Tip To load the CSharpScripting project from the command line, type:
devenv src\CSharpScripting.csproj
This example uses the following keywords:
C#, RegisterCommand, RegisterMenu, View.