Fixes logic when opening shapeEditor with a TSStatic selected, it'll attempt to load up the shapeAsset if one is set on the static.

This commit is contained in:
Areloch 2020-08-28 02:49:26 -05:00
parent 31039de2cf
commit 55e24926e4
2 changed files with 6 additions and 2 deletions

View file

@ -235,7 +235,7 @@ function ShapeEditorPlugin::onActivated(%this)
{
%obj = EWorldEditor.getSelectedObject(%i);
%shapeFile = ShapeEditor.getObjectShapeFile(%obj);
if (%shapeFile !$= "")
if (%shapeFile !$= "" && isFile(%shapeFile))
{
if (!isObject(ShapeEditor.shape) || (ShapeEditor.shape.baseShape !$= %shapeFile))
{
@ -251,6 +251,10 @@ function ShapeEditorPlugin::onActivated(%this)
}
break;
}
else if(%shapeFile !$= "")
{
%this.openShapeAssetId(%shapeFile);
}
}
}

View file

@ -58,7 +58,7 @@ function ShapeEditor::getObjectShapeFile( %this, %obj )
// works for the vast majority of object types)
%path = "";
if ( %obj.isMemberOfClass( "TSStatic" ) )
%path = %obj.shapeName;
%path = %obj.shapeAsset !$= "" ? %obj.shapeAsset : %obj.shapeName;
else if ( %obj.isMemberOfClass( "PhysicsShape" ) )
%path = %obj.getDataBlock().shapeName;
else if ( %obj.isMemberOfClass( "GameBase" ) )