- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
UPD: Ugh, serves me right for being lazy and grabbing UV reading code from previous script, instead of searching docs for proper way of doing it.
Should have used $.Unwrap_UVW.getVertexPosition t v
After a series of unfolds and welds, something happens with UVs.
For example, I'm getting vertex index from face, but max gives an error when I try to get this vert's coords.
$.Unwrap_UVW.GetVertexIndexFromFace 2 3
674
polyop.getMapVert $ 1 674
-- Runtime error: Mesh map vertex index out of range: < 1 or > 448: 674
-- MAXScript callstack:
-- thread data: threadID:3220
-- ------------------------------------------------------
-- [stack level: 0]
-- In top-level
Questions are:
1. How to detect it
Atm seems like I can check it by comparing these:
polyop.getNumMapVerts $ 1
448
$.Unwrap_UVW.NumberVertices()
688
2. How to solve it
So far only solution I found is to collapse the stack. Ideally, I would like a way that allows me to fix it with code, something clean and simple, similar to polyop.deleteIsoVerts $ for example.
3. How to prevent it
Only operations are unfold and weld on current selection
$.unwrap_UVW.unfoldMap 1 true
$.unwrap_UVW.weldSelected()Anything wrong with that, should I do it in some different way?
Attaching a max2021 file in case you like puzzles and willing to investigate.
Solved! Go to Solution.