Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Programming (https://simplymaya.com/forum/forumdisplay.php?f=32)
-   -   Debug dilemma (https://simplymaya.com/forum/showthread.php?t=3649)

kbrown 01-02-2003 12:21 AM

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";
}


mark_wilkins 01-02-2003 12:55 AM

Sure you can.

What you need is the "getParticleAttr" command. It's all explained in the MEL Command Reference.

-- Mark

kbrown 01-02-2003 12:57 AM

Ah, the missing piece of my puzzle... Thank you very much!


All times are GMT. The time now is 10:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018