Help - Search - Members - Calendar
Full Version: Maya Api And Visual C++ 2005 Express?
Board Index > 3D Forums > Maya Boards > API
mnhan32
Hey, just downloaded Visual C++ 2005 Express.
I tried the same way I did in my .Net 2003, but it didn't work.
Does anyone know how to set up Maya devit in 2005 Express?
Or, is it possible?
JamesPiechota
Make sure you've also downloaded the Microsoft Platform SDK and added its Include and Lib paths to your project.

However, since Maya doesn't currently ship with some of the
Microsoft DLLs for 2005 (mfc80.dll, msvcp80.dll, and msvcr80.dll I believe)
you'll have to distribute them manually with your plug-in (i.e. make sure
that whoever loads your plugin has those dlls in their path).

When I hit this problem, however, I switched back to .NET 2003 so I haven't confirmed
which DLLs, exactly, would need to be redistributed.

Also since .NET 2005 isn't officially supported as a Maya plug-in compiler I would expect there to be some quirks/bugs.
Daniel_Faust
QUOTE(JamesPiechota @ 11/25/05, 11:28 PM)
Also since .NET 2005 isn't officially supported as a Maya plug-in compiler I would expect there to be some quirks/bugs.
*


Works perfectly over here. The library issue shouldn't be a problem, since it's a common practice to distribute them with a plugin.

Visual Studio 2005 worked right out of the box with Maya (after adding the paths to the includes and libraries).
mnhan32
Thanks for the reply!
I didn't install SDK I guess... there is a SDK folder in my Express 2005 though.
I only used the plginwizard from Maya devkit,
So, in .NET 2003, I choosed Maya plugin as my solution. And then, the Maya wizard pops up for me to choose whether I want to develope a cmd or a node. The only thing I need to do after that is to set the include and lib path.
I tried to copy my pluginwizard folder to the VC\VCWizard folder in Express 2005.
And, my vsdir, ico, vsz file to VC/vcprojects folder.
But, it didn't work. Is there anyway to setup for the wizard?
Or, I have to do it manually?
if that so, how?

Thanks!
mnhan32
Hey..
After installing Microsoft Platform SDK, and some tweaks, It works!!!

Thanks guys.


I also make Maya pluginwizard works.
Do not know if this helps any newbie like me, but here is what I did.

1. install Visual C++ 2005 Express and Microsoft Platform SDK

2. you can find Maya plugin wizard : "MayaPluginWizard2.0.zip" in somehwere like this
ex. C:\Program Files\Alias\Maya7.0\devkit\pluginwizard

3.decompress that zip file and you get a folder (d), MayaPlugInWizard and within that folder you get :
a. 1 folder : MayaPlugInWizard
b. 3 files : MayaPlugInWizard.ico, MayaPlugInWizard.vsz, MayaPlugInWizard.vsdir.

4. copy MayaPlugInWizard folder ( a ) into VCWizards of your Visual C++ 2005 Express
ex . C:\Program Files\Microsoft Visual Studio 8\VC\VCWizards

5.create a new folder ( c ), name it what ever you want, like "MayaDev" ,copy the rest 3 files ( b ) into it.

6.copy the whole folder ( c ) you just created and put it into VCProjects folder , the one inside Express folder, of your Visual C++ 2005 Express.
ex. C:\Program Files\Microsoft Visual Studio 8\VC\Express\VCProjects

(P.S. I think you can just copy those 3 files into Express/VCProject folder, and it should work. The only difference is, if you put those files into one folder, in your 2005 Express, it will create a new catglory as the name of your folder under Visual C++. If you don't, you can still find Maya pluginwizard under Visual C++)

7.within that folder, open MayaPlugInWizard.vsz using notepad. There are two things you need to do.

1.change the second line from
Wizard=VsWizard.VsWizardEngine.7.1
To
Wizard=VsWizard.VsWizardEngine.8.0

2. add one line like this.
Param="RELATIVE_PATH = VCWizards"

To compile your plugin,

in your additional Include Directories, mostly, you will nees two dir there.
1. the path of your SDK include folder
2. the path of your MAYA include folder(pluginwizard should do this for you)


in your Additional Library Directories, most of time, you need,
1. the path of your SDK lib folder
2. the path of your MAYA lib folder(pluginwizard should do this for you)


And that's it. Now you should be able to use Maya pluginwizard and compile your plugin without problem.(cross my finger... tongue.gif )


P.S. I have not tried to compile my plugin and put it on other computer, so I don't know if I should distribute those dll with my plugin. I will try recently.
mnhan32
Just make a test.
I complied one plugin from Visual C++ 2005 Express.
It worked fine on my computer which has Visual C++ 2005 Express installed on it.
But, It did not work on the one that has no Visual C++ 2005 Express.

Just like James mentioned before, I think that my second computer is lack of some .dll.

I copied mfc80.dll, msvcp80.dll, and msvcr80.dll to that computer, but did not work.

1. I tried to put them all into system32 folder -> failed
2. I tried to put them all into Maya bin folder -> failed

Does anyone know what else files I shoud copy and where or I should paste them to?

Thanks!!!!
Joojaa
i think its the visual c runtimes thet are missing. They are uysed by teh coimpiler, express or not. Atleast thats my experience i could be worng but all the computers i work on have thet dll
mnhan32
I thought that msvcr80.dll is the runtime dll I need ?!
If it is not, do you know which one I need?
And where I should copy them to?
mnhan32
Hey folks..
I've kept trying, but failed.
It works all fine on the one that has Visual C++ 2005 Express.
I got an Error message evert time I tried to load the plugin in Maya.

CODE
// Error: line 1: Unable to dynamically load : C:/Program Files/Alias/Maya7.0/bin/plug-ins/myFirstPlugIn.mll


I almost copied and pasted every possible dll file to both the bin folder under Maya or the system32 folder under window.

by the way, the one that has 2005 Express on it is XP Home Edition, the other one is XP Professional, does that matter?

HELP!!!
Joojaa
thing is that maya shouldnt work on xp home... It does but ist glitches.
mnhan32
however, the plugin works fine on my XP Home edition......
All the infomation I got right now is that I only need to copy the runtime dll, msvcr80.dll and msvcp80.dll, to the bin folder of Maya. I did that, but failed.

Sigh...... sad.gif

I think I will try

1. uninstall 2005 Express from my Home Edition
2. install 2005 Express on my Professional Edition
3. complie the plugin.
4. copy the mll and two run time dll back to home edition

see if this works.... I doubt it though...... but.....

Anyway,
Thanks a lot, guys.
JamesPiechota
Is your plugin compiled as Debug or Release?
In this thread Daniel_Faust pointed out that if your plugin is compiled as Debug you'll need to include the debug versions of the runtime DLLs (they're named the same as the regular runtime DLLs but with a d at the end).
mnhan32
It's out as a release.
but I will try to copy that dll, see what happen.

Thanks
mnhan32
failed again......
Copy and paste the debug dll did not fix the problem.
I wonder if that is the problem of Window Service Pack.
If I complie the plugin with Visual C++ 2005 Express on WinXP SP2, will that makes my plugin failed to be loaded in on the machine with WinXP SP1?

