richm
11-11-2004, 05:16 PM
hi guys!
Im having some trouble with this script i wrote. i want to be able to set keyframes at certain times by using an increment variable.
only problem is that the currentTime command doesnt seem to like the idea of using an increment variable, and each time i query the currentTime it always returns 0. The currentTime works in an array of numbers like so:
int $array[4] = { 1, 2, 3, 4, 5 };
currentTime -edit $array[0];
currentTime -edit $array[1];
currentTime -edit $array[2]; and so on ...
but it doesnt work here
string $current_selection[] = `ls -selection`;
string $selected = $current_selection[0];
int $increment_frame[];
int $increment = 10;
int $frame_count = 200;
int $i;
for( $i = 0; $i < $frame_count + $increment; $i += $increment )
{
select $selected;
setKeyframe;
currentTime -edit $increment_frame[$i];
}
};
i was thinking of creating a reference, but MEL doesnt seem to support that ?
I hope someone can help? :)
Any other solutions to the problem would be greatly appreciated, but im really hoping that someone can figure out how to increment the currentTime but using a increment variable as the element of a variable :)
currentTime -edit $ourVariable[$counterVariable];
cheers :)
Im having some trouble with this script i wrote. i want to be able to set keyframes at certain times by using an increment variable.
only problem is that the currentTime command doesnt seem to like the idea of using an increment variable, and each time i query the currentTime it always returns 0. The currentTime works in an array of numbers like so:
int $array[4] = { 1, 2, 3, 4, 5 };
currentTime -edit $array[0];
currentTime -edit $array[1];
currentTime -edit $array[2]; and so on ...
but it doesnt work here
string $current_selection[] = `ls -selection`;
string $selected = $current_selection[0];
int $increment_frame[];
int $increment = 10;
int $frame_count = 200;
int $i;
for( $i = 0; $i < $frame_count + $increment; $i += $increment )
{
select $selected;
setKeyframe;
currentTime -edit $increment_frame[$i];
}
};
i was thinking of creating a reference, but MEL doesnt seem to support that ?
I hope someone can help? :)
Any other solutions to the problem would be greatly appreciated, but im really hoping that someone can figure out how to increment the currentTime but using a increment variable as the element of a variable :)
currentTime -edit $ourVariable[$counterVariable];
cheers :)
