Halloween Costume ideas 2015

AN / Controlling Object, Time, and Value With Nodes

Icospherical Suzanne Clones.
Positioning monkeys into Icosphere Vertex position.

If you are following this blog, or just randomly browsing the articles, you might notice that I have strange interest over node-based procedural modeling and animation method. I like the idea on how we can crunch numbers and data to the computer, and let the computer does some complex processing for you. And I also have big interest on data visualization. So whenever there is an opportunity to explore such tools in Blender, I jump on it.

By now, there are already quite a few node-based add-ons for Blender as for today. Eventually, they will be unified under one Blender node tree, I have that believe in Blender. I am quite picky on which node-based add on to choose. So far, I found Sverchok and recently Animation Nodes (AN).

The tools I pick based on my familiarity with Maya, Houdini, and a bit of Softimage ICE. I think node-based system shoud be user friendly and does it the Blender way, yet universal.

Sverchok is one Blender add-on that I have seriously explored in the past for its node-based procedural ability. I believe Sverchok was originally designed for procedural 3D modeling, however, Sverchok also can "move" and "animate" mesh and later on can animate objects thanks to Sverchok developers that allow animation to happen.

Animation Nodes (AN), is yet another add-on that allows us to create procedural animation in Blender by creating and connecting nodes, and let the data flow do the animation job.

One can think of procedural node-based worklow just like creating, modifying, and transforming a non-destructive ways, similar to Blender's own Modifiers. For example, there are Mesh Modifiers and Animation Curve Modifiers (inside Graph Editor, allowing you to generate, tweak and modify animation curve without destroying anything).


1. Generator Modifier inside Graph Editor.
2. Adding Noise Modifier on top of Generator Modifier, and Multiplying them together.


Few words of cautions, when dealing with node-based system, you may need to be comfortable with some programming concepts, such as:

  • Data types (float, integer, string, vector, matrix, etc)
  • Data conversion
  • Arrays and Lists
  • Loop and Iteration
  • Functions
  • Variables
However, unlike typed programming language, node-based is usually more visual and less abstract. In fact, node-based is can be really very advantageous and helpful for "non-technical" computer artists to have this ability to clearly see what is going on without worrying about the complexity of language. You could create a complex setup and modify certain setup for own purpose just by understanding the logic.

In my own word and understanding, a node is really a container that hides complexity and reveal functions, so we may care more about the data input, data output and data flow to get the final result. How all the functions work together. A bit like LEGO bricks, we kind of need to know what each block can do and how it can attach together to build a structure.

Understanding the concepts is more important than memorizing complex node-tree. You will find really quickly that there are many possibilities to achieve the same result. Some are more elegant, simpler, some are complex underneath, but beautifully presented. Sometimes a complex node-tree is good for some matters, but the more specialized, the harder to customize. 

Now, AN probably does not have a full complete set of animation nodes at this point, but it is growing and the number of nodes will continue to increase as it is continue to mature. Keep in mind also that nodes might change over time, this is the nature of the tool, once again I have to mention.

What really intrigues me with tool like AN, is the openness and potential both for learning and development. If you have enough skills you can eventually create your own nodes that you can share with other artists. And when we collaboratively create node-tree of certain setup, ideally we can re-use and build more complex tools.

So in this article thinking about Animation Nodes, I am trying to map out our learning areas. So I will be jumping around from topic to topic.

Enough preaching, let's explore this Animation Nodes add-on together! 


THINKING ANIMATION PROCEDURALLY

Manually animating in computer graphics involves keyframing values of attributes in different frames. The animation will then be created when the computer interpolate or create in betweens for those values that we specified when we playback the time. The speed of acceleration and the weighting of the interpolation (animation curve) can be adjusted manually via Graph Editor, whether we have linear motion, slow in slow out, stepped, etc.

NOTE: For character animation, usually animating involving posing the character controllers (!) and animator worried more about the actual emotion or story to tell. We will get there, but at the moment, we go to the most basic first.

