Object Hierarchy | Related C++ Class: PPGLayout
The PPGLayout object represents the visual appearance of an object's state when it is inspected. (PPG is a common acronym for Property Page). The layout makes it possible to group objects together, use special controls, hide obsolete parameters, add Buttons and in general create a presentation of an object's state that is pleasing to the eye.
A Layout is modeled in Softimage as a linear list of PPGItem objects. Each PPGItem represents either a parameter in the inspected object, or a special UI item like a Tab or Button. In most cases the layout does not specify hard-coded pixel positions or dimensions for the PPGItems. Instead Softimage automatically draws the controls with a sensible layout. This allows the presentation to change in a pleasing manner when the user resizes the property page. However there is some support for providing hints, for example PPGItem.WidthPercentage, or even explicit sizes via PPGItem.SetAttribute.
Many different controls are available for use on a property page, see siPPGControlType. All controls can be added using PPGLayout.AddItem but convenience methods are provided for some of the most common controls, for example PPGLayout.AddColor.
Practically every built-in Softimage object has its own layout. However, if there is no specific layout, Softimage displays a default layout that lists all the parameters in a simple fashion.
Layouts are remembered in memory while Softimage is running. For internal objects they are reloaded from SPDL files when Softimage restarts. The layout for a CustomProperty object implemented as a PluginItem is defined by implementing the DefineLayout callback.
You cannot directly modify an existing layout structure, apart from adding new items at the end or changing the attributes of items already in the layout. However to modify a layout it is often reasonable to call PPGLayout.Clear and then rebuild the entire layout with the changes included. You can also use the Parameter.Enable method to hide parameters without removing them from the layout.
If the layout is changed from within Logic code (see PPGLayout.Logic) it is necessary to call PPG.Refresh to see the changes take effect.
Normally the layout is associated with an object that remains in the scene. However it is also possible to use this object to define the user interface of a temporary dialog box. For example a script can ask the user to specify some import or export options. This is done in conjunction with a temporary CustomProperty object and the InspectObj command. This approach is demonstrated in the following examples.
• See PPGLayout.1.js
• See PPGLayout.2.js
Autodesk Softimage 2011