Animating with Expressions – P1 – Linking, Editing and Basic Mathematics – Flame 2019.2

Hi everyone, Grant for the Flame Learning Channel. In this set of videos on animation… We’ll take a look at animation through mathematics… Or better known as expressions. Now before you think it’s easier… to manually keyframe everything… just give me a little bit of your time… and you may be quite surprised. Now expression animation may seem like an advanced topic… But we’ll be covering the basics… In order for you to get the most out of this timesaving tool. If you would like to follow… Please click the link in the description below. Alternatively, if you’re watching the podcast… Then please type the displayed link in your web browser. Now expressions can perform very simple operations… All the way up to advanced mathematical calculations. And a good understanding of their fundamentals… Will help you in the long run. So starting at the beginning… Expressions are based on a few core principals. Firstly, a good understanding of relationships… Secondly, basic mathematics… And finally, an understanding of the Flame Expression Syntax. If you get all three points… Then you’ll already have plenty to start using expressions in your workflows. So let’s start off with relationships. One purpose of an expression… is to create animation based off other animation. In other words, one animation channel can generate animation for another channel. So for instance… You have an animation move on the x-position channel of this geometry. Now you would like this text to spin as it moves across the screen. Flame makes expression relationships easy to establish. This is known as linking… And there are two ways to link channels to each other using expressions. Firstly, in the axis object menu… you can call up the contextual menu over the X-position slider. Very simply, you would choose to copy the selected animation channel. Next, go to the Z-Rotation channel… And call up its contextual menu. In the list, you link the channel. The Z-rotation slider displays a dotted line under the value… to tell you that an expression is applied to this channel. Now if you scrub the time-bar or press play… you can see that the rotation is derived from the position of the geometry. As a tip, if you are working in Batch or BatchFX with expressions… The node containing the expression will also show a dotted circle… As an expression indication. And as a reminder… This dot indicates animation in the node. Now let’s look at the second way of linking an animation channel with an expression. Returning back to Action… Reset the Z-rotation channel with CONTROL+ALT+CLICK. Now let’s go into the animation curves to see what is going on. Hold SHIFT and double-click on the X-position channel. This brings up the channel editor in the viewport… And the X-position channel is now selected and framed in the view. Pressing the viewer button… Will display your result in the bottom portion of the screen. You can work this way if you want… But you can also swipe to the right of the screen… To swap the viewports around. Now whether you are looking at the object menu or the animation curves editor… you can link the channels together. So with your channel selected… you can press the COPY button. Next locate the z-rotation channel and select it. Underneath the CUT, COPY and PASTE buttons… you can press the LINK button. This creates the expression link… and you have a few visual indications to show you what is happening. Firstly, the E symbol is the most obvious indication… that the channel has been affected by an expression. Secondly, the curve in the channel editor cannot edited… as it is based on an expression. Finally, you can see the expression beneath the selected curve. In this case, it simply says POSITION.X. Now we will get into channel and object identification for expressions… but for now, the layman’s way of reading this expression… is simply, “The value of the Z-Rotation channel… equals the value of the X-Position channel.” So when you scrub or play the composite… you can see the value of the X-position equals the value of the Z-rotation. This is the fundamental relationship of an expression in Flame. The next part of expressions is mathematics. This can range from basic maths… Such as addition, subtraction, multiplication and division… And go all the way up to advanced mathematics… Including algebra and trigonometry. So right now, the value of the expression on the rotation channel… is equal to the value of the position channel. Let’s say the rotation is too fast… and you would like to slow it down. So you need to reduce the size or height of the rotation curve… In comparison to the position curve. You can achieve this through division. We will take the value of position X that is -900… and divide it by 10. To edit the expression… Ensure the channel is selected… And click the expression button. This is mapped to the closed square bracket on your keyboard. This opens the expression editor… And you can see the original expression, Position.X. To divide position X by 10… you simply add to the end of the existing expression… divide by 10. Pressing Enter confirms the expression to the channel… And the animation curves update. Scrubbing or playing the composite… illustrates that the rotation is 10 times less than the value for position. To finish off this example… I would like the rotation of the geometry to be clockwise… instead of anti-clockwise. To do this, you need all the negative values in the rotation channel to be positive… And all the positive values to be negative. In basic mathematics, a negative multiplied by negative is positive… And a positive multiplied by a negative is negative. This theory can also be applied to the expression. So currently the value of rotation was derived from the position… And that outcome was divided by 10. This is what gives you -90 at frame 1. Now you need to take -90… and multiply it by -1 to make it positive 90. Press the EXPRESSIONS button or closed square bracket to open the expressions editor. Go ahead and place round brackets or parentheses… before and after the original expression. The parentheses tell us to work out the value inside the brackets… before calculating with the values outside the brackets. So in this case, Flame will first work out the value in the brackets, which is -90… And this will be multiplied by -1. Pressing enter on the keyboard confirms the expression. Scrubbing or playing the composite… Shows the movement of the geometry… as well as the derived rotation through expression animation. As a final visual tip… You might notice that your axis manipulator… Does not rotate with the geometry. This is because the orientation is set to WORLD. If you change the orientation to OBJECT… You’ll see the axis is definitely applied the rotation to the selected object. Now for those of you who have never used expressions before… you might be thinking that its quicker to manually keyframe. However, the more advanced your designs and composites become… expressions can speed up the way you work… by automating animation tasks… as well as allowing for fast and precise adjustments. In the next video, you’ll push this further… by using expressions across multiple objects in the composite… as well as introducing certain function and references… that you can use to alter the expression results. Please subscribe for updates to the Flame Learning Channel… And comments, feedback and suggestions are always welcome and appreciated.

Leave a Reply

Your email address will not be published. Required fields are marked *