Thread: Maya GUI?
View Single Post
# 2 10-02-2014 , 07:41 PM
Registered User
Join Date: Feb 2014
Location: Winter Park, Fl.
Posts: 1
Are you looking to create the trees in a random position or define where you would like to put them when the button is pressed?

If you want to limit the number of trees than you could use a "count." You can set this in the code or have it changeable in a cmds.intFeild. So when you press the button it should increase the "count" value by one.
You can establish it simply at the top:

count = 0

Then in side of the code have an if statement that checks if the count is greater than or equal to the number you want it to stop at:

Code:
if count >= <some_value>:
     print "max tree limit"
else:
     <run the rest of the code>
     count += 1
For the button image you may want to use the "symbolButton" command which will let you use the "image=" flag and you can link the image from your directory. I hope some of this helps. Let me know about the placement and I'll see what I can do!


Last edited by Theatis; 10-02-2014 at 07:43 PM. Reason: Forgot to add code tags!