mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
Merge pull request #1437 from Azaezel/alpha41/bakePosPoke
fix make a mesh sometimes shifting position in level
This commit is contained in:
commit
a996c09b04
1 changed files with 5 additions and 34 deletions
|
|
@ -722,31 +722,6 @@ function EditorExplodePrefab()
|
||||||
|
|
||||||
function makeSelectedAMesh(%assetId)
|
function makeSelectedAMesh(%assetId)
|
||||||
{
|
{
|
||||||
|
|
||||||
/*%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;*/
|
|
||||||
|
|
||||||
%assetDef = AssetDatabase.acquireAsset(%assetId);
|
%assetDef = AssetDatabase.acquireAsset(%assetId);
|
||||||
|
|
||||||
%assetPath = AssetDatabase.getAssetPath(%assetId);
|
%assetPath = AssetDatabase.getAssetPath(%assetId);
|
||||||
|
|
@ -763,15 +738,11 @@ function makeSelectedAMesh(%assetId)
|
||||||
|
|
||||||
if(%success)
|
if(%success)
|
||||||
{
|
{
|
||||||
//ok, cool it worked, so clear out the old
|
|
||||||
//First, get our center of the currently selected objects
|
|
||||||
%selectionCenter = EWorldEditor.getSelectionCentroid();
|
|
||||||
|
|
||||||
//Next, for safety purposes(and convenience!) we'll make them a prefab aping off the filepath/name provided
|
//Next, for safety purposes(and convenience!) we'll make them a prefab aping off the filepath/name provided
|
||||||
//TODO: Make this an editor option
|
//TODO: Make this an editor option
|
||||||
%prefabPath = %assetPath @ "/" @ %assetDef.AssetName @ ".prefab";
|
%prefabPath = %assetPath @ "/" @ %assetDef.AssetName @ ".prefab";
|
||||||
EWorldEditor.makeSelectionPrefab(%prefabPath, true);
|
EWorldEditor.makeSelectionPrefab(%prefabPath, false);
|
||||||
|
%selectionPos = EWorldEditor.getSelectedObject(0).getPosition();
|
||||||
//Next, nuke 'em
|
//Next, nuke 'em
|
||||||
EditorMenuEditDelete();
|
EditorMenuEditDelete();
|
||||||
|
|
||||||
|
|
@ -779,7 +750,7 @@ function makeSelectedAMesh(%assetId)
|
||||||
%newStatic = new TSStatic()
|
%newStatic = new TSStatic()
|
||||||
{
|
{
|
||||||
shapeAsset = %assetId;
|
shapeAsset = %assetId;
|
||||||
position = %selectionCenter;
|
position = %selectionPos;
|
||||||
};
|
};
|
||||||
|
|
||||||
getRootScene().add(%newStatic);
|
getRootScene().add(%newStatic);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue