PDA

View Full Version : SDK: Managed code under Max 8/9


RustyKnight
01-17-2008, 05:51 AM
I'm curious if anyone has tried or knows if it is possible to use Managed/CLI code under Max8 and Max9??

The main reason I ask, apart from it would be nice to use some of the components, is I'd like to use the XML parser in dotnet...I've used it a bit before and it is rather good ... I didn't say that, you can't prove anything...

Cheers
Shane

ypuech
01-17-2008, 09:00 AM
Under 3ds Max 9 it's possible as the supported development platform is Visual Studio 2005 and C++/CLI was added in this version.
But for 3ds Max 8, the supported platform is Visual Studio 2002 and I've never seen code using the old Managed C++ in a 3ds Max plugin.

Using C++/CLI in a 3ds Max 9 plugin (or 2008) isn't difficult but you have to follow some rules because some parts of the code are managed and others unmanaged.
If you have 3ds Max 2008 there's an interesting sample (SceneExplorer extension) showing how to mix managed and unmanaged code in a plugin.

I have some code using C++/CLI in a 3ds Max 9 plugin for .NET 2.0 forms handling under 3ds Max. I'll upload this project on my website and I'll try to create a short plugin using the .NET XML parser.

RustyKnight
01-17-2008, 10:13 PM
That would be really cool, thanks

Shane

ypuech
01-17-2008, 11:08 PM
Here is the source code of the project : http://ypuechweb.free.fr/Files/dotNetFormTest.zip

It's an utility plugin showing a .NET Form.
I'll try to create a plugin (an exporter I think) using the .NET XML parser.

Mixing managed and unmanaged isn't easy because managed types cannot be used in unmanaged code. So, wrappers or just functions (it's the case in the sample) are needed to access managed code from unmanaged code.

RustyKnight
01-19-2008, 05:24 AM
Thanks ypuech! I've had a quick look through the code and I think I understand the basic concepts...I'm sure there's plenty more questions to come.

I've been able to get your code compile (but I've not had a chance to test it), but when I compile my code, it gives me a bunch of linker errors...

I don't have it in front of me right now, but I am compiling in hybird mode.

Do you have any tips on compiler configuration.

Cheers
Shane

ypuech
01-20-2008, 11:25 AM
I've been able to get your code compile (but I've not had a chance to test it), but when I compile my code, it gives me a bunch of linker errors...

I don't have it in front of me right now, but I am compiling in hybird mode.

Do you have any tips on compiler configuration.
What linker errors are you having ? (error number + message)

In Max 2008 SDK documentation there's some tips about mixing managed and unmanaged code. There's also a new .NET SDK containing assemblies and classes that helps a lot in programming Max plugins with the .NET Framework. I think it would be interesting to upgrade to this version if it's not done yet.

RustyKnight
01-21-2008, 02:36 AM
my bad, i needed to update the additional libaries...compiles now, just need to test it

Cheers
Shane

ypuech
01-21-2008, 08:33 AM
I've developed a small utility plugin using the .NET Xml parser this week-end. I'll post the code when I'll come back home.

EDIT:
I've just updated my .NET test Utility plugin : http://ypuechweb.free.fr/dot_net_test.html

There's two versions now :
- 3ds Max 9 version uses a regular .NET Form
- 3ds max 2008 uses MaxForm from Max .NET SDK

I'll post XML Test Utility later.

CGTalk Moderation
01-21-2008, 08:33 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.