BrianK Posted November 3, 2006 Share Posted November 3, 2006 Can you animate variables - like those that you see when you "alt-shift-a". I know I could just make a channel & read it in place of using a variable... just wondering if there's a way to do it with variables. While I'm asking, can a variable be anything other than a constant value? Quote Link to comment Share on other sites More sharing options...
B.Walters Posted November 3, 2006 Share Posted November 3, 2006 You know, that is a fantastic question. And I'd like to add a question on top of that: is there a way to run a specified script every time the frame number changes? But here's the cheat/cheap way I found to do it: add a spare parameter to a given node being cooked, and in there use the curly brace expression mode {} , (What is that called by the way? Is there a proper term?)In there type the following: { run("set -g my_var = $F"); return 0; } It sets the value of the channel to be 0 (or whatever you type after "return" and before the semicolon). Then the run() expression runs the hscript command "set -g" which sets a global variable to a given value, in that example the current frame number. So replace the "my_var" with the name of the variable you want to animate it. It's cheap and dirty - but hey, it works. I'll post an example file to go along with this.animated_global.hip Quote Link to comment Share on other sites More sharing options...
Jason Posted November 3, 2006 Share Posted November 3, 2006 I don't think you can in the traditional sense (i.e. a channel), but I think you embed an "eval()" statement in the variable and so it can return a new value any time the variable is accessed (evaluated ) Quote Link to comment Share on other sites More sharing options...
peship Posted November 3, 2006 Share Posted November 3, 2006 i think they are looking more for something like variable variables in PHP. Quote Link to comment Share on other sites More sharing options...
BrianK Posted November 4, 2006 Author Share Posted November 4, 2006 Interesting ideas, guys. Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.