Xfrog tutorials - vid03 - Wind motion on a tree
Wind motion on a tree
begin 9/2/2020
1) Simple abstract tree - use motion noise equation on branch and leaf, render out sequence.
2) Add wind motion to an existing Xfrog tree branches and leaves.
3) Export one of these out as alembic (motion) and FBX (materials) cache, import into UE4.
====================================================
video 1 -
Exterior Rendering and Vegetation Look Development | Webinar | Unreal Engine
https://youtu.be/Ehg4sLxOH1o
video 2 -
XFROG, Wind in a Birch Tree - loop able math functions to move leaves
https://vimeo.com/30931581
video 3 -
Windy Palm (Hurricane simulation)
https://vimeo.com/30879935
video 4 -
Wind thru Tree, using Xfrog Software
https://vimeo.com/30879618
video 5 -
https://vimeo.com/140074861
XFROG, Wind in a Birch Tree - loop able math functions to move leaves
https://vimeo.com/30931581
video 3 -
Windy Palm (Hurricane simulation)
https://vimeo.com/30879935
video 4 -
Wind thru Tree, using Xfrog Software
https://vimeo.com/30879618
video 5 -
From website, older flash anim, Walli wind tutorial (36 min long)
trunk, branch1, branch2, branch3, all have CurveNurbs
branch1, CurveNurbs Xrot noise(0-u*100+100+i*10)*5 (just to make branches look different)
then make movement noise(t)*x, xfrog does not evaluate until some light keyframes have been set
more motion, variety noise(t*2+i*2)*x*0.3 + noise(0-u*100+100+i*10)*5
same thing on CurveNurbs of branch2 noise(50-u*100+100+i*10)*5 + noise(t*2.5*i*2)*x*0.5
That 2nd +noise part is wind, first part twist, and again you need to keyframe some Xrotate points
same thing on CurveNurbs of branch3 noise(0-u*100+100+i*10)*5 + noise(t*3.5*i*2)*x*0.5
last leafs, node flap, hit plus, increase control curves, set keyframes, noise(t*10+i*3+300+u*25)
same thing on CurveNurbs of branch3 noise(0-u*100+100+i*10)*5 + noise(t*3.5*i*2)*x*0.5
last leafs, node flap, hit plus, increase control curves, set keyframes, noise(t*10+i*3+300+u*25)
add tropism to the LEAF branch, direction +X, animates some gusts of wind back and forth.
Then he repeats this on the path curves of the other small branches, 3x, repeat every thing.
Full list of the xfrog functions used when making wind effects
https://xfrog.com/support/functions/
Full list of the xfrog functions used when making wind effects
https://xfrog.com/support/functions/
video 6 -
XFrog ACI GeoLeaves by Visual Dynamicshttps://vimeo.com/140074861
video 7 -
Kleines Experiment mit dem xfrog-Plugin für c4d (just leaves waving, sin wave?)
https://youtu.be/wDI-4xN2x4g
Now that we have out demonstration tree, we choose an easy to view variable to animate which in this case is SCREW, which rotates the leaf around the branch. First set two keyframes and view the motion, notice that our Expression is id(x)
====================================================
Walli information about Noise and Wind Functions
About the noise function. There´s no secret there - usually I start with something simple and sometimes I simply add a few more terms on a trial and error approach. But there are some general concepts:
a)The noise function might be to strong or to weak, so I simply multiply by a certain amount or by x (now you can use the control curve to tune the strength), like so noise(234)*3 or noise(154)*x
a)The noise function might be to strong or to weak, so I simply multiply by a certain amount or by x (now you can use the control curve to tune the strength), like so noise(234)*3 or noise(154)*x
b)If you use a formula like in a), every branch would show exact the same curve, completely bending to one side or the other at a constant rate. So the curve would turn either to the left, or to the right, depending on the value you have inside the noise function.
To get a different bend on every branch, you can introduce iteration function, "i". So when using noise(i), every branch will get a different bend, although still at a constant rate to the left or to the right. You can add a number and use it as "random seed", like so: noise(i+123) or noise(i*10) or noise (i*10+123).
To get a different bend on every branch, you can introduce iteration function, "i". So when using noise(i), every branch will get a different bend, although still at a constant rate to the left or to the right. You can add a number and use it as "random seed", like so: noise(i+123) or noise(i*10) or noise (i*10+123).
c)When using the formula like in a) or in b), they both might have one problem in common - branches will turn at a constant rate to one side or the other. So there is no real "wiggle", or random change of direction along the curve.
For that you can for example introduce x or u into the noise function, noise(x). noise(u). When using x, the control curve is fed into the noise function - that works perfectly fine. But I usually like to use x to control the strength of the noise effect and therefor I usually use "u", which is basically a ramp/gradient ranging from 0 at the base and 1 at the top. When entering noise(u), you probably won´t see anything interesting, you need to up the frequency a bit, for example with a multiplier. Like noise(u*8). Higher values means higher frequency. Keep in mind that the look also depend on the amount of Segments that are available.
d)Now usually when using the noise function to create a more random look, you simply combine what you need from a), b) and c). That´s the reason why I often end up with something like noise(u*25+i*5+123)*x. u to make the curve "wiggle" along it´s path, i to get a different shape for every branch, x to control the strength and then a random seed number.
For that you can for example introduce x or u into the noise function, noise(x). noise(u). When using x, the control curve is fed into the noise function - that works perfectly fine. But I usually like to use x to control the strength of the noise effect and therefor I usually use "u", which is basically a ramp/gradient ranging from 0 at the base and 1 at the top. When entering noise(u), you probably won´t see anything interesting, you need to up the frequency a bit, for example with a multiplier. Like noise(u*8). Higher values means higher frequency. Keep in mind that the look also depend on the amount of Segments that are available.
d)Now usually when using the noise function to create a more random look, you simply combine what you need from a), b) and c). That´s the reason why I often end up with something like noise(u*25+i*5+123)*x. u to make the curve "wiggle" along it´s path, i to get a different shape for every branch, x to control the strength and then a random seed number.
In your example below I divided the formula by (1+i). First child receives zero as iteration number and I avoid to divide by zero - therefor (1+i) instead of just i. So the first child would receive the full effect of the noise function. The second will be effected less, the third even less and so on.
Variables
x - values defined by the control curve, current value of the curve, animateable
t - animation time in seconds
f - frame number
i - iteration number of a multiplied object, starts at zero, so use (1+i)
used to get variation among branches along the main trunk
u - ramp/gradient along the length of a branch, range from 0 to 1
used to get variation of leafs along the length of one branch
====================================================
Tutorial #3 WIND and Functions
(Part1) make expressions and variables on simple tree
Hello there, my name is Jon Tojek, and this tutorial is going to cover all aspects of adding wind or ambient tree/leaf motion to your plant life creations.
We begin by building a simple but symmetric plant that we can test Xfrog expressions on. We will keep it light polygon so it animates quickly and we can test different functions and view the results in realtime. Start by placing three branches at the origin, trunk, Hydra, branch, leaf, for our simple symmetric easy to understand tree. (one Hydra, 3 branch objects)
Now that we have out demonstration tree, we choose an easy to view variable to animate which in this case is SCREW, which rotates the leaf around the branch. First set two keyframes and view the motion, notice that our Expression is id(x)
which means identity or "use the value of the Point Parameters below directly", so it is just a pass through expression, affecting nothing.
First we will get these leafs to move by animating or keyframing point_1 on screw which will give us a predictable motion around the branch. The expression id(x) is at the top slot, so it does nothing, and lets the keyframes control things.
Second, we can replace that expression with sin(f) or sin(f) * 0.1 which will replace that first keyframed animation with an oscillating repeating motion back and forth between -360 and +360, which we then make smaller by multiplying by 0.01.
That shows two ways to get motion, (1) by setting keyframes on any point of the x curve, or (2) using functions like sin, cos, with frame or time variables that change when we hit play.
This includes, cos(t), cos(f), noise(f), rnd(f)
Other variables you can add into these expressions are i for iteration, u, and x. (1) Start with x as that is our Point Parameter Curve or Control Curve, which right now is set to zero, but can be animated over time. This way we can combine keyframed x into our time driven expression.
(2) add u to any expression. This variable is ramp/gradient ranging from 0 at the base to 1 at the end of any branch. It is a small number so try multiply by ten with (u*10), so this can vary any effect along the length of the branch
(3) Lastly we will include i for iteration, which is an identifier number that each leaf has, from 0 to 5 in this case, for the 6 branches here.
sin(f/5) + noise(i+*10+123)
x+noise(i*10) This is the way to make each of the branches to have different leaf movement.
noise(f/9)*0.1+i*12+u*2*x
Put a little FLAP in there as well, first key 0 begin and end, then 45 in middle
then paste in x+noise(i*100)
sin(f/9)*.2+i*10+u*2
go back to this noise(f/9)*0.1+i*12+u*2*x
We still have repeating patterns here, because it is only one branching level animated, but clearly a huge amount of variation can be put into one level, and once we add some expressions to the levels underneath, the randomness for a 1000 leafs will never be noticed. We need to have pseudo random noise so that the motions are repeatable for render and cycles on multiple computers, repeatable behavior.
Make branches reach up to the sky with node angle parameter.
Do a quick replace of the branch2 path curve with a much better CurveNurbs! hit play
To make this into a fake tree, add twisty to branches noise(u*100+i*10)*20
then add motion, noise(t*2.5*i*2)*x*0.5 CANNOT HAVE SPACES IN THE EQUATION
Remember to set a keyframe on one of the CurveNurbs points to activate the expression.
Add 3 tropism for +Z, animate the intensity for big gust of wind, playback.
(Part 2) Now open a finished static Xfrog tree and apply wind effects.
AS20_Terminalia_catappa_Tropical_Almond variation 4, scale up 340x.
First show full ambient leaf animation, anim leaves on branchlet001 - 004 always nodeFlap. Keyframe 314 - 320 and put in this expression frms (1 - 300)
id(x)*sin(f/90)*0.3+i*3
id(x)*sin(f/9)*0.6+i*3 Faster Flapping
also keyframe the NODE FLAP of the branch that holds the leaves 472 - 555
Do this for remaining three branchlets.
First get an ambient leaf motion going for still shots, light wind.
Like the anims on Shotgun by RenderImagination.
Second use tropism to make a large gust of wind on all branches and leafs.
Search through the hierarchy to see which branches to affect by wind make the most sense, start by hiding most leaves except for Branchlet_001.
TO MAKE THINGS CALCULATE FASTER, turn off mult for branch1, 2, 5
remember they were 22, 15, 24
Clearly trunk, Mainbranch1 and Branch5 are the three big ones for tropism.
Select curveTrunk then Tropism, hit the plus sign, set three keyframes, 0, 100, 0
Everything goes in the +Z direction for wind gust
trunk middle is 150, main branches middle is 180, leaf middle 190+200
Now do tropism on the leafs, two at a time, start with Branchlet_001, then 002, 003, 004, giving us 8 total tropism winds on the leafs.
First pass wind animations_v09 - 09/09/2020 - vid03_wind_test_09.mp4
9/10 Thursday, modify the previous vid03_v26_bigWind.ma to more wind.
vid03_v27_backForth.ma
Now 5 keyframes, 1, 75, 150, 225, 300, values 0, 100, -100, 100, 0
slip in time branches, then more leafs for a whip lash effect.
Mainbranch1 = 3, Branch4 = 15, Branch1 = 22, Branch2 = 15, Branch5 = 24
under each little green branch that holds leafs, all 4 branchlets, add f/5
noise(f/10+u*255+i*55+75)*x (as well as increasing some constants)
(Part 3) Export animated mesh using Alembic Cache
In Maya you need to select the animated poly meshes manually in the outliner, not using the Xfrog "Select Mesh" button.
Or better yet, we will change the Override Display Type attribute from Reference to Normal, or value of 2 to be 0 = Normal, then we can easily select all the geo we want exported directly in the perspective view.
Select the top node or 2nd from top node, then hit Xfrog "Select Mesh" button. This will select most of the tree animated surfaces, but not all, so watch carefully. Next open the Attribute Spread Sheet, you should see many 40+ surfaces selected, go to tab ALL, then find the attribute Override Display Type, hit that word, put in a digit 0 which will change all valued in the column to Normal. Make sure you do this also to the trunk and any other branches you might miss. To verify you have succeeded just select all the polygon meshes in your window.
Then Cache -> Alembic -> Export Selection to Alembic, be sure to have both UV Write, and Write Face Sets checked ON.
Import the cache into Maya, check you have all the surfaces, full frame range, and reverse normals if you need to, then export out again, this is a verify check step.
You can import to any package now, here we try UE4, hit import, and choose import type Alembic Cache (experimental). Static works well, also, but will have no motion info. May need to scale up and rotate, then put into sequencer and verify you have 300 frames of windy tree motion.
Comments
Post a Comment