Selecting a Vertex using python

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  03 March 2013
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
  03 March 2013
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
  03 March 2013
This worked! thank you very much
  03 March 2013
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

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:08 PM.

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