CGTalk > Software > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
Thread Tools Search this Thread Display Modes
Old 03-24-2013, 11:30 PM   #1
New Member
United Kingdom
Join Date: Feb 2013
Posts: 12
Selecting a Vertex using python

Heya, i am new to python, so sorry if this seems really basic and dumb.

I have created a polyplane and I am trying to select a vertex on it. This is what i have tried:

import maya.cmds as cmds

cmds.polyPlane(name = "terrain", sw=10, sh=10, w=5, h=5)[0])

I get this error:

# Error: AttributeError: 'list' object has no attribute 'vtx' #

Thanks for any help you can give
Old 03-26-2013, 08:35 PM   #2
Infiltatring the industry
Paris, France
Join Date: May 2010
Posts: 144
you should write :"terrain.vtx[0]")

If you miss the quotes, it will try to import some value from a class :
class Complex: def __init__(self, realpart, imagpart): self.r = realpart self.i = imagpart x = Complex(3.0, -4.5) x.r, x.i #It will print >>>(3.0, -4.5)

This example is from python doc

bye bye, hope it help !
My Blog
My Vimeo
Old 03-29-2013, 12:11 AM   #3
New Member
United Kingdom
Join Date: Feb 2013
Posts: 12
This worked! thank you very much
Old 03-29-2013, 12:11 AM   #4
CGTalk Moderation
CGTalk Forum Leader
Join Date: Sep 2003
Posts: 1,066,478
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 04:30 AM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.