Hi guys,
I haven't posted news on Max.NET in a while. Version 1.1.5.5 is out as of yesterday and contains some fixes for when max.NET is loading up assemblies. Also in this build IViewWindow interface is now pluggable so making 'extended viewport' plugins is now possible; An example of this is from Zookeeper:
class MainViewWindow : global::Autodesk.Max.Plugins.ViewWindow
{
IntPtr previousParent;
WindowStyles previousStyle;
public override IntPtr CreateViewWindow( IntPtr hParent, int x, int y, int w, int h )
{
this.previousParent = GetParent( Plugin.Instance.MainFrame.Handle );
this.previousStyle = GetWindowStyle( Plugin.Instance.MainFrame.Handle );
MainFrame mainFrame = Plugin.Instance.LaunchDefault_( hParent );
SetWindowStyle( mainFrame.Handle, WindowStyles.WS_CHILD | WindowStyles.WS_VISIBLE );
SetParent( mainFrame.Handle, hParent );
mainFrame.dockedInsideExtendedView = true;
return mainFrame.Handle;
}
public override void DestroyViewWindow( IntPtr hWnd )
{
Plugin.Instance.MainFrame.dockedInsideExtendedView = false;
SetWindowStyle( Plugin.Instance.MainFrame.Handle, this.previousStyle );
SetParent( Plugin.Instance.MainFrame.Handle, this.previousParent );
Plugin.Instance.MainFrame.FormBorderStyle = FormBorderStyle.Sizable;
Plugin.Instance.MainFrame.Close();
}
public override string Name
{
get { return "Zookeeper Main Window"; }
}
/// <summary>
/// Can only have one mainframe!
/// </summary>
public override int NumberCanCreate
{
get { return 1; }
}
}
SetWindowStyle(...) and SetParent(...) are native Win32 methods marshalled into .net using PInvoke.
I hope to post more video tutorials in the near future as it seems like a long time since I made one for Max.NET. If you have questions regarding Max.NET please post them in the Max.NET forum.
Marsel Khadiyev (Software Developer, EPHERE Inc.)