SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 31-01-2003, 11:21 PM   #1
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default 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";
}
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!

Last edited by kbrown : 01-02-2003 at 10:44 PM.
kbrown is offline   Reply With Quote
Old 31-01-2003, 11:55 PM   #2
mark_wilkins
Registered User
 
mark_wilkins's Avatar
 
Join Date: Jan 2003
Posts: 161
Thanks: 0
Thanked 1 Time in 1 Post
Default

Sure you can.

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

-- Mark
__________________
Mark R. Wilkins
author of MEL Scripting for Maya Animators
www.melscripting.com
mark_wilkins is offline   Reply With Quote
Old 31-01-2003, 11:57 PM   #3
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Ah, the missing piece of my puzzle... Thank you very much!
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.