In reality we are really controlling the motion of object using f-curve over time. Simple enough concepts that takes a while to understand. Make sure you understand that concept first.

Procedurally animating is pretty similar, just that user is a little bit more exposed into smaller components. We still be dealing with VALUES over TIME, and then CONTROL-ing how the values get interpolated.

Procedural animation is great for something that involves repetitions. Every so often, we would like to apply similar animations to a bunch of objects, with slight offsets or variations. Perhaps it is a building with lots of windows that we like to open at slightly different time, or maybe it is the lights that need to turn on not at the same time, but in a slightly offset kind of way (more interesting).

What can we control or animate? Ideally we want our node based to control everything. Animation Nodes seems to be able to do so already, even at this stage. If there are missing tools, one can always write Python code for it or request the developers.


1. Objects (tranform of objects: Translate, Rotate, Scale, Visibility)
2. Text
3. Mesh (vertices) or Curve
4. Color
5. Attributes
6. Others

Usually Motion Graphics animation deals a lot with these kinds of animations. It's good idea to look around for inspiration on YouTube or Vimeo for this kind of things.

Before dealing with complex nodes and array of multiple objects and exciting stuffs like loops, we should really start by building simple node-tree setup that does something to an object.

This is when you are free to experiment yourself by observing NODES and guessing what and how they function with the rest of nodes. Do make mistakes, but find out why and figure out how to resolve it.

In fact, if I think of "storyline" of learning curve for AN, it is going to go like this:
1. Positioning static object(s), eg. in flat map coordinate or spherical
2. Arranging object(s)
3. Animating object
4. Working with multiple objects
4. Other stuffs.

GENERATING SIMPLE MOTION RECIPE

Node Recipes:

  • Time Info (!)
  • Combine/Separate Vector
  • Object Transforms
There is ONE really special value that we can use for animation, and that is TIME, and it is commonly shown as Frames or Subframes when playback is run (Ctrl+A hotkey).

Time at the very basic means we are aware of Start Frame, End Frame, playback length or durations. Later on, you will find out that we can have "multiple timelines" for each object. It's one of biggest driving force of animation.

In AN, time value is accessed via "Time Info" node. When you run the playback or scrub in timeline, the Time value is also changing. Time Info node spits out Frame number value as Floating value (fractional).

So at the very basic, we could in theory plug that single value to control Translate XYZ, Rotate XYZ, and Scale XYZ of Object Transform.


Above, you see I plug a single value output from Time Info node into X of "Combine Vector". Then, I plug the Vector (3 values) into the position of Object Transform node to DRIVE the default "Cube" object in 3D scene.

You may notice that moving object one unit per frame is too big of a step, so we can reduce the speed for example by multiplying the value with 0.1. This results in Time that is 10 times slower (1/10). Below is how I figure it out.

I use Debug node already here. This is a quick way to see the OUTPUT VALUES at any point in the node tree. There are few debug nodes here, we will sure be looking at them time to time.


Now that you are familiar about Time value output, you can try pluggging this into Scale, this time below I plug it into Scale XYZ so it will "grow" the scale of "Cube" overtime.

If the value is the same for all 3 values Vector, you can use "Vector from Value" node, instead of plugging 3 noodles into "Combine Vector" slots.


You can also try plugging the value into Rotate XYZ.


Noticed that you have this automatically created "Vector to Euler" node. And you also have option to use Degree.

In degree, 360 degree is a full rotation. In Euler angle, .... well I do not know, maybe you know. But we can SEE the result in 3D. I use Suzanne the monkey object so I can tell if it hits 360 degree rotation.

NOTE: Later on this Vector business is important to indicate the direction axis of an object, especially when dealing with Matrix. A bit too advanced for now, I supposed.


Knowing that we can use values to control many things using nodes, we need to think of DRIVE and DRIVEN values.

Straight from top of my head, procedural motion can be driven using:
- Generated Values / Numbers
- Other Objects (master and slave)
- F-Curve via keyframing
- Math (with formula or expressions over time)
- Sound > Curve

