Debug dilemma
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.
Code:
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++)
{
currentTime $i;
// Here comes the problem...
string $debugData = "Hmm... I can't access per particle attributes from here, can I?\r\n";
fprint $fileId $debugData;
}
fclose $fileId;
print "Debug data exported successfully.\n";
}
Last edited by kbrown; 01-02-2003 at 11:44 PM.