SimplyMaya Forums

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

Home / forum / Animation / Mel Scripts & Programming / Obtaining Data From Graphs
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 19-10-2006, 12:57 PM   #1
gster123
Moderator
 
gster123's Avatar
 
Join Date: May 2005
Location: Manchester Uk
Posts: 6,300
Thanks: 1
Thanked 51 Times in 45 Posts
Default Obtaining Data From Graphs

Hi Guys

Is there any way to get a set of data from a graph in maya, for example a data series of the points of which keys are set so that the data series is as follows

Time (frame) Translate X Value
1 10
5 12
7 15
17 17


etc etc

Since the values are there to make up the graph is there a MEL script that can extract there values into a series of values likethe above example?

Hope this makes sense.

Cheers

Steve
__________________
"No pressure, no diamonds" Thomas Carlyle
gster123 is offline   Reply With Quote
Old 22-10-2006, 12:13 AM   #2
Alan
Moderator
 
Alan's Avatar
 
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
Thanks: 0
Thanked 5 Times in 5 Posts
Default

If I understand properly then you can do something like this:

float $timeArray[] = {};
float $valueArray[] = {};

int $nextIndex = size($timeArray);
float $currentTime = `currentTime -q`;

string $myObject = "pCube1";

$timeArray[$nextIndex] = $currentTime;
$valueArray[$nextIndex] = `getAttr -t $currentTime ($myObject + ".tx")`;



A
__________________
Technical Director - Framestore

Currently working on: Your Highness

IMDB
Alan is offline   Reply With Quote
Old 22-10-2006, 05:14 PM   #3
gster123
Moderator
 
gster123's Avatar
 
Join Date: May 2005
Location: Manchester Uk
Posts: 6,300
Thanks: 1
Thanked 51 Times in 45 Posts
Default

Nice one A!

Cheers for that, i'll give it a whack. If I get stuck will the help files give me some pointers to the attributes that your calling and the functions?

Very new to mel (have used Delphi and C++), only used the noise and random functions to animate things!


Cheers
__________________
"No pressure, no diamonds" Thomas Carlyle
gster123 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.