Extending MAX.Net via managed C++

 
 
 
Posted by:psaii
Data created:14 August 2010

Hi Marsel,

Suppose I have written a custom Modifier in C++. I want my .NET plugin using MAX.Net to access this modifier internal stuff via a .NET Wrapper.

So I created a managed C++ dll, which export my custom modifier wrapper class to .NET. This class has a constructor that takes a IModifier.

How, in my managed C++ code, can I get the actual Max Object pointer (Modifer*), so I can cast it to my own C++ Modifier ? (MyModifier * l_Mod = (MyModifier*)... ?

Thanks, and sorry for the question spamming, trying to explore as far as I can...

---
Michel

No matter, just hacked my way through this ;) looks like I'm ready to export morphs too ;)

---
Michel

Hey Michel,

In scenarios like this I'd recommend setting your C++ plugin up with a parameter block where you would expose your parameters. Then you can just access those parameters using standard SDK methods without having to cast to your custom plugin type. That wouldn't apply in 100% of the cases but it would cover the majority of them.

What kind of functionality do you need to expose to .NET?

Marsel Khadiyev (Software Developer, EPHERE Inc.)

I used the Morpher plugin as an example, from the MAX sdk. I agree with the param block, doesn't help in the Morpher case, since it's not my plugin, but for other plugins, I'll definitely look into that.

---
Michel