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-07-2004, 02:31 AM   #1
suzanne
Registered User
 
Join Date: Jul 2004
Location: Vancouver
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default test if channel has animation

Is there a mel command to determine whether a given channel of an object is animated or not ?

Thanks ...
suzanne is offline   Reply With Quote
Old 17-07-2004, 03:10 AM   #2
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Hi Suzie. Maybe the listConnections command could be used to determine if a given channel is connected to anything (eg an animation curve, expression or sometehing else). Let's say that you want to test if the rotateZ of a nurbsSphere1 is controlled by something:

Code:
{
	string $sAttrConn[]= `listConnections -source 1 -destination 0 nurbsSphere1.rotateZ`;

	if( size($sAttrConn) > 0 )
		print("nurbsSphere1.rotateZ is controlled by something");
	else
		print("nurbsSphere1.rotateZ is not controlled by anything");
}
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
Old 17-07-2004, 03:45 AM   #3
Dann
Registered User
 
Dann's Avatar
 
Join Date: Feb 2003
Location: Los Angeles
Posts: 695
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Well there is the "attributeQuery" command, but I can't seem to figure out how to use it.

However, you can use a command like...

string $list[] = `listConnections pCube1`;
where pCube1 is the name of your locater to see if it has a translate or rotate node connected to it.


Hey!!!
When I first started my post, no one had replied. I was all excited to have figured this out. I got sidetracked and by the time I submitted my posting, good ole' K-man had beaten me to it.

Rats.

Last edited by Dann : 17-07-2004 at 03:47 AM.
Dann is offline   Reply With Quote
Old 17-07-2004, 04:04 AM   #4
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

lol @ dann
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
Old 23-07-2004, 06:15 AM   #5
mark_wilkins
Registered User
 
mark_wilkins's Avatar
 
Join Date: Jan 2003
Posts: 161
Thanks: 0
Thanked 1 Time in 1 Post
Default

The only strictly complete way to check for animation is to go through each frame and check each vertex position. However, if you're comfortable guessing that the animation will be keyed on a particular channel, doing a listConnections and looking for animCurve nodes of various types will be the simplest way.
__________________
Mark R. Wilkins
author of MEL Scripting for Maya Animators
www.melscripting.com
mark_wilkins is offline   Reply With Quote
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
New Feature: Post videos David Members Lounge 8 09-12-2010 07:54 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.