Editor app window for "Model Pro". It creates a UI window with two tabs: a mesh conversion tab (DMX/FBX/OBJ) and a VMDL bulk-edit tab, sets title, icon, minimum size and state cookies, and exposes a menu entry to open the tool.
using System;
namespace ModelPro.Editor;
/// <summary>
/// Model Pro - an editor app for bulk editing model (.vmdl) properties and
/// converting mesh files (.fbx) into models. Two tabs: VMDL bulk editing and
/// FBX to model conversion.
/// </summary>
[EditorApp( "Model Pro", "view_in_ar", "Bulk edit model properties and convert meshes to models" )]
public class ModelProApp : Window
{
public ModelProApp()
{
WindowTitle = "Model Pro";
MinimumSize = new Vector2( 800, 500 );
SetWindowIcon( "view_in_ar" );
BuildUI();
Show();
StateCookie = "ModelPro";
}
private void BuildUI()
{
Canvas = new Widget( null );
Canvas.Layout = Layout.Column();
Canvas.Layout.Margin = 4;
var tabs = new TabWidget( Canvas );
tabs.StateCookie = "ModelProTabs";
Canvas.Layout.Add( tabs, 1 );
tabs.AddPage( "DMX/FBX/OBJ", "transform", new MeshConvertTab( tabs ) );
tabs.AddPage( "VMDL", "view_in_ar", new VmdlEditTab( tabs ) );
}
[Menu( "Editor", "Model Pro/Open Model Pro" )]
public static void OpenModelPro()
{
var existing = Window.All.OfType<ModelProApp>().FirstOrDefault();
if ( existing.IsValid() )
{
existing.Show();
existing.Focus();
return;
}
new ModelProApp();
}
}