This example shows how to use a custom property (a set of custom parameters) to build a user interface for a plug-in. The example is not a functional user interface, but rather a demonstration of UI capabilities such as:
The example shows how to implement a custom property as a self-installing plug-in (in either JScript or C++) or as a SPDL-based plug-in. JScript is a quick and convenient way to add a user interface to your custom Softimage tools, but C++ developers may prefer to use C++. SPDL has generally been replaced by self-installing custom properties, but for purposes of comparison, a SPDL example is included.
Note This example does not demonstrate every type of UI control. For example, the example custom property does not include grid, and fcurve controls. See the SDK Customization Guide for a full list of the available controls.
To create your own custom property, you can use the Custom Property Wizard to get started.
Location | |
Files |
PSetUIDemoJScript.js
PSetUIDemoCPP.cpp
PSetUIDemo.spdl
GNUmakefile
PSetUIDemoCPP.vcproj
logo.bmp
|
To see the self-installing custom property (JScript or C++ version)
Do one of the following:
Create an instance of the custom property using SceneItem.AddProperty and then open the property page with InspectObj:
// JScript // Create an instance of the JScript custom property var oCustomProperty = ActiveSceneRoot.AddProperty( "PSetUIDemoJscript",false ) ; InspectObj( oCustomProperty ) ; ' VBscript ' Create an instance of the C++ custom property set oPSet = ActiveSceneRoot.AddProperty( "PSetUIDemoCPP" ) InspectObj oPSet
Click one of these links: PSetUIDemoJscript or PSetUIDemoCPP
These links run the scripting code given above for you.
To see the SPDL version of the custom property
' VBscript
Dim rtn, oProp, oParam
SelectObj "Scene_Root"
SIAddProp "PSetUIDemo", , , , rtn
InspectObj "PSetUIDemo"
The Softimage SDK includes a compiled version of PSetUIDemoCPP. 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 XSISDK_ROOT are set (otherwise you'll get build and link errors).
Tip To load the PSetUIDemoCPP project from the command line, type:
devenv PSetUIDemoCPP.vcproj
To build the example on Linux
In a shell (tcsh) window, type:
source $XSI_HOME/.xsi_<xsi_version>
Change directories to
cppsrc
To remove all intermediate files before building the example, run this command:
gmake clean
To compile the example, run this command:
gmake
This example uses the following keywords:
C++ example, SPDL, RegisterProperty, RegisterMenu, Parameter, CustomProperty, AddParameter, Define, DefineLayout, PPGEvent, PPGEventContext, GetEventID, siParameterChange, siTabChange, siButtonClicked, siOnInit, PPGLayout, PPGItem, AddTab, AddGroup, AddRow, EndGroup, EndRow, AddItem, PutAttribute, siUIThumbWheel, siUIImageFile, siUIOpenFile, siUIFileMustExist, siUIInitialDir, siUISubFolder, siPPGItemAttribute, AddString, AddButton, PutWidthPercentage, AddEnumControl, AddStaticText, PutParameterValue, GetPPGLayout, ExecuteCommand, GetAsText, siTabChange, siParameterChange, GetAttribute, Button, Tab, PutParameterValue, AddCallbackItem, SetAttribute, AddColor, AddEnumControl, siControlCombo, UIItems, AddSpacer, AddProperty