frameCache node

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
  10 October 2003
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


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

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

  10 October 2003
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?

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

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

Don't know if this will work, but it might be worth trying.
mike hovland
lead technical artist

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

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.


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");
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);


Attached Files
File Type: zip (8.5 KB, 13 views)
It's real sun out there
  10 October 2003
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
  01 January 2006
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:13 AM.

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