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 10-01-2010, 02:21 PM   #1
Ecker00
Registered User
 
Join Date: Jan 2010
Location: UK & Norway
Posts: 4
Thanks: 0
Thanked 4 Times in 4 Posts
Default Maya Expression - Value of Object Attribute at specific frame

Hi!
To get the value of an objects attribute at the CURRENT time is just to write:

ObjectName.AttributeName

But what if I want to get the value of the objects attribute at a SPECIFIC time?
Would be grateful for a fast reply, cheers!
Ecker00 is offline   Reply With Quote
The Following User Says Thank You to Ecker00 For This Useful Post:
Old 10-01-2010, 06:46 PM   #2
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,982
Thanks: 33
Thanked 532 Times in 471 Posts
Default

Nasty little hack-together:

// set below
//===================
$object = "polySphere1";
$attribute = "radius";
$getAtTime = 24;

// don't touch below
//===================
$oldTime = `currentTime -q`;

currentTime $getAtTime;

$value = `getAttr ($object + "." + $attribute)`;

currentTime $oldTime;

// do something with the result
print $value;
__________________
Imagination is more important than knowledge.
NextDesign is offline   Reply With Quote
The Following User Says Thank You to NextDesign For This Useful Post:
Old 10-01-2010, 09:40 PM   #3
Ecker00
Registered User
 
Join Date: Jan 2010
Location: UK & Norway
Posts: 4
Thanks: 0
Thanked 4 Times in 4 Posts
Default

THANK YOU SO MUCH!
That was exactly what i needed! Was going nuts because I couldn't find a way to do that. I was sure it was an easier way to do it, but this method works great!

Basically now I've made a script with make my characters feet move correctly according to the ground. So I animate him to walk on the spot, and the scripts moves him correctly on the ground according to the movement of his feet.

I'm very new to Maya, and this is my first real project (making a dance), and this will make my life a lot easier!


Cheers man!
Ecker00 is offline   Reply With Quote
The Following User Says Thank You to Ecker00 For This Useful Post:
Old 11-01-2010, 02:47 AM   #4
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,982
Thanks: 33
Thanked 532 Times in 471 Posts
Default

No problem mate. Glad to help out.
__________________
Imagination is more important than knowledge.
NextDesign is offline   Reply With Quote
The Following User Says Thank You to NextDesign For This Useful Post:
Old 11-01-2010, 08:42 AM   #5
bendingiscool
Subscriber
 
bendingiscool's Avatar
 
Join Date: Jul 2006
Location: London
Posts: 567
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hey there,

As you are new to all this it's probably not so important, but if you want to get realistic motion, you are going to have to think about getting the feet not to slide along the floor.

Unless you have already accounted for that in some way?

cheers,
Chris
bendingiscool is offline   Reply With Quote
The Following User Says Thank You to bendingiscool For This Useful Post:
Old 11-01-2010, 06:25 PM   #6
Ecker00
Registered User
 
Join Date: Jan 2010
Location: UK & Norway
Posts: 4
Thanks: 0
Thanked 4 Times in 4 Posts
Default

@ bendingiscool
Hi, that is the basic idea behind the script. As I had problems with the characters feet sliding on the ground. So the script calulates how the character would move around according to the animation of the feet. If that makes sense... or just look at this crap example I put together in 5 min: LINK
Ecker00 is offline   Reply With Quote
The Following User Says Thank You to Ecker00 For This Useful Post:
Old 11-01-2010, 07:40 PM   #7
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,982
Thanks: 33
Thanked 532 Times in 471 Posts
Default

You usually always want to animate the center of gravity by hand, as this is where a lot of the illusion of weight comes from.

In your case, you need to animate the root translation node, as well as the center of gravity to create a good look.

You application of the script looks cool though! You just need to find a way to be able to create some animation on top of the generated animation. Perhaps by having a locator, parented to another. The script run on the child, and you animation the parent. You then parent constrain the child locator to the center of gravity.

See if that works.
__________________
Imagination is more important than knowledge.

Last edited by NextDesign : 11-01-2010 at 07:45 PM.
NextDesign is offline   Reply With Quote
The Following User Says Thank You to NextDesign For This Useful Post:
Old 11-01-2010, 07:58 PM   #8
Ecker00
Registered User
 
Join Date: Jan 2010
Location: UK & Norway
Posts: 4
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Thanks for the tips NextDesign!
I really see what you mean, and I've been thinking about it. Because it's hard to make it look natural doing animation with math. It's smart to have manual controle over everything so the script don't overrun natural motion. I'll try the method you mentioned, was a good idea.

Thanks once again! =)
Ecker00 is offline   Reply With Quote
The Following User Says Thank You to Ecker00 For This Useful Post:
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
New Moderators on Simply Maya Miss_Nova Site News & Announcements 21 17-05-2011 01:24 AM
Maya Hair/Polygon Error ingram_no.7 Members Lounge 13 10-12-2010 11:27 AM
LayoutTools for Maya 2011 is here... ctbram Members Lounge 1 06-12-2010 11:32 PM
Open a Lightwave file in Maya 2011 radiant777 Maya Basics & Newbie Lounge 2 04-12-2010 03:45 AM

Thread Tools





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.