Max Script : .getSelectedEdges() not working on uv edge seams?

Hi,

I want to do some simple edge loop in my uvs and it looks like the only function for it is :

<void><Unwrap_UVW>.uvEdgeSelect()

Problem is : It works perfectly fine unless you want to do it on an edge seam. In that case the function will return “OK” but won’t bother making any edge loop.

The — loop button in the unwrap UI don’t have any issue with this, why would this be different ?

Does any of you know a way to make it work (or is it a bug ?).

I am about to do my loop in the geo and then get map vert from geo vert but it would make my life easier if there was a way to edge loop in the uv on a seam, via maxscript.

Thanks !

Oh man… Welcome to a deep, dark, angry rabbit hole of 3DS Max.

Geo edges and UV edges are separate concepts, so <EditablePoly>.getSelectedEdges() won’t work directly. Further complicating matters is that “edges” don’t really matter, verts do.

If I remember when and where I had to do this, I’ll get back to you. The pseudocode looks something like this:


In EditablePoly, given an input list of edges, get the edge loop for the input edge list
Get all the verts for those edges
Store off the vert indices for all the edges you have selected
Add an Unwrap_UVW modifier to the stack
Call <Unwrap_UVW>.setSelectedGeomVets #{geo vert indicies}
Convert selection to UV edges using <Unwrap_UVW>.vertToEdgeSelect()
???
Profit

I think, but I remember all the geomvert/geomedge functions being finicky at best.

Yep, couldnt get this <void><Unwrap_UVW>.uvEdgeSelect() working correctly at all.

So I ended up go back in my geo, doing my edge loop in geo, get vert from edges, then getting mapvert from geovert … I ended up with the same result that if <void><Unwrap_UVW>.uvEdgeSelect() were actually working correctly …

Got my stuff working in the end, but such a pain, all of this just because <void><Unwrap_UVW>.uvEdgeSelect() don’t want to work on border edges.