Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Programming (https://simplymaya.com/forum/forumdisplay.php?f=32)
-   -   Obtaining Data From Graphs (https://simplymaya.com/forum/showthread.php?t=23521)

gster123 19-10-2006 12:57 PM

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

Alan 22-10-2006 12:13 AM

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")`;


:ninja:
A

gster123 22-10-2006 05:14 PM

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


All times are GMT. The time now is 07:47 PM.

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