Only seeing root node, not whole hierarchy
Opened this issue · 1 comments
I'm doing some work with https://github.com/dataarts/dat.guiVR, running a local copy and trying to use this plugin to help debug layout. I can't see that it could have anything to do with being on localhost, but it does mean I don't have a direct link to repro it with I'm afraid.
For some reason, although there's a fairly deep hierarchy (as can be seen in the console in my screenshot) the inspector is not able to drill deeper than the root node. It works on other three.js examples, and I can modify properties on that one object.
The reason is a due to what I consider a bug in the specification of data.guiVR.
This creates a function name() on some of its three objects,
which conflicts with the usual purpose of a three object name.
When threejs-inspector tries to post a message which includes this it throws an exception;
as functions cannot be posted this way.
threejs-inspector should maybe protect its back by catching the exception;
not sure exactly what it should do instead in the general case;
probably post a somewhat simplified data line.
A nasty specific workaround is
InspectedWin3js.postMessageToPanel = function(type, data) {
if (data) {
var s = data.name;
if (typeof data.name !== 'string') data.name = data.name.toString();
}
window.postMessage({
type: type,
data: data,
source: 'threejs-extension-inspected-window'
}, '*');
if (data) data.name = s;
}