Python Tools for Visual Studio 2012

This thread makes me wish that python was integrated with 3DS max.
And no, this 2014 python integration is not what I am looking for :slight_smile:

My studio runs on the cheap, I only have VS 2010 Express, which doesnā€™t count as VS 2010 to the installer :frowning:

[QUOTE=ahosking;22404]This thread makes me wish that python was integrated with 3DS max.
And no, this 2014 python integration is not what I am looking for :)[/QUOTE]

Why are you saying this ? Did you actually see this python integration for 3dsmax2014 ?

As IDE, personnally I use SublimeText. Once set properly, it is really amazing.

PTVS works with VS Shell. Install the 2013 ā€œPTVS + VS Shellā€ package on this page:

This setup is fully functional (except Profiling, Unit Test) and is perpetually Free.

I really really like PTVS. I plan on using that as my primary IDE (with SublimeText for supplemental support).

On my next project, I want to get serious about test driven development, so like Rob I want testing to be flexible and fast and hopefully easy.

Since I do a lot of work in MotionBuilder, testing is difficult. Itā€™s an embedded interpreter, and I donā€™t see a way to setup PTVS to run tests in that environment. Is there a way to make it work that Iā€™m not aware of? I see that visual studio has Test Settings files - but I donā€™t know that PTVS uses them in any way.

So I feel like Iā€™m not invited to the party, Iā€™ve tried to setup PTVS with Visual Studio 2012 and version 2 of PTVS, Iā€™m finding the intellisense just doesnā€™t work at allā€¦ absolutely nothing completes, whether this is with the default python interpreter, mayaā€™s or my own packages, but it appears I can attach to Maya and initiate a debug although Iā€™m not getting much useful from it.
Yet if I roll back to the 1.5 version I get some kind of intellisense but know where near that that Iā€™m seeing in the vidz that looks excellent, however it sorta works. But then I canā€™t debug in 1.5 I get a load of issues related to symbols?

Is there anything magic I have to do to get what everyone else appears to be getting?

Iā€™m using a maya 2013_x64 and my other python interpreter is also x64

[QUOTE=KiboOst;22432]Why are you saying this ? Did you actually see this python integration for 3dsmax2014 ?

As IDE, personnally I use SublimeText. Once set properly, it is really amazing.[/QUOTE]

Which packages are you usingā€¦

Iā€™ve tried jedi and its not so intelligent, I get a little completion related to class methods but the rest is just standard sublime fuzzy logic completes in no specific priority order.

Seems like remote debugging is broken with latest PTVS 2.0. But it works with PTVS 2 Release Candidate, both with VS2012 and VS2013 integrated shell, remote debugging to Motionbuilder 2013.

Also, on VS2013 thereā€™s no more Productivity Power Tools (like on VS2012), and word highlighting is integrated into each language editor. But thereā€™s no option for highlighting words for Python. :frowning:

I found intellisense to be a bit funky. I can get it to work by adding paths to ā€œSearch Pathā€ on each project, but sometimes it doesnā€™t find everything. Sometimes it finds only the first couple of paths in there, and sometimes it needs VS to reboot.

Iā€™ve found intellisense to be a bit better on 2.0, but Iā€™m reverting to 2RC due to the remote debugging of my previous post.

What PTVS dubugging method works with maya 2015 ?

Did your standalone script call maya.standalone.initialize() ?

Ok. Problem solved. Many thx to Pavel Minaev
For remote deubg via PTVS:
COPY
# ptvs module from
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Python Tools for Visual Studio\2.1\ptvsd
# to
C:\Users<username>\Documents\maya\2015-x64\scripts\ptvsd

USERSETUP.PY


from maya.utils import executeDeferred
executeDeferred('import ptvsd')             
# test script
import testyTest                            

testyTest.py

import maya.cmds as cmds
def testyTest():
    # import ptvsd module
    import ptvsd
    ptvsd.enable_attach(secret = None)
    ptvsd.wait_for_attach()

    cmds.polySphere()
    print "HELOOOOOOO"

Next we run VS.
Drag-n-drop testyTest.py, and place breakpoints.
Run Maya, and in ScriptEditor: testyTest.testyTest()
Go back to VS:
DEBUG\AttachToProcess\Transport:PythonRemoteDebugging
DEBUG\AttachToProcess\Qualifier: tcp:\127.0.0.1

Have you looked into the blur python wrapper for max?

Updating this for future travelers because this thread gets linked a lot, some complementary info to my post in the first page of this thread.

Things changed a bit with PTVS 2.2 and VS2015, I couldnā€™t get it to work by attaching to motionbuilder.exe alone, only by remote debugging to my localhost:5678. Like this:


And you need to click ā€œRefreshā€ in the bottom, NOT ā€œFindā€¦ā€ right next to the address field. Yes, I lost quite some time just because of thatā€¦

Lastly, a little sample code:

try:
    ptvsd.enable_attach(None)
    ptvsd.wait_for_attach()
except:
    pass

I couldnā€™t get a small script with a for loop to trigger a breakpoint without ptvsd.wait_for_attach(), but maybe bigger script/tool with an UI waiting for some kind of input might work without it.

For intellisense on the other hand nothing changed. BUT, PTVS currently does not support a huge library of modules, tools, etc. If you add too much stuff into your project or search paths, intellisense might just stop working without any error whatsoever. Links to logged bugs in github:

I now have VS2012 and Maya 2016
I am trying to get some intellisense stuff working for me, but Iā€™m a bit of a noob at VS.

Iā€™ve followedthis blog postand this blog post
both of which are for older versions of Maya
and by virtue of their differences I assume they are somewhat incomplete

since then the SDK was packaged as a separate download , which I have installed
I added all the search paths listed but still see only partial autocompletion

from maya import cmds as cmds

cmds.<No completeions>

the first statement gets autocompletion options
but the second shows <No completeions> in the autocomplete box.

any ideas?

Iā€™m in the same boat. VS 2015 and Maya 2017. No auto completeā€¦