How to highlight imported mesh

Hi Guys,
Is there any way to highlight Imported mesh?
Imported meshes by ImportMesh method have AbstractMesh type but HighlightLayer’s methods needs Mesh type.
is there any way to convert types or something else? Maybe i’m missing something?

Right now i’m getting an error when trying to call highlightLayer.addMesh with AbstractMesh type
TS2345: Argument of type ‘AbstractMesh’ is not assignable to parameter of type ‘Mesh’.
Type ‘AbstractMesh’ is missing the following properties from type ‘Mesh’: _internalMeshDataInfo, onBeforeRenderObservable, onBeforeBindObservable, onAfterRenderObservable, and 84 more.
Thank you

Found solution
to get Mesh type from imported mesh you need to call next snippet
someVariableWhichContainsImportedMeshOfTypeAbstractMesh.subMeshes[0].getRenderingMesh()

final code is next
var hl = new BABYLON.HighlightLayer(“hl1”, scene);
hl.addMesh(someVariableWhichContainsImportedMeshOfTypeAbstractMesh.subMeshes[0].getRenderingMesh(), BABYLON.Color3.Green());

3 Likes