quick help with "currentTime"
hi!
I would need some actionButtons to save myself some time. basically I just want to query the current time and asign this integer value to a variable. this is my action: bakeResults -simulation true -t "0:2769" -sampleBy 1 -disableImplicitControl true -preserveOutsideKeys false -sparseAnimCurveBake true -at "tx" -at "ty" -at "tz" |Hips; and I need to replace "0:2769" with "0:$time" or something. and I need help because $time = currentTime -query; print $time; bakeResults -simulation true -t "0:$time" -sampleBy 1 -disableImplicitControl true -preserveOutsideKeys false -sparseAnimCurveBake true -at "tx" -at "ty" -at "tz" |Hips; I am just too stupid after all // Error: $time = currentTime -query; // // Error: Line 1.21: Invalid use of Maya object "currentTime". // // Error: $time = currentTime -query; // // Error: Line 1.27: Invalid use of Maya object "query". // |
i have it working so far to print the number but
$time = `currentTime -query`; bakeResults -simulation true -t "0:$time" -sampleBy 1 -disableImplicitControl true -preserveOutsideKeys false -sparseAnimCurveBake true -at "tx" -at "ty" -at "tz" |Hips; // Error: line 3: Invalid time unit: 0:$time // |
as usual I managed to steal it together
int $start = 0; int $end = `currentTime -query`; bakeResults -simulation true -t ( $start + ":" + $end ) -sampleBy 1 .... |
what you where querying from current time wasnt being stored as an intiger hence it was an invalid time unit?
complete guess, im crap at mel serious hashing togeather :D, reminds me of my scripts. |
as far as I understand is it was a integer because I could let maya print the number. it must have to do something with the syntax how i placed the variable. you know ´""§$%2´´+.. <------------ this pretty much covers my understanding of mel :)
but it´s working. that´s what matters ^^ |
Quote:
I'm sorry if this is absolutely useless, but maybe the whole thing needs a little more research to figure it out. I guess that your works is what matters though. |
You tell it what they are such as
string $onething = "hi" ; int $secondthing = 1 ; float $thirdthing = 0.1 ; if you just add variable and dont tell maya what it is it assumes. |
I realize I was blind while reading all the previous posts. I see "int" all over the place. And well that is kinda the default integer declaration. My bad.
|
All times are GMT. The time now is 02:08 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018