A modifier that supports sub-object selection can choose to support named sub-object selection sets. This allows the user to save and restore certain sub-object selection sets and not have to pick them over and over. The modifier indicates it wishes to do so by returning TRUE from BaseObject::SupportsNamedSubSels()
.
A modifier that wishes to support this capability maintains its list of named sub-object selections. When the user enters sub-object selection mode the modifier should add its named selection sets into the drop down by overriding the method Interface::AppendSubObjectNamedSelSet()
.
A modifier may call this method to add sub-object named selection sets to the named selection set drop down list in the 3ds Max tool bar. This should be done whenever the selection level changes (in the Modifiers BaseObject::ActivateSubobjSel()
method).
The following methods of BaseObject
are called when the user picks items from the drop down list:
BaseObject::ActivateSubSelSet()
- When the user chooses a name from the drop down list this method is called. The plug-in should respond by selecting the set identified by the name passed.BaseObject::NewSetFromCurSel()
- If the user types a new name into the named selection set drop down then this method is called. The plug-in should respond by creating a new set and give it the specified name.BaseObject::RemoveSubSelSet()
- If the user selects a set from the drop down and then chooses Remove Named Selections from the Edit menu this method is called. The plug-in should respond by removing the specified selection set.The following methods from Interface
class also deal with named sub-object selection sets:
Interface::ClearSubObjectNamedSelSets()
- Clears the named selections from the drop down.Interface::ClearCurNamedSelSet()
- Clears the current edit field of the named selection set drop down.For sample code that deals with named sub-object selection sets see \MAXSDK\SAMPLES\MODIFIERS\EDITMESH.CPP .