mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
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:
parent
630949514a
commit
1d754cbbad
9 changed files with 244 additions and 1 deletions
|
|
@ -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" );
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue