Hi, I need some help on a mel script, I hope someone can take a bit of time to look at my code and tell me why it doesn't work and how to fix it. I suspect it could even be a Maya bug... What I am trying to do it create buttons dynamically on the fly using a '+' button. The '+' button will create a new button when I click…
try use evalDeferred, I found maya crash a lot when UI is not react fast enough to the command. use evalDeferred can help maya have enough time to do it's job. global proc on_delete_button(int $button_number){ global string $buttons[]; print2("Delete button number " + $button_number); string $delete_button =…
Hi Panupat, really appreciate your taking the time to figure this out with me :3 I tried printed out the name and delete manually from the script editor too, somehow it works :o I am redesigning the operation of the buttons a bit so the buttons are marked to be deleted and all buttons will be redrawn (minus the ones marked…
I think I narrowed down the cause to the redraw function. Deleting and recreating that + button is what causing the crash. Why I'm not sure, but I think the easiest solution is to create that + button as the first button and then leave it alone in peace. https://pastebin.com/Xv1jB90U EDIT. For some reason, after restarting…
Interesting. Yes this time it crashed... last I tested before replying it worked. Not sure what I did there besudes adding the flag.Weird thing is when I tried printing out the button name and run separate MEL command with copy/pasted name, it worked. button to delete ->…
You need -control flag to remove the button. I found 2 incorrect instances. deleteUI -control $delete_button; deleteUI -control $add_button; Maya really crashed when you miss that flag. So extreme for such simple mistake... more reason to go Python Qt right :D