PDA

View Full Version : Maya API without VC++ Tutorial


Hirni_NG
04-04-2005, 05:39 PM
This is a tutorial to setup a programming environment for developing Maya plug-ins without Visual Studio (and without spending a dime ;)).

This is just a quick fix and I am not very familiar with the IDE used but it does the trick
and is fairly simple.

Here we go:

-Install the free Visual Toolkit 2003 from

http://msdn.microsoft.com/visualc/vctoolkit2003/

-Install Code::Blocks IDE version 1.0-beta6 core setup file (http://www.codeblocks.org/modules.php?op=modload&name=Downloads&file=index&req=getit&lid=14)

http://www.codeblocks.org/

only the core version without MinGW is needed. This open source IDE has the advantage
that it supports VCToolkit 2003 and it can import .sln and .vcproj files.

If you want to build a plug-in that uses windows.h such as the mocap plug-ins, you need
to install the Win32 platform SDK from Microsoft as well (http://www.microsoft.com/msdownload/platformsdk/sdkupdate/downlevel.htm)

-Start Code::Blocks and set VCToolkit which is found automatically as the default compiler.

The rest of the tutorial is done by example. These steps can be repeated with any of the example plug-ins. I compiled the solidCheckerShader that way successfully.

-Grab all solidCheckerShader files from the devkit (.cpp .sln .vcproj) and copy them in a seperate folder so we do not mess around inside the Maya devkit directory.

-Open Code::Blocks, goto Projects->Import->Visual Studio Project and choose the .vcproj.
This will set up most of the compiler options.

- Open Project-> Build Options, select solidCheckerShader, and add the include directory of your Maya installation in the Compiler dirs tab (looks like C:\Program Files\Alias\Maya6.x\include).

-Set the \lib directory of your Maya installation in the Linker dirs tab.

- Goto Project->Properties->Targets and set the output name right (it got lowercased)
back to solidCheckerShader.mll. You can also set the output directory to your plug-ins directory.

-Compile one of the Targets. Debug will give lots of warnings, there seems to be an issue with debug informations of libc, but you do not have a debugger anyway.


This is all the output of a small discussion and quick trial and error. I haven t tested this setup thoroughly, there may be compiler options missing etc. but it seems to work.

Happy pluggin'

Ralf Habel

sporadic
04-07-2005, 02:51 PM
Thanks. Lots of useful information here.

Something weird when I tried it, though. My compile can't find windows.h. I've searched the VCToolkit directories and it's not there. Do you know where it should be, by any chance?

Thanks!

Hirni_NG
04-07-2005, 06:13 PM
Thanks. Lots of useful information here.

Something weird when I tried it, though. My compile can't find windows.h. I've searched the VCToolkit directories and it's not there. Do you know where it should be, by any chance?

Thanks!

Did you run vcvars32.bat to set up the environment?

As far as I know Maya plugins do not require the platform sdk (unless you use parts of it of course). All the WIN32 specific stuff should be in the platform SDK, which is hopefully also availible at the Microsoft site....

sporadic
04-07-2005, 06:26 PM
Nope, didn't know I needed to (it isn't in your instructions). ;) I'm a unix guy, and so this whole Windows thing is pretty new to me.

Anyway, I've been doing some searching on my own, and downloaded the SDK, which included windows, then had to addthat to my project path, then the lib directory, and now I get an error saying it can't write to the ReleaseDebug directory. Turning that off, and building Debug gives me unresolved symbols, but building Release works!!

Urg (thud).

I should probably add that I still think the 'quick start' useful, though it took me a bit to get through stuff, and I'd like to not always build Release, of course, but I'll fiddle a bit.

Now to see if the <bleep>ing thing runs...

Hirni_NG
04-07-2005, 10:55 PM
Nope, didn't know I needed to (it isn't in your instructions). ;) I'm a unix guy, and so this whole Windows thing is pretty new to me.

I should probably add that I still think the 'quick start' useful, though it took me a bit to get through stuff, and I'd like to not always build Release, of course, but I'll fiddle a bit.

Now to see if the <bleep>ing thing runs...

Ah, ok, some of the example plug-ins need the platform SDK, such as wrl2ma or the mocap plug-ins, I ll add it to the tutorial.

sporadic
04-08-2005, 01:01 PM
I guess I should have started with the one you did, then. I was doing the cvShader one, since I have need of such a thing right now. Maybe that's all that was going on. Still, great job, since I was dreading getting a compiler for Windows to work.

fishbone
04-09-2005, 09:25 PM
Thanx for sharing! This is something that I've been looking for, for some time now! So I'll even thank you before I've verified if it works! :)

CGTalk Moderation
04-09-2005, 09:25 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.