frameCache node

Become a member of the CGSociety

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

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 10 October 2003   #1
frameCache node

Hi There,

Can anyone think of a way to be able to use a variable with the frame cache node, which can be used in an expression.

Basically, instead of :

connectAttr frameCacheNodeName.past[integer] objectConnected.attribute,

I'd like

connectAttr frameCacheNodeName.past[$variable] objectConnected.attribute

Cheers.

__________________
It's real sun out there
 
Old 10 October 2003   #2
Maybe with the "eval" command.

string $cmd = "connectAttr frameCacheNodeName.past[" + $variable + "] objectConnected.attribute";

eval($cmd);
 
Old 10 October 2003   #3
works okay, and thankyou ajk48n (, but can anyone think of how to make this an animateable parameter?
Seems like the frameCache node can only receive one value in an array. Am I right?

Cheers
__________________
It's real sun out there
 
Old 10 October 2003   #4
Maybe you could use the current time to get your variable:
////
$varible = time - 1;

string $cmd = "connectAttr frameCacheNodeName.past[" + $variable + "] objectConnected.attribute";

eval($cmd);
////
Don't know if this will work, but it might be worth trying.
__________________
mike hovland
lead technical artist
Robomodo

Life beats down and crushes the soul... art reminds you that you have one. - Stella Adler
 
Old 10 October 2003   #5
Mike,

yep, that would work, but it still won't give me imput.
Anhow, I've given up on the frameCache node, optimized as it is , and gone with good ol' clunky getAttr.

I'm just trying to get a heirachial offset like on the attachment.

I'm wondering if some guru could show me how to optimize this clunky code. It works as I would like it too, but I know it's cumbersome.

EXPRESSION FOR AUTO OFFSET:

float $delay = frame - parent.lag;
float $dampIO = parent.useDamping;
float $damp = parent.damping;

if ($dampIO==off){

child.translateX = eval("getAttr -t " + $delay + " parent.translateX");
child1.translateX = eval("getAttr -t " + ($delay - parent.lag) +" parent.translateX");
child2.translateX = eval("getAttr -t " + ($delay - 2*parent.lag) +" parent.translateX");
child3.translateX = eval("getAttr -t " + ($delay - 3*parent.lag) +" parent.translateX");
}
else
{
child.translateX = eval("getAttr -t " + $delay + " parent.translateX")*$damp;
child1.translateX = eval("getAttr -t " + ($delay - parent.lag) +" parent.translateX")*($damp/2);
child2.translateX = eval("getAttr -t " + ($delay - 2*parent.lag) +" parent.translateX")*($damp/3);
child3.translateX = eval("getAttr -t " + ($delay - 3*parent.lag) +" parent.translateX")*($damp/4);
}


help!



Attached Files
File Type: zip offsetanim.zip (8.5 KB, 11 views)
__________________
It's real sun out there
 
Old 10 October 2003   #6
frameCache, as you've discovered, simply isn't flexible enough to do what you're trying to do. Using getAttr in an expression is usually worth avoiding, but in a case like this it's effective. Just be careful (as I just pointed out in a different thread) not to accidentally force recalculation of your entire scene twice on every frame by getting values for attributes that require such recalcuation.

-- Mark
__________________
Mark R. Wilkins
author of MEL Scripting for Maya Animators
 
Old 01 January 2006   #7
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
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 01:02 PM.


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