class id filter
In the Selection filters/Combos filter, you can add class id filters in addition to registering superclassid filters. The bottom left list box
displays a list of all helper and geometry class ids. To add a filter, select an entry
from the list and hit the add button below the list box. The filter will appear in
the lower right list box. This list displays all of the current class id filters.
Once OK is pressed, the select filter drop down contains those class ids that were
added.
You can also register custom scripted functions as filters through a callback in MAXScript:
Methods
registerSelectFilterCallback <filterFunction> <name>
Registers a custom selection filter. The 2 parameters are the filter function to be
registered and the name of the filter to appear in the selection filter drop down
list.
The filter function itself expects one parameter which is the node to be checked.
FOR EXAMPLE
|
If you want to filter only objects that are renderable (in other words have their
node-level Renderable property set to true / Renderable box checked in Properties
dialog), you can register the following function:
|
fn filterRenderableCallback node = --the node to be filtered is passed as argument
(
node.renderable --return true if the node is renderable
)
--Register the function as Select filter Callback function --The filter will appear under the name "Renderable":
registerSelectFilterCallback filterRenderableCallback "Renderable"
--To see how it works, execute the code below to generate 10 boxes --with random .renderable state
for i = 1 to 10 do
b = box pos:[i*30,0,0] renderable:((random 0.0 1.0) <0.5 )
--Now select the filter "Renderable" from the drop-down list and try --to select all 10 boxes - only those that are renderable will --be selected!
|
Prototype:
unregisterSelectFilterCallback <filterFunction>
Removes the specified callback function from the list of selection filters.
FOR EXAMPLE
|
unregisterSelectFilterCallback filterRenderableCallback
|