“In the beginner’s mind there are many possibilities, but in the expert’s there are few”
Last night, I was watching this inspiring speech by self-learning street Jazz guitar bass player, and he said something like this: When he performs, his performance at the very moment is not rehearsed, it's really cannot be repeated and it was based on his self-drive (passion) and motivated by the energy of the audiences in the room. I feel that writing on my blog feels like that too.
Simple Object Transformation
We all already know how to position an object in 3D space in Blender. Whether it is via keyboard and mouse interface:
G = grab move
R = rotate on cam (also: r-x, r-y, r-z)
S = scale
On via the Property (N) panel.
We can do the same using AN node.
"Object Transform Output" node at a glance allows you to transform a single object. Use the tiny eyedropper thing in the node while selected the object you want to transform. Check and uncheck the transform attributes that you want to use.
As soon as you do this, you notice that you cannot grab move or transform this object via the normal viewport anymore. The AN node will override any transform value or animation keyframes this object might have. Something to keep in mind.
Object Transform Input & Object Transform Output
If you are like me, I like to still have control over my object, we can use Empty for example to act like the top node of the actual object you want to modify using AN nodes.
Another way is to use "parenting" but in node way. Use Template "Simple Parent". You see here by multiplying Matrix we have Parenting happening.
But you will be dealing with Matrix if you do it like that. Which is okey and can be more preferrable way for more advance setup.
Try this and see if you understand what is going on. |
Object Matrix Input and Object Matrix Output can be more useful than the Object Transform Input and Object Transform Output. You can easily do some Math Matrix to offset objects etc.
ABOVE: I have Cube and Monkey. Then the Matrix of the Cube is sourced for the Monkey, but I also add few other stuff like Vector Add to offset the monkey and also use Round node so that Monkey will follow and move the cube but will always pop and snapping to the grid.
I just want to show it to you early. Ok let's back to the basic stuff...
FLOAT > VECTOR > POSITION
We could further break the position or rotation or scale into Vector value, and further down into 3 x Float values. Position/Translation and Scale are pretty simple, however Rotation input slot is a bit different as we see further below.
As Jacques commented in previous article that if we plug Float value (single) into Rotation, it will be smart enough to create Combine Euler node. Try plugging single value into X or Y or Z and rotate the object. Instead of Cube, use Suzanne for orientation.
The (rotation) value is measured in Radians by default, but you can switch on Degrees. You can use Google to test it. For simplicity, use degree for now.
LIST OF TRANSFORMS
Next, we want to see how AN nodes allow us to have multiple values / list of values that we can pick. Think of this like multiple takes in a shot.
We can start with "Create Vector List" node for positions.
Noticed the New Input button to add more list of vector. You can add or remove this list via the property panel for the node.
See the faded blue color output node from create List? Faded color means it has multiple values stored, you can test this using the Debug node. Or perhaps Debug Drawer node. Whichever feels more convenient to display the values.
Now try plugging those list of values into the Object Transform Output. Right away you will see that AN node tree automatically added "Get List Element" node and let you pick only 1 value from list of vectors we supplied. The value is marked with index 0, 1, 2. Because we have total of 3 values. Index always started from 0.
At any point, try playing with those numbers, manual scrubbing of Index is one of the thing I often do, just to see if everything is still working as intended.
Sometimes I use Time or Wiggle or Random just to see thing moving when playback is run.
RANDOM NUMBER > INDEX OF GET LIST ELEMENT
Above results in randomly generated number (depending on the seed) that will feed into the Index value of Get List Element, to then pass in a Vector value to position the object.
TIME > REPEAT TIME > INDEX OF GET LIST ELEMENT
Above results in sequential popping of 3 Vector positions for the object. This is because we are using Repeat Time and the Rate of repeat.
RANDOM VECTOR
"Create Vector List" node is great if we want to manually type in or plugging certain specific values and know that the total.
Sometimes I am more interested in values that get generated automatically, and we can just specify the "total" of the list.
Let's try "Random Vector" node.
You may have done this many times before, but try it anyway, and play with Node Seed, Seed, and Scale values. If you are curious type, you may wonder why we have 2 Seed values? The Node Seed that does not take input is the main seed value to randomize everything. While the other Seed is becoming more useful if later on you start to use Loop and doing iterations to multiple objects.
USING MESH TO POSITION OBJECT(S)
There are many ways to place an object. Below I am using the vertex position of Cube, and pick one of the position to pass on to position the Icosphere.
What is the advantage of using Mesh? We can use Blender's own Modifiers to modify the mesh, thus the positioning of vertices will also changes accordingly.
By now, you are probably getting impatience already and starting to ask:
- What if we have multiple objects input and want to randomly place those??
- Can't we create instances or duplications of object and place it on the mesh??
- Why is this so similar to Particle Instancing?
Well... we will eventually do all those, easy. If we continue on this path, we will go really complex real soon. This is a big trap of node based system, I think :)
A slightly modified Template: Grid Arrange Objects can give you simple point instancing based on mesh vertices.
ABOVE: I supplied this mesh that is called "Line". The vertex positions of "Line" are used to place "Instances" or Duplicates of Icosphere object. This is really similar to Blender Dupli Objects. However, each instance is actually a real object that can have it's own behaviour.
What actually more interesting here is the Loop Input and Invoke Sub Program nodes, and also the special coloration of some nodes. When we started to deal with multiple objects, we will need to use Loop and Iterations.
NOTE:
In Sverchok, when we have multiple numbers/objects, we get this "Vectorization Loop" more or less invisible. That is because Sverchok very often deals with this for handling Mesh vertices and lots and lots of values. However, in AN environment, we get to see this "process" more clearly. This can be used as our advantage as you can see later on.
I will try to have a really simple example to explain this multiple objects looping and processing in next article.
I actually cannot wait to start "animating". Animating between Positions is next. I promised. If you cannot wait, you can try using one of the node below.
Post a Comment