Why does Mesh outline not work unless I `import '@babylonjs/inspector'`?

    "@babylonjs/core": "5.0.0-alpha.33",
    "@babylonjs/inspector": "5.0.0-alpha.33",
    "@babylonjs/loaders": "5.0.0-alpha.33",
    "@babylonjs/materials": "5.0.0-alpha.33",

I was wondering why doing the following did not show an outline on my mesh as I thought it should:

mesh.renderOutline = true

For some reason, if I do the following at the top of the file, the outlines work (this took me a bit of time to figure out):

import '@babylonjs/inspector'

Also, inside of Visual Studio Code, the property ā€œmesh.renderOutlineā€ does not seem to exist?

image

Is @babylonjs/inspector a requirement for mesh.renderOutline to work, or am I going down the wrong path?

Thank you!

ā€¦Also, I donā€™t thiiiink I want to include @babylonjs/inspector in my production buildā€¦do I (is it not too bad? I donā€™t really know lol)? But I do want my meshes to have the outline effect.

OutlineRenderer can be obtained through import ā€˜@babylonjs/core/Rendering/outlineRendererā€™

Inspector is indeed importing it which is where the magic came from :slight_smile:

3 Likes

And I just learned something new!

You are the master @sebavan !

1 Like

Thank you, that works!

1 Like