Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

MAXSCRIPT: can selected vertex arrays be un-sorted ?

MAXSCRIPT: can selected vertex arrays be un-sorted ?

sales
Advocate Advocate
1,207 Views
6 Replies
Message 1 of 7

MAXSCRIPT: can selected vertex arrays be un-sorted ?

sales
Advocate
Advocate

Hi !

When using $.selectedVerts on an editable poly I if the vertices are  in this order :...1,6,5,4,3,2...

I still get an array with this order: 1,2,3,4,5,6 but I must have the array excatly as the vertices are ordered in the geomtery (need to apply a loop on them)

 

Is there a way ?

 

TIA

 

NIR

0 Likes
1,208 Views
6 Replies
Replies (6)
Message 2 of 7

miauuuu
Collaborator
Collaborator

No. You will always receive a bitarray of selected verts, edges, faces.

No matter which command you will use to get the selected sub-objects the result will always be a bitarray, which means "sorted".

https://miauu-maxscript.com/
0 Likes
Message 3 of 7

sales
Advocate
Advocate

Kostadin

Hi and thx

Actually I wanted to send you an email regarding this issue - mybe you could complete my code and add to your Collection !

 

 

 

Nir

0 Likes
Message 4 of 7

miauuuu
Collaborator
Collaborator

I don't have much time these days, because I have to finish another project, but you can send me your code and I can see what can be done.

https://miauu-maxscript.com/
0 Likes
Message 5 of 7

kevinvandecar
Community Manager
Community Manager

Yes, as miauuuu says it will not be orerded according to geometry. You will have to run through the selected vertex list and then compare back to the geometry ordering itself.

 

This case was escalated to support, so if you are satisfied by the reply of miauuuu, please accept as solution and give kudos to them! 🙂

 

thanks, and hope it helps,

kevin

 


Kevin Vandecar
Developer Technical Services
Autodesk Developer Network



0 Likes
Message 6 of 7

Anonymous
Not applicable

Kevin, maybe I am missunderstanding you, but how do you get the geomety order. I need somthing simular, but the difference is that  I am getting the vertices from a selected face, using polyop.getVertsUsingFace. With this method, this also sorts the vertices from lowest to highest, which is sometimes not the construction order.

0 Likes
Message 7 of 7

Swordslayer
Advisor
Advisor

From the maxscript reference:

 

polyop.getFaceVerts <Poly poly> <int face>

Returns the face's vertices as an array. The order of the vertices in the array corresponds to the order of the vertices in the face.

0 Likes