Merge pull request #305 from Areloch/OpenShapeEditorFix

Fixes logic when opening shapeEditor with a TSStatic selected
This commit is contained in:
Brian Roberts 2020-08-28 12:02:24 -05:00 committed by GitHub
commit 4c63090a6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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" ) )