Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Robot Volume 02 - Hybrid Rigging
You are here > Home > SimplyMaya Community Forums
Loading

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 17-08-2008, 03:49 AM   #1
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default 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". //
__________________
everything starts and ends in the right place at the right time.
Falott is offline   Reply With Quote
Old 17-08-2008, 03:53 AM   #2
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default

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 //
__________________
everything starts and ends in the right place at the right time.
Falott is offline   Reply With Quote
Old 17-08-2008, 04:24 AM   #3
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default

as usual I managed to steal it together


int $start = 0;
int $end = `currentTime -query`;
bakeResults -simulation true -t ( $start + ":" + $end ) -sampleBy 1 ....
__________________
everything starts and ends in the right place at the right time.
Falott is offline   Reply With Quote
Old 17-08-2008, 08:16 PM   #4
LauriePriest
Moderator
 
LauriePriest's Avatar
 
Join Date: May 2003
Location: London
Posts: 1,001
Thanks: 0
Thanked 59 Times in 51 Posts
Default

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 , reminds me of my scripts.
LauriePriest is offline   Reply With Quote
Old 17-08-2008, 08:24 PM   #5
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default

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 ^^
__________________
everything starts and ends in the right place at the right time.
Falott is offline   Reply With Quote
Old 17-09-2008, 03:08 AM   #6
alexanderH
Subscriber
 
alexanderH's Avatar
 
Join Date: Sep 2007
Location: Mississauga, Ontario, Canada
Posts: 450
Thanks: 0
Thanked 1 Time in 1 Post
Default

Originally posted by Falott
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 ^^
Sorry to bring this back to life, but as I think I may have a reason for your integer issue. While programming in several other languages I would say that a string of characters can contain numbers and characters. I'm not sure quite how mel works, but do you declare variables? And if not how does it differentiate between an integer and not. Maybe the time value as stored in maya is not stored or called as an integer but as a string, maybe it includes time zones?
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.
__________________
Peace, love and Anarchy~~~~~~~
______________________________
Wip:
iMac
Full House Project
Arch Viz Reel

My Website is Finally Back up!

“Welcome to the Internet. Where the men are men, the women are men, and the children are FBI agents.”
alexanderH is offline   Reply With Quote
Old 17-09-2008, 05:03 AM   #7
gster123
Moderator
 
gster123's Avatar
 
Join Date: May 2005
Location: Manchester Uk
Posts: 6,300
Thanks: 1
Thanked 51 Times in 45 Posts
Default

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.
__________________
"No pressure, no diamonds" Thomas Carlyle
gster123 is offline   Reply With Quote
Old 17-09-2008, 11:33 AM   #8
alexanderH
Subscriber
 
alexanderH's Avatar
 
Join Date: Sep 2007
Location: Mississauga, Ontario, Canada
Posts: 450
Thanks: 0
Thanked 1 Time in 1 Post
Default

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.
__________________
Peace, love and Anarchy~~~~~~~
______________________________
Wip:
iMac
Full House Project
Arch Viz Reel

My Website is Finally Back up!

“Welcome to the Internet. Where the men are men, the women are men, and the children are FBI agents.”
alexanderH is offline   Reply With Quote

A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.