vscode-mayapy
vscode-mayapy copied to clipboard
maya.cmds auto-completion issue
Hi! thanks for the awesome extension, very useful!
I'm having an issue with maya.cmds
though, auto-completion is very slow with Jedi, and doesn't work at all with Pylance.
All the other packages I've tried (maya.OpenMaya
, maya.mel
, pymel.core
, etc) all work fine (and really fast) with Pylance.
Just to clarify, when typing maya.cmds.
using Jedi, it takes maybe 10 seconds for the function list to appear (so much that for a long time I thought it was just not working at all, I only discovered this by mistake).
With Pylance the autocomplete list appears instantly, but I only get generic things like __dict__
, none of the actual APIs appear.
And if I set typeCheckingMode
to basic
, Pylance explictly reports that functions don't exist (eg maya.cmds.file()
).
Do you have any clue what the issue might be?
Sorry I didn't notice your issue.
I test it.
from maya import cmds
cmds.polyEvalue()
using maya.cmds.
seem not work.
You're right, it does work with Jedi (and it's not as slow as what I described, though that was a few VsCode releases ago).
It still doesn't work at all with Pylance though... until I dug a little, and was able to fix it by replacing the global import directives with relative imports (in .vscode\extensions\fxtd-odyssey.mayapy-1.0.4\mayaSDK\maya\cmds\__init__.py
)
Before:
from maya.cmds.Animation import *
After:
from .Animation import *
... so that's good news!
Now that it's finally working, I see the docstrings could be improved. They were generated from your MayaDoc repo, right?
Now that it's finally working, I see the docstrings could be improved. They were generated from your MayaDoc repo, right?
yes
You're right, it does work with Jedi (and it's not as slow as what I described, though that was a few VsCode releases ago).
It still doesn't work at all with Pylance though... until I dug a little, and was able to fix it by replacing the global import directives with relative imports (in
.vscode\extensions\fxtd-odyssey.mayapy-1.0.4\mayaSDK\maya\cmds\__init__.py
) Before:from maya.cmds.Animation import *
After:from .Animation import *
... so that's good news!Now that it's finally working, I see the docstrings could be improved. They were generated from your MayaDoc repo, right?
This fixed the issue for me too, thank you!
You're right, it does work with Jedi (and it's not as slow as what I described, though that was a few VsCode releases ago).
It still doesn't work at all with Pylance though... until I dug a little, and was able to fix it by replacing the global import directives with relative imports (in
.vscode\extensions\fxtd-odyssey.mayapy-1.0.4\mayaSDK\maya\cmds\__init__.py
) Before:from maya.cmds.Animation import *
After:from .Animation import *
... so that's good news!Now that it's finally working, I see the docstrings could be improved. They were generated from your MayaDoc repo, right?
This doesn't seem to work with my and Pylance :(. Any ideas on why this could be? I am just trying to get the color formatting on the modules from Pylance