[Solved] Q: PyMel/PyCharm introspection setup?

Hi,

Does anyone have a winning formula for getting PyMel introspection to work in PyCharm?

I’ve tried adding any combination/order of “…/devkit/other/pymel/extras/completion/pi” and “…/python/lib/site-packages” to Interpeter Paths, but either A or B breaks

import pymel.core as pm

A.
jnt = pm.joint() # joint is known or unknown

B.
assert isinstance(jnt, pm.nt.Joint)
jnt.name() # name is a attribute of jnt or not

Thanks!

http://discourse.techart.online/t/looking-for-resource-to-set-up-remote-debugging/8752

While the title has to do with debugging, there is a section on setting up auto completion.

Great things now work! Sorry for not finding that information myself, at least I tried… :slight_smile:

The trick was increasing the completion file size as detailed in that post. It also seems we can do better than removing Mayas site packages folder, by taking advantage of the order of the interpreter paths. This is similar to what’s done for Eclipse setup: Setting Up PyMEL Autocompletion in Eclipse — PyMEL 1.0.9 documentation

First remove the Maya site-packages, then add the pymel completion files, then undo the removal of the Maya site-packages.

Something seems broken with 2017 though. pymel.core.nodetypes is imported into pymel.core.nt, but not according to pycharm

I found this in my local copy of pymel/core/init.py

# added by J.Parks
from pymel.core.nodetypes import *
from pymel.core.datatypes import *

Perhaps that’ll help.

i find with PyMel and some OpenMaya stuff you run into the intellisense filesize limits in PyCharm.
if you go into the folder that contains the PyCharm Binary you will find the idea.properties file in this just set the line

idea.max.intellisense.filesize

to something much larger than its default of 2500 kb

i generally make it something like

idea.max.intellisense.filesize=25000

Is this step by step https://forums.autodesk.com/t5/maya-programming/maya-python-api-2-0-ide-code-complete/td-p/6239681 would help you with PyCharm configuration?
I think it is almost what you’ve done manually, but they followed another process by filling some configuration files, isn’t it?