Maya GUI?
Hello guys
I am trying to create a small GUI in maya basically what I want it to do is create a image button that will create a tree and edit its attributes.... like move the tree in any direction, change it colour etc... I have this so far.. Code:
import maya.cmds as cmds That code is able to create a tree and edit some of its attributes. How would I be able to click the same button but creates a new tree but at a different position? Also it needs to have a function where it only allows a certain amount of trees so it cant be pressed so many times f How do I add an image to the button or make an image a button? Any help would be appreciated Thank you |
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>: |
All times are GMT. The time now is 10:54 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018