Say goodbye to scripts that only work with Editable Poly and not Edit Poly modifier. PolyModOp is a MAXScript struct wrapping the Edit Poly methods using the familiar signatures of the polyop methods. That means you check once at the beginning what kind of object you are dealing with, pick either polyop or polymodop, and the rest of the code will be the same as if you were writing it for Editable Poly.
See the Border Fill script for an example tool (the main aim is ease of coding and maintainability, so don't expect it to work lightning fast on complex meshes). Released under ISC license to be as permissive as possible (in short do what you will with it, just don't blame me for the result). The methods that are not implemented are listed in the missing_methods text file.
If you think think the current way of working with the Edit poly modifier is limited and should be changed, and you want a better solution, be sure to vote up PolyModOp functions same way as PolyOp functions at 3ds Max Ideas.

Comments (6)
Comment policy
Undo commit functions
Hi, "Undo" does not work in functions that use commit() commands. Is there a solution to this problem?
Edit Spline modifier
That's a great idea. Maybe you know how to do the same with the Edit Spline modifier?
Or at least some instructions on how to work with the Edit Spline modifier?
Damn , is there any way to make maxscript using this as additional autocomplete, like in VS editor ?
I'd write it using polyop. and search&replace in the end. After all, the methods are the same for both.
Thanks!
Thanks Vojtech! That's awesome. I'd been wanting something similar for a long time but just didn't get around to it. Thanks for sharing :)
Sure thing
I was using it for quite a few years and got so accustomed to it that when I shared scripts like the Heuristic Edge Select, I just ripped parts of the polymodop struct out instead of rewriting the script for public consumption. Recently, I found those ripped-out parts attached among other MXS related tips in a Russian vkontakte post, thought that it's nice to see that someone takes notice and decided to share the whole thing. That small part was not really that much helpful anyway.
And it's always nicer to have an Edit poly version that comes at no additional effort - and might be slower than if you coded it specifically for Edit poly - than no Edit poly version at all. Well, not exactly no effort as you have to use pure polyop stuff, so instead of shorthands like
use
and if there are any non-polyop methods involved that differ between Edit poly and Editable poly (like
), you have to handle those yourself - but that's about it and when you get used to writing scripts this way, it eventually really becomes no effort.