Debugging on the PixelBlaze

Do you have any advice on what kind of strategies I can employ to debug on the PB? How can I get feedback about what values are in certain variables at certain times?

In this particular case I’m getting an out of bounds exception and I’m not sure why.

I just discovered exporting variables and turning on the watcher, and that helps immensely. Are there any other tricks I should know about?

Yeah, the exported var watcher. I want to add better debug/trace, there’s a lot that could be done with the editor integration as well.

If I want to “debug” a value at a particular point in a render and/or loop, a conditional set would do it. e.g. to capture some value at index 4:

export var debugVar
for (i = 0; i < pixelCount; i++) {
  // ... stuff ...
  if (i == 4)
    debugVar = someInterestingValue

Then you can live-edit that constant to see other indexes (or move it to a variable closer to the top)
Or you can make an array to hold all values (assuming free space).