Message 1 of 3
Create a SimpleMod2 Modifier in C#

Not applicable
09-05-2017
12:37 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have some issues when I try to create a modifier plugin using SimpleMod2 parent class.
Here's the code :
using Autodesk.Max;
using Autodesk.Max.Plugins;
public class MyPlugin : SimpleMod2 { public override int NumRefs {get { return 0; }} // i dont have any pblock...
public override RefResult NotifyRefChanged(IInterval changeInt, IReferenceTarget hTarget, ref UIntPtr partID, RefMessage message, bool propagate)
{
return RefResult.Dontcare;
} public override int Display(int t, IINode inode, IViewExp vpt, int flags, IModContext mc)
{
drawGizmos(t, inode, vpt, flags, mc); // custom method
return 0;
} public override IDeformer GetDeformer(int t, IModContext mc, IMatrix3 mat, IMatrix3 invmat)
{
return null; /* causes crash of 3dsmax*/
} } public class MyPluginClassDesc : ClassDesc2 { [...] } public class Loader { public static void AssemblyMain() { GlobalInterface.Instance.COREInterface16.AddClass(new MyPluginClassDesc()); } }
The problem comes from the IDeformer, i can't see any way to create my own one. Is there any way to avoid its creation ? I only need a modifier to display custom gizmos.
Thank you.