CGTalk > Software Specific Forums > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 11-08-2003, 08:26 PM   #1
clarix
Frequenter
 
Join Date: Aug 2002
Posts: 182
stupid question

Hi guys,

if I have an attribute that controlls the rotation of object a and b. Now could you also offset the rotation of object b from a through an expression????


Thanks in advance
 
Old 11-09-2003, 02:41 AM   #2
zachgrachan
Know-it-All
looking for work...
 
Join Date: Mar 2003
Posts: 434
If I get you right,

//this would go in objA's rz expression:
float $rotation = controlObj.CustomAttr;
objA.rotateZ = $rotation;

//this would go in objB's rz expression:
float $rotation = controlObj.CustomAttr;
objB.rotateZ = $rotation + 25; // this is the offset part
 
Old 11-09-2003, 06:09 PM   #3
clarix
Frequenter
 
Join Date: Aug 2002
Posts: 182
Re: stupid question

Quote:
Originally posted by clarix
Hi guys,

if I have an attribute that controlls the rotation of object a and b. Now could you also offset the rotation of object b from a through an expression????


Thanks in advance





Hi zachgrachan

Thanx for the reply, but I am talking abt offsetting the time and not the rotation. They both have the same rotation but lets say object a starts at frame 1 and object b starts a few frame later.

Thanks again
 
Old 11-10-2003, 07:47 PM   #4
mark_wilkins
Scream.
 
mark_wilkins's Avatar
 
Join Date: Jan 2003
Posts: 1,339
You could use a getAttr in an expression and get the value at a previous frame, then set "Always Evaluate" because you're not using a proper node connection when you do this.

"Always Evaluate" is reportedly buggy though. There's a type of node called frameCache (also, regrettably, buggy) that can store attribute values from a range of frames and hook them up to object attributes... that might be a better choice if evaluation speed is an issue.

-- Mark
__________________
Mark R. Wilkins
author of MEL Scripting for Maya Animators
 
Old 11-10-2003, 10:32 PM   #5
Buexe
Expert
 
Buexe's Avatar
portfolio
Jan Berger
Germany
 
Join Date: Apr 2003
Posts: 2,286
The frameCache node is great except that it does not update when you change the input (animation) curve. This seems to be a bug that Alias is not too eager to get rid off.
 
Old 11-11-2003, 04:24 AM   #6
clarix
Frequenter
 
Join Date: Aug 2002
Posts: 182
sorry guys I am not dat familiar with mel:annoyed:
 
Old 11-11-2003, 08:53 AM   #7
Buexe
Expert
 
Buexe's Avatar
portfolio
Jan Berger
Germany
 
Join Date: Apr 2003
Posts: 2,286
You actually don`t need to be familiar with mel to use (well a little would be helpful) the frameCache node, just type in the command line:

createNode frameCache;

You can turn off "show dag objects only" in the outline so that you can see and select it there.
Then open your connection editor and load the new node to the right side of the window . Create a " driving object with keyframes, let`s say on translateY, load this object to the left side of the connection editor window and connect the translateY attribute on the left to the stream input on the right of your frameCache node. Now you have connected the animation curve to the frameCache you can check this connection in the hypergraph. In order to connect the frameCache to the "driven" object a little mel is helpful, in the command line type:

connectAttr -f frameCache1.future[5] locator2.ty;

connectAttr = command to connect Attributes
-f = forces the connection
frameCache1 = name of the frameCache node (might b other in your case)
future = if you want the driven object to have a positive (later) offset use future, if you want it earlier type "past" instead of "future"
[5] = is the offset in frames, must be an integer, greater or equal 0
locator2 = name of the driven object, might b another in your case
.ty= translateY the attribute you want to drive

Note that you can use only one attribute as driver per frameCache. If you wanted all three translate values offset you would need to create three frameCache Nodes. The thing has a major bug though. If you change your input animation curve, the frameCache node will NOT reflect (update) this change.
good luck
buexe
 
Old 11-13-2003, 02:32 AM   #8
clarix
Frequenter
 
Join Date: Aug 2002
Posts: 182
Hi Buexe,

thanks for the reply and the offsetting works fine, but now dat offsetted object goes way off screen although they were supposed to have the same translation as the other one, but now I dnt have any controll over the speed and the translation.


Thanks again
 
Old 11-13-2003, 08:57 AM   #9
Buexe
Expert
 
Buexe's Avatar
portfolio
Jan Berger
Germany
 
Join Date: Apr 2003
Posts: 2,286
Maybe the object gets some double transformations? Or they have different scales? I dunno
c ya
buexe
 
Old 01-16-2006, 04:00 PM   #10
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 11:53 PM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.