Makes it so prefabs can correctly 'export to collada' by running the buildPolyList function on it's children.

Also adds a 'Bake Selection to Mesh' option to the tools menu in the editor to export the selected mesh to a collada file, and then replaces the selection with a TSStatic.
This commit is contained in:
Areloch 2016-12-10 17:27:27 -06:00
parent 630949514a
commit 1d754cbbad
9 changed files with 244 additions and 1 deletions

View file

@ -555,6 +555,38 @@ function EditorExplodePrefab()
EditorTree.buildVisibleTree( true );
}
function bakeSelectedToMesh()
{
%dlg = new SaveFileDialog()
{
Filters = "Collada file (*.dae)|*.dae|";
DefaultPath = $Pref::WorldEditor::LastPath;
DefaultFile = "";
ChangePath = false;
OverwritePrompt = true;
};
%ret = %dlg.Execute();
if ( %ret )
{
$Pref::WorldEditor::LastPath = filePath( %dlg.FileName );
%saveFile = %dlg.FileName;
}
if( fileExt( %saveFile ) !$= ".dae" )
%saveFile = %saveFile @ ".dae";
%dlg.delete();
if ( !%ret )
return;
EWorldEditor.bakeSelectionToMesh( %saveFile );
EditorTree.buildVisibleTree( true );
}
function EditorMount()
{
echo( "EditorMount" );

View file

@ -263,6 +263,7 @@ function EditorGui::buildMenus(%this)
item[0] = "Network Graph" TAB "n" TAB "toggleNetGraph();";
item[1] = "Profiler" TAB "ctrl F2" TAB "showMetrics(true);";
item[2] = "Bake Selected to Mesh" TAB "" TAB "bakeSelectedToMesh();";
};
%this.menuBar.insert(%toolsMenu, %this.menuBar.getCount());