Is there a way to inject a message into the Commands list?
photonstorm opened this issue · comments
I know about using the Metadata
, which is great for adding extra information to an existing gl object, but is there any way to insert a message into the Commands list? I would love to be able to flag an area of commands, as it can be quite a challenge finding the right place to start checking the commands when there are hundreds of them!
I am pretty sure what you look for is the setMarker and clearMarker APIs : https://github.com/BabylonJS/Spector.js/blob/master/documentation/apis.md
This will add a nice searchable tag for each commands between set and clear.
Would that work for you ?
Thanks - does this only work when you create a Spector instance yourself, i.e. not when used via the browser extension? I can see the SPECTOR
object when the extension is installed, but it doesn't appear to have anything I can call on it.
there should be a spector instance in the window when the extension is on :-)
I usually use it from the console
Ah-ha! Lower-case spector
works a treat, thank you :) For anyone else finding this further down the line, it's window.spector
for the current instance, not SPECTOR
.
Yup SPECTOR is the namespace and spector the instance.... I feel bad writing this as it does not look like the most efficient naming :-)
Just to add a little more confusion, there's SPECTOR.Spector
too 😅
In typescript declaration it would be:
const spector: SPECTOR.Spector
Just to be sure we do not forget it is spector we are using...
I hate myself when I see it and @deltakosh is probably laughing reading the comments ;-)