PDA

View Full Version : Visual Studio 2008 SP1 problems - Starting Maya API


kaivai
11-27-2011, 02:50 PM
I am new to C++ and VS 2008, but I have a pretty good base understanding of procedural programming in QBasic and Mel.

I am having trouble creating the settings for a simple "Hello World" program for it to compile in VS 2008. Most of the tutorials I have found have been based on writing code for Maya 5.0 or 6.0, and I keep seeing references to what you need to do, but not how to do it.

My understanding is that to compile for Maya, you need to
- create a Win32 application
- in Application Type, change it to .dll
- link to OpenMayaUI or any other libraries you might need
- include initializePlugin/uninitializePlugin methods
- change the output file extension .mll (I am using windows)

I understand the first two steps, but I cannot find anywhere to change the output extension to .mll, nor do I understand how to link. I read somewhere that in VS 2003 you could right click on your project, Linker > Input > Additional Dependencies and then type OpenMayaUI.lib, but in VS 2008 I have a whole ton of options and none of them look appropriate.

Where did you guys learn the Maya API from? Is there any super beginner tutorials or books on the subject?

Thank you so so much

WesHowe
11-27-2011, 04:51 PM
This assumes you have already created a .dll-type project in VS 2008.

Change the name to .mll by selecting the project, right-click for properties, and in the linker properties edit ".dll" to ".mll" on the top line (Project Name).

You also want to add something like "C:\Program Files\Autodesk\Maya2011\lib" to the "Additional Library Directories" on the same page

On the C++ properties page, you want to add something like "C:\Program Files\Autodesk\Maya2011\include" to the property "Additional Include Directories".

At this point, you should be able to start compiling something like the "Hello World!" API example, which should include an example of using the initializePlugin() and uninitializePlugin() methods.

Don't forget to set the right configuration properties for 64-bit code in VS 2008 if you want to run the plug-in on a 64-bit version of Maya. I don't remember the setup offhand, but that is in the Visual Studio help files somewhere (compiling for 64-bit).

<* Wes *>

kaivai
11-28-2011, 12:09 AM
Thank you So much Wes!! You're a real lifesaver!

I am failing to load autodesk's HelloWorld in the plugins directory, but I think that is because I have not yet set up VS 2008 for 64 bit applications, as you said. The problem also seems to be documented - so I'll work my way through with the help files and google. Thank you so much again!!

WesHowe
11-28-2011, 02:17 AM
Glad you got started. Sometimes that is all that is needed.

If not, outline what the symptoms are. There are more programmers here than just me, someone will know.

<* Wes *>

CGTalk Moderation
11-28-2011, 02:17 AM
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.