Dead UV questions.

Dead UV questions.

dmitriy.shpilevoy
Collaborator Collaborator
1,372 Views
1 Reply
Message 1 of 2

Dead UV questions.

dmitriy.shpilevoy
Collaborator
Collaborator

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.

0 Likes
Accepted solutions (1)
1,373 Views
1 Reply
Reply (1)
Message 2 of 2

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

GetVertexIndexFromFace gives you the index corresponding to the current map state defined by the Unwrap_UVW. The Polyop method returns you data before the modifier. If you want to get the current map vertex position, use the current mesh and meshop methods.

meshop.getmapvert $.mesh
0 Likes