View Full Version : scripting in XSI
07-29-2008, 04:58 PM
so, I am starting to get into XSI and going thru their scripting system.
What I am trying to find right now is how you build GUIs for your tools. are there a set of internal commands to build them, does it use an external system like TK or QT, or is it something totally different?
07-29-2008, 05:36 PM
There's a handful of things.
The first things to look for in the manual are custom properties (similar to maya gui layouts, except for some annoying shortcomings when they are created on the fly).
Custom properties can be created and managed on the fly, and be made modal if need be, which is the common way to deal with transient GUIs and control/options panel.
If you need something persistant things are usually registered. In that case the most common way to do it is write a self-installing plugin, which can create, lay out and persist properties.
There are other things like spdls and presets, but they are largely obsolete/legacy for custom gui work other than MRay shaders.
Style wise it's fairly different from maya. I prefer Maya's for transient stuff, but for registered/persistant, bar the lack of a colour and vector widget, I prefer XSI.
Conceptually they are mostly callback based ala wx if you want, but without a main event loop (or rather it's transparent), and with the layout part detached and controllable after composition.
Definitely start from custom properties and self installing plugins in the sdk manual, it should get you started.
07-30-2008, 04:41 AM
thanks Jaco, will take a look
07-30-2008, 11:49 AM
For custom tools, you can create a combination of Custom Commands, Custom Properties and Custom Operators. The SKD Wizard and the SDK examples are your friends.
The workflow the I find most efficient is to develop your tool as a scripted operator first (in the case of a live operator) and then convert that into a plugin. Most of the code would be reusable with minor changes.
a nice way to keep track of objects:
Ctrl+shift+4 brings the SDK explorer.
You can select objects in the explorer on the left, and it will list the supported Object Model interface with a link to the help pages and etc...
The "Nested Objects" field is also a way to find if what you are looking for is inside of that object...
On the creation of GUIs, using wizards is the easy path.
To start with that, go in the file>plugin-manager, now you can right-click on one of the roots and make a "new addon directory". Now inside of the direcory you right-click again in the "plugins" folder and you can start the wizards to create properties, commands, ops, events, filters, etc... Those are the registered plugins. The SDK will create a file with all the callbacks for that type of plugin.
You can create a property and put all the logic on the same file, or create a separate Command. A Command can also create a PPG on the fly if you want... theres examples in the SDK docs.. search for the "PPG" and "Command" classes and you should find everything you need.
08-01-2008, 02:03 PM
The SDK wizards themselves are examples of how to build a UI using the XSI SDK.
The source code for the wizards is in Addons\sdkui.
08-01-2008, 02:03 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2014, Jelsoft Enterprises Ltd.