3

I'd like to write a plugin for Maya/Windows that uses the .NET library so that I can capture Windows system events from within Maya. I've looked into Python for .NET, but I have no idea what I'm doing. I've tried building from source using Visual C# 2010 Express and placing the clr.pyd and Python.Runtime.dll file in my Maya bin folder as many have suggested, but when I try typing 'import clr' in the script editor, it gives me

line 1: DLL load failed: %1 is not a valid Win32 application.

I've set the C# solution platform to x64, the python.exe that gets built is running in Python 2.6 in x64, and Maya is running Python 2.6 in x64. Can anyone clue me in on what I'm doing wrong or if there's an alternative to Python for .NET?

denfromufa
  • 5,610
  • 13
  • 81
  • 138
Cindy Xu
  • 61
  • 2
  • 2
    Try pythonnet-2.0dev.clr4.0.win-amd64-py2.6.‌exe from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pythonnet. Open the file with a unzip app and extract `clr.pyd` and `Python.Runtime.dll` into Maya Python's sys.path. – cgohlke Nov 12 '12 at 03:45
  • 1
    @cgohlke It worked! Thank you so much, I've been banging my head on this for hours. – Cindy Xu Nov 12 '12 at 05:29

1 Answers1

2

Check out the Extension 2 for Maya 2013 it has a .NET API.

cdiggins
  • 17,602
  • 7
  • 105
  • 102