stupid question

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
Old 11 November 2003   #1
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 November 2003   #2
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 November 2003   #3
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 November 2003   #4
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 November 2003   #5
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 November 2003   #6
sorry guys I am not dat familiar with mel:annoyed:
Old 11 November 2003   #7
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
Old 11 November 2003   #8
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 November 2003   #9
Maybe the object gets some double transformations? Or they have different scales? I dunno
c ya
Old 01 January 2006   #10
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

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
Society of Digital Artists

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

All times are GMT. The time now is 05:54 AM.

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