Notifications
Clear all

[Closed] getSelectedVerticesByNode() ?

How do we get the node parameter for “getSelectedVerticesByNode()”, or can someone show me an example of how to use this call.

i used to use the call .getSelectedVertices(), but i need to modify my code for use with multiple objects selected. Since .getSelectedVertices() returns an empty array when used when unwrapping several objects at the same time.

I’m using max 2010.

Thanks.

4 Replies
1 Reply
(@denist)
Joined: 1 year ago

Posts: 0

delete objects 
for k=1 to 3 do sphere mapCoords:on
select objects
modpanel.addmodtoselection (global uvw = UVWUnwrap()) ui:on
uvw.Edit()
for n in objects do 
(
 k = uvw.numberVerticesByNode n
 i = random 1 k
 j = random 1 k
 if i > j do swap i j   
 uvw.SelectVerticesByNode #{i..j} n
 format "% %
" n.name (uvw.getSelectedVerticesByNode n)
)


Thanks Denis,

But what if i don’t know what objects i have selected, or which i’m working with in a given selection? This is for a function that is used during the unwrap process.

Unless there is a call that i missed that allows you get node by vert, that i’m missing.

i would prefer to not have to use “isVertexSelected[b][b]ByNode()” throughout my selection to see if thats the node i’m working with, but if i must, i must.

It would just seem like a slowdown and overkill to do that everytime i run this function.

Thanks for your time.
[/b][/b]

to get nodes which are using current uvwunwrap (uvw in my sample) is easy.


nodes = refs.dependentNodes (refs.dependents uvw)[1]
nodes = for n in nodes where n.isselected collect n -- double check

after that you have go through all nodes in list and check their selection. It’s fast.
But you have to know that uvwunwrap returns selection per node in range of number of node verts.

when you call .getSelectedVertices in multi-selection case it returns you a selection of main node (usually first one).

ok, i’ll try to work this in. Thanks for looking into it.