Sub-Object Selection
 
 
 

If the modifier supports sub-object selection, the plug-in must provide methods to allow the system to manipulate the sub-object components of the modifier. When a modifier's parameters are being edited, it has the option of providing the system with different levels of sub-object selection. There are two types of sub-object selection:

  1. Selection of a modifier's Gizmo or Center - A modifier can have a visual representation in the scene which users can manipulate called a gizmo. This can be something as simple as a 3D box or something more complex like an FFD lattice. The Bend modifier uses a 3D box. When Gizmo is selected in the sub-object selection list of Max's UI, the user can transform the modifier's gizmo itself -- that is, they can adjust its location, orientation, and scale in relation to the object it is affecting. When Center is selected in the list, they can transform the pivot point of the modifier's gizmo. For example, if you want a bend to occur about the base of the Bend gizmo, you could move the center to the base of the gizmo.
  2. Selection of components in the pipeline - The second type of sub-object selection is selection of components of the object flowing through the pipeline. If the object in the pipeline is a triangle object, then sub-object selection level might be things like vertex, face, edge, etc. These are options for the Edit Mesh modifier, for instance.

A modifier notifies the system of the sub-object selection levels that it provides when the modifier's Animatable::BeginEditParams() method is called.

The Bend modifier for example has sub-object levels for Gizmo and Center. When the user enters sub-object level they expect the standard tool bar translation tools will work for adjusting the sub-object components, for instance moving the center or scaling the gizmo.

When the user changes the selection of the sub-object drop down, the modifier is notified. At the time of the notification, the modifier is expected to provide an instance of a class derived from CommandMode to support move, rotate, uniform scale, non-uniform scale, and squash modes. These modes replace their object level counterparts, although the user still uses the move/rotate/scale tool buttons in the tool bar to activate these modes. A plug-in developer does not need to support all of these modes. For example, they may just support move because rotate and scale don't apply to the specific plug-in type. Any modes that the plug-in doesn't support will be grayed out in the toolbar.

In addition to move/rotate/scale, a plug-in can always have other modes. For instance, the Edit Mesh modifier has an extrude mode where the user can click and drag to interactively extrude faces of a mesh.