jeromeetienne / threejs-inspector

chrome devtool extension to debug three.js
https://chrome.google.com/webstore/detail/threejs-inspector/dnhjfclbfhcbcdfpjaeacomhbdfjbebi
200 stars 45 forks source link

trouble when global "scene" is not what you'd expect... #33

Open quacrobat opened 6 years ago

quacrobat commented 6 years ago

Issue: Everything breaks if the name of the THREE.Scene is not "scene".

How: Our app has its own Scene class which wraps around THREE.Scene - so for historical reasons, the global variable "window.scene" is not THREE.Scene. Instead the THREE.Scene is refered to throughout our app by scene.main.

Result: Threejs Inspector (TI) does not see it, and when we declare window.scene = scene or window.scene = scene.main, TI seems to hijack the variable and any function calling our initial scene breaks.

Any way we can configure TI to expect and accept other variable names for the global scene? e.g. in our case we'd set window.inspectorScene = scene.main

Merci!