BTW, I have successfully used CodeBlocks with Visual C++ 2003 Toolkit to build my plugin. It works on both of my computers. But, still, I would like to figure out why it doesn't work with Visual C++ 2005 Express.
mnhan32
..... I don't get it....
It works perfectly on the machine that has Visual C++ 2005 Express and Platform SDK installed.
I guess that means the the plugin is good.
So, there must be some files missing on the other computers.
(It does not mater it's SP1 or SP2)

I'd tried almost every dll in WinSxS folders, I put all in my bin folder under Maya, but failed. mad.gif

Anybody has any clue?

If you are interested in testing the plugin on your computer.
Here is the link to the simple hello command plugin that I used to test.

Hello.mll

Sorry,
forgot to mention that this plugin was complied by
Microsoft Visual C++ 2005 Express for Maya 7.
paic
QUOTE(mnhan32 @ 12/07/05, 04:53 PM)
..... I don't get it....
It works perfectly on the machine that has Visual C++ 2005 Express and Platform SDK installed.
I guess that means the the plugin is good.
So, there must be some files missing on the other computers.
(It does not mater it's SP1 or SP2)

I'd tried almost every dll in WinSxS folders, I put all in my bin folder under Maya, but failed. mad.gif

Anybody has any clue?

If you are interested in testing the plugin on your computer.
Here is the link to the simple hello command plugin that I used to test.

Hello.mll

Sorry,
forgot to mention that this plugin was complied by
Microsoft Visual C++ 2005 Express for Maya 7.
*


Hi,
I just had the problem 2 days ago, then I found this thread, and after some searches, I found the solution :
SImply install the ".NET Framework 2.0 redistributable package" on the other computers, and it will run ^^
(google for .NET Framework 2.0, it's the seconde link if I remember well)
mnhan32
I switched back to VC7 already, using CodeBlocks and Visual C++ 2003 Toolkit.
I will try it, though I can't ask all the clients installing this.
But it's very good to know that.

Thanks for the information.
mortald
I'll be attempting the same using MSVS 8.0 2005, on Win 2k, for Maya 7.0. I'll let you know if simply installing the Platform SDK does it.


01/17/06
Just as an update... Installing the platform SDK allowed me to compile and run maya plug-ins. I have not yet attempted to run the .mll on another machine, but for my (educational) purposes it really isn't a concern. When I get the chance, I'll try it on another machine and see if it runs.

THANK YOU SO MUCH FOR CONTRIBUTING TO THIS THREAD!!! I'D BE STUCK OTHERWISE.
mnhan32
Hey mortald,
I am glad that you found something helpful from this thread.
From my tests, as long as you got MSVC 8.0, the mll should work fine.
I'd asked some of friedns trying to load the mll without MSVC8.0, or 2005Express, on their machines, but all failed. As paic pointed out that this problem could be easily solved by simply installing .NET Framework 2.0 on the machine. However, if you find any other way to work around, please do let me know!
pipoun
Hi everyone,

You can't get the dll working by copying the msvc8 dll on another machine.
You have to install them properly by using a tool given with Visual 8. This tools is not present in the Express Edition.
I d'ont remember the folder location but the tool's name is vcredist_x86.exe for x86 architectures. Juste execute it the target machine.
I think that this tool is emmbedded in the msi packages, thanks to that, these dll are automaticely installed when U install an application with the msi installer.

I hope it helps.

pipoun
mnhan32
Tks for your infomation, pipoun.
That's the issue, I can't ask all my friends who want to use my plugins to buy Visual 8. The best way, as mentioned before, is to ask them to download an dinstall .NET Framework 2.0, since it's free ,and they will have MSVC8 runing fine on their machine. Or, simply switch back to VC7.

mnhan32
STAVREV
Guys i did everything , and i still there is nothing in the New Project dialog ...

Will someone please please please make a tutorial for the WHOLE PROCESS OF INSTALLATION....

It will help lots of people...

Thanks in advance smile.gif
mnhan32
I did post the WHOLE PROCESS OF INSTALLATION on page 1.
And, I just did that process again on my new WinXP, it works.
you might want to check that process again, see if you miss any step.


quick check here:
the three files

MayaPlugInWizard.vsz
MayaPlugInWizard.vsdir
MayaPlugInWizard.ico

(or the folder contains three of them)

should go to

[Where you installed your VC 2005 Express]\VC\Express\VCProjects\
Rob Bateman
You don't need the plugin wizard to use the maya API. (I personally hate it)

First set up Visual C++ for the Maya API and MS SDK (you only need to do this once). within VC 2005, goto tools->options from the menu.

in the dialog, goto "projects and settings"->"VC++ Directories".

You should see a drop down tab for "show directories for" (or something like that).
switch to the include directories, and add the Maya API include directory, and the platform SDK include directory (if you've not installed it). Do the same for the library files.


To create a new Maya plugin project, create a win32 project from File->new->project

Make sure you change the "Application Settings" before finishing the wizard. Change the type to a Win32 DLL project, and make sure you tick the "empty project" box. click finish.

This should create a directory for your project. Add any required files you need....

now, you need to change the output file. Right-Click on the project (not the solution!) and select properties. There is a drop down tab at the top that will say "Debug", to save time, switch this to "All Configurations".

goto the "linker section" -> "general settings". Change the output file to be "myPlugin.mll" (or whatever you want). Now, goto the Linker->command line section and add the following,

\export:initializePlugin \export:uninitializePlugin

These are linker commands to export those two functions. If you are using MSimple, then those funcs are actually hidden in the DeclareSimpleCommand macro (trust me, they are there....). If you don't use MSimple, then you can do the same in code by using....

CODE
#ifdef WIN32
   #define EXPORT __declespec(dllexport)
#else
   #define EXPORT
#endif

EXPORT MStatus initializePlugin(MObject obj ) {
   // yada yada
}

EXPORT MStatus uninitializePlugin(MObject obj ) {
   // yada yada
}


In the C/C++->pre-processor->Preprocessor Definitions, add the defines NT_PLUGIN and REQUIRE_IOSTREAM (might want to set this seperately for debug and release).

In your main plugin cpp file, add the following to link in the Maya libs.

CODE
// required to link the libraries under VisualC++/Win32
#ifdef WIN32
    #pragma comment(lib,"Foundation.lib")
    #pragma comment(lib,"OpenMaya.lib")
    #pragma comment(lib,"OpenMayaFx.lib")
    #pragma comment(lib,"OpenMayaUi.lib")
    #pragma comment(lib,"Image.lib")
    #pragma comment(lib,"OpenMayaAnim.lib")
    #pragma comment(lib,"OpenMayaRender.lib")
#endif


Alternatively, add those files to the additional dependency box in the linker settings bit of the project options.
hajime
>paic

My friend taught me good solution for compiling with Visual C++ 2005 Express.

Change the setting of project
multi-threadDLL(/MD) -> multi-thread(/MT)

and Linker>input
Delete all additional include file except OpenMaya.lib Foundation.lib.
odbc32.lib odbccp32.lib OpenMaya.lib Foundation.lib -> OpenMaya.lib Foundation.lib

Then MLL file size became 100KB bigger, but works fine without .NET frameworks something.

*My VC++ environment is Japanese, so some of menu name might be different.
ElCid
Hajime is correct. You don't want to run around to every artists machine and make sure they have programmer tools installed. By making the libraries 'static', they'll be included in the plug-in. It'll increase their size, but not by enough to be worried about.

Another possibility that no one has mentioned is the OS/machine itself. If the plug-in was compiled for 32 bit windows, and you're trying to run it on a XP64 machine (or vise versa), you're going to have problems. If you check the docs for Maya 8 (under Build Environment), you'll get a better idea of what I'm talking about.

I hope this helps.

-Cid
ElCid
QUOTE(JamesPiechota @ 11/25/05, 11:28 PM) *
Also since .NET 2005 isn't officially supported as a Maya plug-in compiler I would expect there to be some quirks/bugs.

.NET 2005 is supported for the 64-bit version of Maya.

-c
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.