NODE: VECTOR WIGGLE

Vector Wiggle is an interesting node. When we feed Time Info node (frame) into the Evolution, it will spit out smooth Vector positions over time and can drive an object so it is moving just like insect fly in the air.

I believe this Wiggle is also called 3 x Noise values (XYZ). Unlike Random that gives a random values resulting in a jumpy values between frame, Noise will give values that are closer to each other, meaning smoother motion.

Okey, so far, we know Time and Vector Wiggle can drive the motion of objects. Vector Wiggle itself is a specialized node that is based on Math Formula and Expressions. I might cover and explore this are more in depth. But looking at Math through procedural animation is a lof of fun.

Complex procedural motions can be created using Physics, Dynamics, and perhaps Particle simulations and behaviour animation like used in games. Actually if we get creative, maybe we can already use Blender's dynamics to work together with AN node.

MOTION BY COPYING OTHER MOTION



Above will result of 2 x Suzanne to be always on the left and right side of Cube object, 3 units apart.


MOTION BY F-CURVE

When we hit I to keyframe an object transforms, we are very likely creating minimum of 9 f-curves for translateXYZ, rotationXYZ, and scaleXYZ.

I believe we could "sample" and modify animation curve using AN nodes. I have not yet looked into this, but this could be interesting.


JUMP AHEAD: F-CURVE ANIMATION OFFSET SNAKE MOTION via TEMPLATE

AN add-on gives a bunch of really useful templates to use and to study. Feel free to try them. Personally I found the templates to be pretty complex, however, can be broken down.


When I tried to create this snake motions, I was doing it like below. The differences between above and below is that:

ABOVE: From the template, we are able to create this Master and Slaves very quickly. One object is animated using f-curve, and then all the rest of objects, become slaves clones of another object / same object as the master.

BELOW: Here the node tree is using a simple Loop system that simply delay the motion of clones to follow one master. I am doing it in a way that I understand it.









AN MATH NODES


Reciprocal Number node contains lots of basic Math Formula that you can use for noding. Maybe it should be called Math Formula node? :)

Expression node allows you to more easily type formula and creates your own input variables and plugging your own numbers.


Sine wave + Cosine wave = Circular Motion (translation)



AN TEXT OBJECT

AN add-on seems to be capable of dealing with Blender Text Object quite elegantly. There are few AN nodes that are dealing especially with text/string type of data and output it into Text Object.

In fact, I have a feeling that we can talk and play with Text Object. String type of object is really very interesting. If you know Python scripting a bit, Python is pretty amazing when slicing, combining text, list of text, etc, etc.



You create Blender Text Object and use the eyedropper thing to source the Text Object on Text Object Output node. THEN, you activate that Text Input button thingy and input your own text.


Random Text node generates string of text characters.




Create List node & Get List of Element node

You will get this really often with AN nodes especially when you started to dealing with multiple inputs. You supply some list of data/values and then you pick an element based on "Index".

In Python, let say we have list of text:
mylist = [ "Apple", "Banana", "Papaya", "Durian" ]

mylist[0] => "Apple"
mylist[2] => "Papaya"



String of Text can be totally awesome, I cannot emphasis this more.

Imagine if we supply text like this:

  • 010001000100
  • 010101010101
  • 000100010001

Those text can easily become like audio beats to procedurally control animations!

OTHER RECOMMENDED LANGUAGES

I really do not want to overload you with programming theories, however if you are serious about node and procedural workflow, you may want to also side-learn creative programming languages below that are available and open source.

  • ChucK (audio programming)
  • Processing (creative visual programming, based on Java and Javascript p5.js)
  • Python (Blender scripting language and also language that is used widely in computer graphics and many areas).

You can learn it in tandem, but if too hard, you pick one below while learning tool like Animation Nodes (AN). The idea is to understand the logic and concept of programming and the flow of data, not so much about the language itself.

Post a Comment

MKRdezign

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget