Substance Painter
In this start to finish texturing project within Substance Painter we cover all the techniques you need to texture the robot character.
# 1 18-03-2015 , 03:44 AM
Registered User
Join Date: Sep 2014
Posts: 1

Pymel, get connected vertices from a meshFace

hi, I am trying to get connected vertices from a meshFace.
I can get a MeshVertex list of the connected vertices but I can't access to element of the returned list.
My first question is how to access to list element?

The returned list is >>>pPlaneShape2.vtx[72:73,102,105,133,136,165:166] but I don't really understand the information returned. I was expecting to get the index of 4 vertices that are connected to my face like >>>pPlaneShape2.vtx[102,105,133,136] , instead I have 6 index with some weird ":" things.. Does someone knows what it means?

thx


Code:
from pymel.core import *

plane = ls('pPlane2')[0].getShape()

faceSample =  plane.f[100]
cvtx= face.connectedVertices()
print (cvtx)
>>>pPlaneShape2.vtx[72:73,102,105,133,136,165:166]

print (cvtx[0])
>>># Error: line 1: IndexError: file C:\Program Files\Autodesk\Maya2015\Python\lib\site-packages\pymel\core\general.py line 4400: Indexing only allowed on an incompletely specified component (ie, 'cube.vtx') #

# 2 18-03-2015 , 03:31 PM
EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
The colon specifies a range, so you've got 72 to 73 and 165 to 166. Because they're consecutive, it doesn't make much sense (only 2 in the range), but with other values you might have 72:78, meaning 72 through 78. I don't know why it returns 8 vertices.

# 3 19-03-2015 , 02:40 AM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988


Imagination is more important than knowledge.
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads