|
Video Collage, Inc.
|
SWC Library OverviewThe SWC library is a layer which sits above the SAA library, the actual SAAPHIRE procedures. It is probably of the most use when writing standalones, especially if one is working with multiple scenes and databases. SWC procedures have TK widgets for interactive selection of objects built-in and they store the resulting selection as an object, including the selections scene, database and resource. The SWC library is implemented entirely in Tcl. It's code can be found in SI_LOCATION/3D/custom/SoftWish/SWC_library. All Softimage objects exists in an implicit hierarchy consisting of objects and places where those objects get stored. To access the attributes of an Element, such as a camera or light, it has to belong to a Scene which in turn belongs to a Database, which in turn is defined within a Resource File.
The SWC Library procedures treat such hierarchies as "context" objects. A context can consist of a resource file, or a database and it's resource file, or a scene, it's database, and that database's resource file, or an element, it's scene, the scenes database and the databases resource file. Contexts should be thought of as containers for any Softimage object. Softimage objects have attributes, for instance a camera has an FStop attribute. To access a camera's FStop using SWC, one creates a context of the camera (which is the camera, it's scene, the scene's database and the databases resource file) and then sets the context. Note that whereas one can refer to a context's attributes, what is really meant is the attributes of the object the context contains. SWC contexts are slightly more restrictive than Softimage Interactive and SAAPHIRE are in that you cannot get elements which do not belong to a scene. However you can always load such objects with SAA_SAA_ (or load them interactively if you are not in a standalone) and then use contexts to access them. Contexts preserve attributes of all levels of the hierarchy above the level which is being changed. This means that if one has a light in a context, and one uses that context, unchanged, to get a model, then the model will be looked for in the same scene and database that the light came from. Contexts can be incomplete. When getting an object from a current scene which has not been saved to any database the objects context will not contain a scene, database or resource file. The user will be prompted for these when the object gets saved. SWC callsSWC data |