Yes, currently Komodo is able to parse (debug, syntax, codeintelligence..etc) python as well as in-house python classes. The question is that is there any way to be able to accesses the Maya Python API, such as maya.OpenMaya.
We are currently coding python in Maya's Script Editor and looking to shift over to a better editor.
If the Maya modules are written in pure python, you should automatically get completions for the Maya API if it's included on your python path.
Since that is not the case I'm guessing the Maya modules used are compiled C/C++ modules.
We do not automatically support completions for binary python modules (except for the ones in the standard python library). What we do is allow people to build/generate their own API files that can be added to Komodo. These files come in the form of an XML file, we call it a "cix" file (Code Intelligence XML).
We also want to include tools in Komodo in order to assist users generate these cix API files, but this is not ready yet as of Komodo 4.1, hopefully it will be in Komodo 4.2 or 4.3.
Hi Todd – I’m also interested in auto-complete for Maya 8.5 Python coding. On my machine, Maya installed into 7 sub-folders of \Autodesk\Maya8.5\Python\ exactly 46 .pyc and .pyd files.
In order to use the exact same Python that Maya 8.5 ships with, in Komodo IDE Edit\Preferences\Language\Python I set “Use this interpreter†to C:\Autodesk\Maya8.5\bin\mayapy.exe
While I had that dialog box open, I noticed that there was a second place to enter “Additional Python Import Directoriesâ€
Confession time: I’ve got 35+ years in FORTRAN, Pascal and related languages, C, C#, Visual Basic, SQL, blah-blah-blah, but next to no Python. I’m a Python newbie, forgive me please.
My newbie question is: Do those 46 .pyd and .pyc files have anything to do with auto-complete facilities in Komodo? And if so, would I just enter in the one parent folder path, and Komodo magically walks sub-folders? Or would I need to enter exactly the sub-folder paths in that Komodo dialog box to get Komodo to point to each sub-folder of interest?
Thanks for your help with this :-)
Bruce
p.s. – Searching on Maya in the Komodo forum today found just this one thread. So in case it helps others trying out Maya + Komodo, here are a couple things I found:
1) Autodesk clearly documents that Maya is callable externally by a Python interpreter, but they state that we’re to use the interpreter shipped with Maya to do so, which is why in Komodo IDE Edit\Preferences\Language\Python I set “Use this interpreter†to C:\Autodesk\Maya8.5\bin\mayapy.exe It works for me.
2) Autodesk clearly states that when calling Maya from an external Python interpreter, we are calling Maya in batch mode, so Maya UI facilities are not available; only what’s doc’ed as available in the Maya batch-mode subset is available.
3) Your mileage may vary, but I’ve found it handy to Python code in Komodo (nice editor, nice debugger), test what I can in Komodo, and then run the debugged Python inside Maya. The first 5 lines of my .py files look like this
import maya.standalone
maya.standalone.initialize( name='python' )
import maya.OpenMaya as OpenMaya
import maya.cmds as mc
and before running them inside Maya I just comment out the first two lines.
3.a) The approach in item 3) is no good for developing Python Maya code that does any Maya UI stuff, for the reason in item 2) above. So if it is less practical/possible or more work in a particular shop to partition Python code into no-UI/yes-UI code, then this approach is no help.
4) If you want to play with Python and Maya, I don’t think the free Personal Learning Edition of Maya 8.5 will do. Your mileage may vary, but I installed Maya 8.5 PLE on a test machine, and searching for files like *py*.* and *.*py* on the PLE machine turned up only one file in the Maya folder, not nearly like on my regular Maya machine. Just a theory, but I don’t think Python exists in PLE Maya.
5) It is extremely cool (Way Cool) editing, running (and debugging) Maya Python code using Komodo. OK, no-can-do if there is UI stuff, and I don’t (yet) have auto-complete, but this so beats the tar out of FORTRAN on 80-column punch cards :-)
Komodo's codeintelligence system will only scan source ".py" files. It does not load/import any dyanamic or compiled ".pyc" modules due to security concerns (as importing unknown modules can potentially do disastrous things to a system).
Thus it will not provide any autocompletions for Maya.
I downloaded the free Personal Learning Edition (PLE) version of Maya 8.5 and it is as you say "no python modules" available, which is unfortunate.
The only way forward would be to build/write your own cix file that specified the Maya API, example skeleton would be:
Hi Todd - thanks for the info. I'm happy with the tools as they are now, and look forward to a future 4.2 or 4.3 Komodo that has cix-gen info/docs/examples/tools.
Thanks for your last post! I was wondering the same thing and stumbled here. This was enough to show me how to generate my own .cix file (using a script, of course :).
Update: There is a Maya extension available here:
http://community.activestate.com/xpi/maya-mel
Can you clarify support? Support for debugging, codeintelligence/API, syntax highlighting? What would you like/expect to see?
Todd
Yes, currently Komodo is able to parse (debug, syntax, codeintelligence..etc) python as well as in-house python classes. The question is that is there any way to be able to accesses the Maya Python API, such as maya.OpenMaya.
We are currently coding python in Maya's Script Editor and looking to shift over to a better editor.
If the Maya modules are written in pure python, you should automatically get completions for the Maya API if it's included on your python path.
Since that is not the case I'm guessing the Maya modules used are compiled C/C++ modules.
We do not automatically support completions for binary python modules (except for the ones in the standard python library). What we do is allow people to build/generate their own API files that can be added to Komodo. These files come in the form of an XML file, we call it a "cix" file (Code Intelligence XML).
The schema and information for building/adding a Komodo cix can be found here:
http://community.activestate.com/faq/codeintel-cix-schema
We also want to include tools in Komodo in order to assist users generate these cix API files, but this is not ready yet as of Komodo 4.1, hopefully it will be in Komodo 4.2 or 4.3.
Cheers,
Todd
Hi Todd – I’m also interested in auto-complete for Maya 8.5 Python coding. On my machine, Maya installed into 7 sub-folders of \Autodesk\Maya8.5\Python\ exactly 46 .pyc and .pyd files.
In order to use the exact same Python that Maya 8.5 ships with, in Komodo IDE Edit\Preferences\Language\Python I set “Use this interpreter†to C:\Autodesk\Maya8.5\bin\mayapy.exe
While I had that dialog box open, I noticed that there was a second place to enter “Additional Python Import Directoriesâ€
Confession time: I’ve got 35+ years in FORTRAN, Pascal and related languages, C, C#, Visual Basic, SQL, blah-blah-blah, but next to no Python. I’m a Python newbie, forgive me please.
My newbie question is: Do those 46 .pyd and .pyc files have anything to do with auto-complete facilities in Komodo? And if so, would I just enter in the one parent folder path, and Komodo magically walks sub-folders? Or would I need to enter exactly the sub-folder paths in that Komodo dialog box to get Komodo to point to each sub-folder of interest?
Thanks for your help with this :-)
Bruce
p.s. – Searching on Maya in the Komodo forum today found just this one thread. So in case it helps others trying out Maya + Komodo, here are a couple things I found:
1) Autodesk clearly documents that Maya is callable externally by a Python interpreter, but they state that we’re to use the interpreter shipped with Maya to do so, which is why in Komodo IDE Edit\Preferences\Language\Python I set “Use this interpreter†to C:\Autodesk\Maya8.5\bin\mayapy.exe It works for me.
2) Autodesk clearly states that when calling Maya from an external Python interpreter, we are calling Maya in batch mode, so Maya UI facilities are not available; only what’s doc’ed as available in the Maya batch-mode subset is available.
3) Your mileage may vary, but I’ve found it handy to Python code in Komodo (nice editor, nice debugger), test what I can in Komodo, and then run the debugged Python inside Maya. The first 5 lines of my .py files look like this
import maya.standalone
maya.standalone.initialize( name='python' )
import maya.OpenMaya as OpenMaya
import maya.cmds as mc
and before running them inside Maya I just comment out the first two lines.
3.a) The approach in item 3) is no good for developing Python Maya code that does any Maya UI stuff, for the reason in item 2) above. So if it is less practical/possible or more work in a particular shop to partition Python code into no-UI/yes-UI code, then this approach is no help.
4) If you want to play with Python and Maya, I don’t think the free Personal Learning Edition of Maya 8.5 will do. Your mileage may vary, but I installed Maya 8.5 PLE on a test machine, and searching for files like *py*.* and *.*py* on the PLE machine turned up only one file in the Maya folder, not nearly like on my regular Maya machine. Just a theory, but I don’t think Python exists in PLE Maya.
5) It is extremely cool (Way Cool) editing, running (and debugging) Maya Python code using Komodo. OK, no-can-do if there is UI stuff, and I don’t (yet) have auto-complete, but this so beats the tar out of FORTRAN on 80-column punch cards :-)
Komodo's codeintelligence system will only scan source ".py" files. It does not load/import any dyanamic or compiled ".pyc" modules due to security concerns (as importing unknown modules can potentially do disastrous things to a system).
Thus it will not provide any autocompletions for Maya.
I downloaded the free Personal Learning Edition (PLE) version of Maya 8.5 and it is as you say "no python modules" available, which is unfortunate.
The only way forward would be to build/write your own cix file that specified the Maya API, example skeleton would be:
<codeintel version="2.0" name="Maya" description="Maya Python API"> <file lang="Python" mtime="0" path="maya.cix"> <scope ilk="blob" lang="Python" name="maya"> <scope ilk="blob" name="OpenMaya"> <scope ilk="class" name="MVector"> ... </scope> <scope ilk="function" name="MSelectionList"> ... </scope> </scope> </scope> </file> </codeintel>Obviously a python program could easily generate this structure recursively through introspection and I would not suggest writing this by hand :)
Cheers,
Todd
Hi Todd - thanks for the info. I'm happy with the tools as they are now, and look forward to a future 4.2 or 4.3 Komodo that has cix-gen info/docs/examples/tools.
Thanks, Bruce
Hi Todd!
Thanks for your last post! I was wondering the same thing and stumbled here. This was enough to show me how to generate my own .cix file (using a script, of course :).
You can find the .cix file for Maya's Python command set here:
http://community.activestate.com/forum/maya-python-cix-extension
Cheers!
-J