On OSX it returns None the first time you call it, but then it works...

this is a bug in Maya that is fixed when using pymel 1.0. autodesk implemented a lazy loading scheme for their libraries, so certain libraries are not initialized until the commands that rely on them are used. only problem is, they left out the return statement in the dummy/loader function, so the first time the command runs it doesn't return it's result. it's easily patched. the code in maya.app.commands looksl like this:

def __makeDummyFunc( command, library ):
        def dummyFunc( *args, **keywords ):
                maya.cmds.dynamicLoad( library )
                maya.cmds.__dict__[command]( *args, **keywords )
        dummyFunc.__doc__ = "fake docstring"
        return dummyFunc

but it should look like this:

def __makeDummyFunc( command, library ):
        def dummyFunc( *args, **keywords ):
                maya.cmds.dynamicLoad( library )
                return maya.cmds.__dict__[command]( *args, **keywords )
        dummyFunc.__doc__ = "fake docstring"
        return dummyFunc

-chad

--
http://groups.google.com/group/python_inside_maya

Reply via email to