Context Filters

Topic: version 4 MAXScript New Features/Context Filters

Filter functions for context-sensitive menus.

Use this for .IsEnabled or .IsVisible handlers in macrocripts. isEnabled and isChecked handlers have been added to many of the existingmacroScripts. All of the modifier, creation and polygon toolbox macroScripts have these two handlers.

These handlers allow object creation CUI buttons to turn green while creating objects, and modifier buttons are only enabled if they apply to the current selection. The polygon toolbox buttons also only enable when applicable, and the selection level buttons stay pressed while in the sub-object level.

This structure is defined in .\stdplugs\stdscripts\FilterFunctions.ms.

An example use of the filter functions can be found in the Selection and Display Callbacks Script File, .\stdplugs\stdscripts\Selection_Display_Filters.ms

#Struct:Filters(

Is_EditMesh:<fn>,

Is_NURBS:<fn>,

Is_EditPoly:<fn>,

Is_EditPatch:<fn>,

Is_EditSpline:<fn>,

Is_MeshSelect:<fn>,

Is_PolySelect:<fn>,

Is_SplineSelect:<fn>,

Is_PatchSelect:<fn>,

Is_PosXYZ:<fn>,

Is_RotationXYZ:<fn>,

Is_ScaleXYZ:<fn>,

is_Child:<fn>,

This is used for the new IK assignments.

is_Parent:<fn>,

This is used for the new IK assignments.

CanSwitchTo_XXXX for SubObject levels:

CanSwitchTo_Vertex:<fn>,

CanSwitchTo_Edge:<fn>,

CanSwitchTo_Face:<fn>,

CanSwitchTo_Polygon:<fn>,

CanSwitchTo_Element:<fn>,

CanSwitchTo_Border:<fn>,

CanSwitchTo_Patch:<fn>,

CanSwitchTo_Segment:<fn>,

CanSwitchTo_Spline:<fn>,

These can be used to check if MeshSelect, PatchSelect, SplineSelect, Edit(able) Patch, Edit(able)Mesh, and Edit(able)Spline can go into these subobject levels.

Are_Modifiers_Applied:<fn>,

The following requires a node to be passed into the function:

Is_Bone:<fn>,

Is_IKChain:<fn>,

Is_Point:<fn>,

Is_Light:<fn>,

Is_Camera:<fn>)

These return true if the selected object's function name condition is met.

See also