Debugging per particle expressions is pain in the butt when you have lot's of stuff affecting things. I figured if I just could export the data out of few particles in to a text file and import that in a spread sheet program like excel (i use star office). This way I could get a graph out of virtually anything. So I though I could create a shelf button (thanks danny for the idea) labeled "Export debug data". But I ran in to a problem. Take a look at the code and you'll see what I mean.
global proc oceanDebug()
string $fileName = ( `internalVar -userTmpDir` + "debug.csv" );
int $fileId=`fopen $fileName "w"`;
int $rangeMin, $rangeMax, $i;
$rangeMin = `playbackOptions -q -min`;
$rangeMax = `playbackOptions -q -max`;
for($i = $rangeMin; $i <= $rangeMax; $i++)
// Here comes the problem...
string $debugData = "Hmm... I can't access per particle attributes from here, can I?\r\n";
fprint $fileId $debugData;
print "Debug data exported successfully.\n";