Nice. You must have avoided using QString instances directly or handling QVariant return values. On Jan 30, 2013 8:01 PM, "Panupat Chongstitwattana" <[email protected]> wrote:
> Doing a little more test and I think you're right Justin. I guess I'm also > lucky that non of my older scripts break when I switched the api version. > > > On Wed, Jan 30, 2013 at 12:14 PM, Justin Israel <[email protected]>wrote: > >> Because Maya is one big persistent python session, when a script is >> imported, and inside of that script it imports sip, sip will now be in the >> sys.modules.Importing sip again from any other place will find it already >> imported and reference the same module. That means using setapi on sip in >> one spot will affect sip references everywhere. >> >> If it were pure python, then it would be possible to clear it from >> sys.modules and import again. But because sip is a dynamic shared object, I >> think it can only be loaded once. So that means whoever gets to sip first >> and sets the api, locks it up for the Maya session. >> >> So that means you should be able to set it to api 2 in your userSetup, >> but that would force every pyqt script that you run to conform to it. >> >> Maybe I am wrong though. >> >> >> On Wed, Jan 30, 2013 at 5:07 PM, Panupat Chongstitwattana < >> [email protected]> wrote: >> >>> Do I need to set the sip API in every scripts I call from Maya? I'm >>> curious because I often get errors saying the api version was already set. >>> Does that mean I can set the api version in userSetup.py and every scripts >>> will follow it? >>> >>> If I run my main script which sets api to version 2, do I also need to >>> set it in modules that I imported? Or will those modules still use api >>> version 1? >>> >>> -- >>> 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 post to this group, send email to [email protected] >>> . >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >>> >> >> -- >> 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 post to this group, send email to [email protected]. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- > 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 post to this group, send email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- 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 post to this group, send email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
