Really cool, I like it a lot. Definitely gonna bind this to some hotkeys.
Some crits if you don’t mind:
It is a bit counterintuitive as to what it selects (i.e. if I have a vertex at the left rim of a sphere in the viewport it can start pickwalking upwards if I set it to “right” - perfectly logical but not what one would intuitively expect) but this is all in the nature of how it works (which is a really cool idea btw).
It’s also a bit slow when the selection starts growing - this might be caused by the creation of all the groups or it might also be caused by the xform command (which is ridiculously slow but alas afaik there’s no faster alternative - I think pointPosition is just as slow). Here’s a few optimization tips:
1 You could take the original selection and use [size=2]polySelectConstraint -pp 3; to get the border vertices, and only use those in the main for loop instead of all the selected vertices - if you pickwalk a vertex that’s not a on the selection border, you’re allways gonna reselect a vertex that was already selected to begin with, aren’t you?[/size]
[size=2]2 This is a bit trickier but I think it’s gonna make a big speed difference: the script creates (n+1) transforms for every vertex, where n is the number of edges connected to that vertex, so if your selection consists of 10 quad vertices, 50 new transforms will be created am I right? You could skip the group creation entirely using a pointMatrixMult node. If you connect the camera’s worldInverseMatrix to the pointMatrixMult’s inMatrix attribute and set the pointMatrixMult’s inPoint attribute to the world space position of any vertex, the pointMatrixMult’s output attribute will store that vertex’ position in the cameras local space - same result as getting the translate attributes from your reference groups, but probably a lot faster. And you only need to create one pointMatrixMult node at the start of the script and then you can delete it at the end.[/size]
[size=2]And lastly a request: this script would totally kick ass if you could pickwalk any poly component type - vertex, edge, face, UV. It shouldn’t be too hard if you convert e.g. faces to vertices first, run the pickwalk loop, and then convert back to face using polylistComponentConversion -fromVertex -toFace -internal.[/size]
[size=2]Thanks for a great script, mate.