Jump to content

Can You Animate Variables?


Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...