| Item | Quantity | Price |
|---|
| Your cart is empty. Check out our collection of 3d models! |
Prices in:
Clear Cart
I added codes like:
mc.ls(selection=True) and even variables.
items = mc.ls(selection=True)
to hold the items even in that one button but to no luck. =/
1 | import maya.cmds as mc |
Wow, thank you so much Joojaa!
I've never heard of the *args flag before. I'll have to look it up.
It works briliantly. Time to add further functions now that I'm back on track.
Seriously...THANK YOU!
Just so you understand maya has this feature built-in just not the buttons gui (but in fact you get them in outlliner as buttons). So perhaps better to use those instead (quick selection sets), then maya remembers your settings form session to session, scene to scene.
Second you have a hard to find bug in your code, i didnt fix it because frankly its best if you find out by yourself. Basically your neglecting to tell maya where you want the button created, yeah maya does it properly because no outer UI is built interim. But if it is then your gui instantly stops working. And that is why you have the *args there so you can figure it out, or not and then hard code stuff in like yoru doing at the moment (bad programming practice but then your scripting).
Yeah I have noticed that, I get a runtimeerror everytime I make a button. I'll have to work on this a bit more.
Thanks for getting me going in the right direction! And i would definitely like maya to have things memorized, I'll have to read up on all that. I'll be updating you all over summer.
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!