So currently for a project for school I'm creating my own, VERY BASIC and generic GUI picker.
Concept so far is that a window opens with just the one button --> 'New Button..'
It runs the command to make a new button, with a prompt to ask the name of the button and inserts it back into the GUI. Fantastic.
That's as far as I got. I want to be able to select the objects I want, create a new button and now the objects are associated with that button!
So if I de-select the objects and push the button it will pick them back up! Easy as it sounds that's ALL i need help with but I have a tight deadline.
But here's a visual shot on what the GUI will look like. And I added right click functionality but even those haven't been programmed yet. I don't want to do more until I figure out this problem!
import maya.cmds as mc
if mc.window("patelGUI", exists=True):
winName = mc.window("patelGUI")
mc.frameLayout(label="Create Buttons", collapsable=1)
mc.button(label="New Button...", command='newButton()')
mc.promptDialog(title="Button Name", message="Enter name:", button=['Ok', 'Cancel'], defaultButton='Ok', cancelButton='Cancel',dismissString='Cancel')
text = mc.promptDialog(query=True, text=True)
btn = mc.button(label = text, c="runSelect()")
popup = mc.popupMenu(parent=btn, ctl=False, button=3)
item1 = mc.menuItem(l='Add', c='addSelection')
item2 = mc.menuItem(l='Edit', c='editSelection')
mc.frameLayout(e = 1, visible = 1)