MAXscript: getting sub-object selection from Poly_Select

Using MAX 2024. Trying to understand how to use Poly_Select from a script. If I create a new Editable Poly and then say switch to Polygon sub-obj mode and select a bunch of polys, polyOp.getFaceSelection $ correctly returns the polys I selected. If I then add a Poly_Select modifier on the stack, select it and go into its Poly mode and select a different set of polys, polyOp.getFaceSelection $ then returns an empty bitarray even though the mod panel correctly shows my newly selected polys. Clicking in the mod panel I can switch between the Editable Poly and the Poly Select, the selected polys change in the viewport and in the panel so the bitarray shouldn’t be empty.

The Poly_Select documentation seems to indicate you can change only selection behaviours from script, it doesn’t say anything about accessing the actual selected items. What am I missing?

Poly_Select has meshselect interface so you can use the related methods:

setFaceSelection $ $.modifiers[Poly_Select] -(getFaceSelection $ $.modifiers[Poly_Select])
1 Like

Thank you very much! Frustrating that the documentation for that is under the “Editable Mesh” heading, I would have never gone looking for it there. The docs admittedly do have a reference to Poly Select but the search function doesn’t bring that page up…