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
Animru94
New Member
portfolio
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)

cmds.select(terrain.vtx[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
DrWeeny
Infiltatring the industry
portfolio
Alexis BAUDOIN
CFX / FX / TD
Paris, France
 
Join Date: May 2010
Posts: 140
you should write : cmds.select("terrain.vtx[0]")

If you miss the quotes, it will try to import some value from a class :
Code:
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
http://docs.python.org/2/tutorial/classes.html

bye bye, hope it help !
__________________
DrWeeny
My Blog
My Vimeo
LinkedIn
 
Old 03-29-2013, 12:11 AM   #3
Animru94
New Member
portfolio
United Kingdom
 
Join Date: Feb 2013
Posts: 12
This worked! thank you very much
 
Old 03-29-2013, 12:11 AM   #4
CGTalk Moderation
Expert
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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 02:48 AM.


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