What are Custom Properties?

In short, custom property sets hold data (as a set of parameters), custom property pages display data (in a dialog using user-interface controls), but they are closely tied together and are often referred to by the more generic term custom properties.

More specifically, a set of custom parameters defined as a CustomProperty object contains pure data. The layout for a property page is defined in conjunction with the parameter data as a PPGLayout object. The property page itself as a PPG object combines the information from the data and the layout and displays the information and any other custom controls, messages or images defined for that page.

The user can then view and modify the set of parameters defined on that custom property set along with using any logic defined for the dialog layout.

 

Not all property pages are tied to parameters that affect real scene data. For example, you can create parameters that hold temporary data only used for the duration of the property page, such as a Bimap Control that displays your company’s logo.

More about Custom Property Sets

A custom property set represents a set of related parameters that can be attached to a scene item, such as a 3D Object or the Scene_Root. The individual parameters can be standard data types (integers, booleans, doubles, strings) or more complex Softimage data types such as RGB/RGBA colors, fcurves and GridData (2-dimensional arrays).

 

Over the course of time a few different names have been used to describe these objects, including:

• Custom Property Sets

• Custom Parameter Sets

• CustomParamList

• Custom PSet

All these are equivalent to the custom property set (CustomProperty object) described in this section.

Custom properties are one of the most useful tools available to plug-in developers. These objects can be used to store custom ‘user’ data in a scene, centralize the control of other parameters (via Proxy Parameters and Marking Sets) and build user interfaces. For example, CustomProperty objects can be used to store Game Engine attributes inside a scene, or to display a dialog box with settings for an Import plug-in. Custom Properties make a large range of UI widgets available.

Creating Custom Properties

There are basically four ways to create custom properties. All these methods are valid, and which method you use depends on the purpose of your CustomProperty:

• Using the Interactive Tools in Softimage

• Using the On-the-Fly Approach

• Creating an instance of a Self-installing CustomProperty Plug-in (recommended for persistent data)

• Creating an instance of a CustomProperty defined in a SPDL file (supported for shaders, deprecated for other persistent-data plug-ins)

Interactive Tools

You can create custom property sets and pages from the user interface under the Animate > Create > Parameter menu. These are persisted in the scene but are not available to other scenes unless you explicitly save them as a preset.

Using the interactive tools is a great way to learn about custom property sets and to prototype, but you need to create an instance of a Self-installing CustomProperty Plug-in if you want a more sophisticated toolset.

For more information about using the interactive tools, see the Softimage user guide.

On-the-Fly

You can create custom property sets and pages from a script or C++ API custom command using the basic SIAddProp and SIAddCustomParameter commands or the more sophisticated CustomProperty, PPG, and PPGLayout objects.

If you are using a custom property set as a temporary dialog box, it is easy to create it on the fly and delete it afterwards. Any parameter data you create as part of this custom property set persists for the duration of the scene or until you explicitly delete it. However, you may need to install it as a Self-installing CustomProperty Plug-in in either of these two situations:

• If you want to reuse the same custom property in another scene.

• If you quit Softimage and then re-start it the layout for your custom property set is gone, even though the data contained in the custom properties is still there. If you inspect the property set the parameters all appear, but with no Logic (no buttons, since they are not associated with any parameters), and no special controls (such as Combo boxes).

 

On-the-Fly properties are defined directly on their owners in the implementation code, whereas self-installing custom properties are defined, installed, and then applied on their owner using the SceneItem.AddProperty method.

Self-installing CustomProperty Plug-in

The Autodesk Softimage SDK provides a rich toolset to define a self-installing custom property plug-in (sometimes called a plug-in-based CustomProperty). The custom property sets can be built in much the same way as the On-the-Fly properties; however, they are applied as if there is a preset defined on the system (using the SceneItem.AddProperty method) and are available to other scenes after the plug-in is installed.

CustomProperty defined in a SPDL file

You can use the SceneItem.AddProperty method to apply a custom property defined in an installed SPDL file in the same way as you apply a self-installing custom property. However, defining the property set and property page layout is not as easy and is more error-prone than using the object model.

For more information on defining and installing SPDL files, see SPDL Reference.

 

Using a SPDL file is no longer the recommended approach, but is being maintained for backwards compatibility. Creating a Self-installing CustomProperty Plug-in is the recommended approach.



Autodesk Softimage v7.5