On Mon, Jun 27, 2016 at 4:00 PM likage <[email protected]> wrote:
> Pardon the late reply and my slow progress in my code. > I had wanted to update and insert my latest code but have forgotten about > it. I chanced upon this code which is similar to what I had wanted but > still I am having trouble getting my program to 'wait' for user selection > before executing the rest of the program.. > > def printObject(objectList, *args): > objectName = cmds.optionMenu(objectList, query = True, value = True) > print objectName > > def showUI(): > ... > ... > validFormatsLs = cmds.optionMenu (label = 'Select a format') > cmds.button(label = "Print selected option", command = > partial(printObject, objectList)) > > > The fact that you call showUI() and show your window is waiting for input from the user. You have to rely fully on callbacks, as you are doing in your button push. Again, you could install a callback on the menu itself, to respond to the actual change, instead of a button push. > And as for the last question on getting the latest created node... > Currently in my program, there is a custom module which is something as > follows: *import createCam; createCam.newNode()* > Having that command does create a new node (this command is different from > cmds.camera()), however after its creation, it does not select the new node > and hence, I am hardcoding it in my current code which is not ideal case, > in the event if it is either selecting the wrong cam which has already > existed with the same name, or it will simply duplicate a new camera where > the naming could 'versioned up' - eg. newCam1, newCam2 etc > I must be missing something here. Why doesn't newNode() return the new node? > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/f3eab61e-28ca-4fca-bb36-da2125da547f%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/f3eab61e-28ca-4fca-bb36-da2125da547f%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3cGeYVJ6zz_3YYEJfS2P1N58R7VmeE_86pW%2BF-qNrHvg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
