So as far as the practical difference between evalDeferred() and executeDeferred() in Maya goes... it sounds like they differ in what they return, and that the latter doesn't work in batch mode...?
On Thu, Apr 17, 2014 at 10:31 AM, Brad Friedman <[email protected]> wrote: > By googling "python eval exec". Or even looking at the python docs on the > eval and exec calls themselves which explain the low level calls that are > being exposed in the first place. > > On Apr 17, 2014, at 11:21 AM, Marcus Ottosson <[email protected]> > wrote: > > Interesting! Where can I find these discussions? > > On Thursday, April 17, 2014, Brad Friedman <[email protected]> wrote: > >> That's a python thing. There's a lot of discussion on eval vs exec as >> they're a pair of low level calls that end up exposed together. You also >> run into it a lot when embedding python. The biggest difference is return >> value. There are also potential differences in scope. >> >> On Apr 17, 2014, at 10:46 AM, Tim Crowson <[email protected]> wrote: >> >> I'm seeing another example that uses utils.executeDeferred() rather than >> cmds.evalDeferred(). What's the difference between these two? >> >> >> On Thu, Apr 17, 2014 at 9:37 AM, Tony Barbieri <[email protected]>wrote: >> >> Np! I'll do my best to help out with additional questions :). This list >> is pretty active so I'm sure someone will be able to help. >> >> >> On Thu, Apr 17, 2014 at 10:19 AM, Tim Crowson <[email protected]> wrote: >> >> Gotcha! Thanks Tony! Nice to see a familiar face too. I'm sure I'll have >> plenty more questions as I progress... >> >> >> On Thu, Apr 17, 2014 at 9:18 AM, Tony Barbieri <[email protected]>wrote: >> >> Hey Tim, >> >> You'll want to use evalDeferred. So for your example above, instead of >> calling buildMenu directly in the userSetup.py, call it like: >> >> >> # Defer our startup commands until after Maya has finished loading >> # completely. >> cmds.evalDeferred("buildMenu()") >> >> notice that "buildMenu()" is a string. >> >> >> >> On Thu, Apr 17, 2014 at 10:08 AM, Tim Crowson <[email protected]> wrote: >> >> Hello all, I'm a Softimage user needing to move over and get familiar >> with Maya. I apologize in advance if I post any stupid questions. Does this >> list have its own search function? I looked for one but couldn't find any. >> >> I'm using Maya 2015 on Windows at the moment and I'm having trouble with >> my userSetup.py file. Basically, I want to create a custom menu in the menu >> bar at launch. After googling some tutorials on the matter, I have code >> that works great when fired from the the script editor, but when run at >> launch, it bombs. Basically my function to build the window is unable to >> get a handle on the main Maya window... it gets returned as *NoneType*. >> The relevant part of my code looks something like this: >> >> >> def buildMenu(): >> ptr = mui.MQtUtil.mainWindow() >> mayaWindow = shiboken.wrapInstance(long(ptr), QtGui.QWidget) >> >> mainMenu = cmds.menu('MyMenu', p=mayaWindow, l='My Menu') >> cmds.menuItem(p=mainMenu >> >> -- >> 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/6E9179D0-F7BF-497B-9B99-9B8AD96FDF1D%40fie.us<https://groups.google.com/d/msgid/python_inside_maya/6E9179D0-F7BF-497B-9B99-9B8AD96FDF1D%40fie.us?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > > -- > *Marcus Ottosson* > [email protected] > > -- > 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/CAFRtmOAndq_jrruoyk3i2crewd-Fc8FkfQ2vd4BHRJ_Rs5iv2A%40mail.gmail.com<https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAndq_jrruoyk3i2crewd-Fc8FkfQ2vd4BHRJ_Rs5iv2A%40mail.gmail.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/A349A738-19C0-457C-858D-AC7ACB693041%40fie.us<https://groups.google.com/d/msgid/python_inside_maya/A349A738-19C0-457C-858D-AC7ACB693041%40fie.us?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/CAPh%3D1bnzU-0NjwGkd9gDJqqjWyozN30LG-Msv9Fn_YNCOdQreQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
