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