Blender Objects In Animation Nodes

Prerequisites:

The following is a list of all prerequisites in order to make the most out of the following tutorial.

Objects are the building blocks of every scene, the creation and duplication of such objects can be automated using Animation Nodes, to make the most out of these automations, we have to study blender's objects, and that's what we will be doing in this tutorial.

The following section explains the object-data in blender in general, so if you already know how this works, feel free to skip to the Animation Nodes section.

What is a Blender Object?

An object in blender is a container, this container have some properties that are shared between all objects like location, rotation, scale, visibility, pass index and many more.

The container also carry some data called Object Data, this data can be:

When you are in object mode, anything you edit changes the object properties and not their data, as soon as you enter the edit mode, you are now editing the object data and not the objects themselves. So if multiple objects share the same data block, changes to one of them are reflected on all others.

Example 1

Example 1

I added new object of type Mesh, a mesh data called Cube was created and it include the vertices, edges and polygons of a cube. I then duplicated the cube one time (using Shift + D), a new Mesh object was created and its mesh data became a copy of the original mesh data called Cube.001. Changes to the data of one of the objects aren’t reflected to the other.

Example 2

Example 2

I added new object of type Mesh, a mesh data called Cube was created and it include the vertices, edges and polygons of a cube. I then linked duplicated the cube one time (using Alt + D), the new object now contains the same mesh data of the original object and thus changes to the data of one of the objects are reflected to the other object. Notice that the mesh data Cube has 2 users now (2 objects that are using it), you see the number of users beside the name of the mesh data.

Objects In Animation Nodes

There is a single node that can create objects in Animation Nodes and that node is the Object Instancer Node.

Run blender because I want you to try couple of stuff with me. First thing to do is to add an object instancer and disable Copy From Source option. The node now lets you choose the type and number of the objects that you want to create.

Object Instancer

I will be creating 5 objects of type Mesh, as soon as I execute the node tree, 5 objects will be created and you can see them under the Animation Nodes Object Container which is an empty that is parent to all objects created in Animation Nodes. This parent help AN keep track of and manage objects created in it’s node trees. You will also notice that the mesh data of those objects are just empty meshes, and they are waiting for us to fill them with some data.

Instancer Example 1

There is a node in Animation Nodes that does exactly what we want, it is the Mesh Object Output Node and it simply write the given mesh data to the existing mesh data in the object. So we can do something like that to write the data of an icosphere to all of our 5 objects.

Instancer Example 2

The Mesh Object Output Node can also edit only one component of the mesh data, for instance, if I am only chaging the vertices locations, then I don’t need to write polygons and edge info and thus I can use the Vertices Only option:

Instancer Example 3

Alternatively, we could approach the above problem by chaging the mesh data block of each of the newly created objects to an existing one. This can be achieved using the Copy Object Data Node, the node simply assign the mesh data of the from object to the to object. Notice that the number of users is now 6 because we have 5 object using it plus the original owner.

Instancer Example 4

The above example is actually what the Object Instancer node do when the Copy From Source option is enabled. And it is also similar to Linked Duplication in blender.

Instancer Example 5

If you want to copy the transfroms, modifiers and constraints of the objects as well, you can enable the Copy Full Object option.

Note!

Notice that particles systems and physis data are actually modifiers so they are copied as well if Copy Full Object is enabled.

If you want to copy the mesh data instead of using it directly you can enable Deep Copy option.

Example1a

Example 1a

We sample the locations of the alive particles, then we instance an icosphere and place the instances inplace of the particles. But this is boring, lets do something more exiting.

Example2a

Example 2a

In this example we used a group of objects containing suzanne, cylinder and an icosphere to create a bigger list of objects that contain the previously mentioned objects in random order and amounts. We then used this list as our from object in copying the mesh data. Resulting in random object per particle.

Note!

There is a much more efficient way to do the last two examples but we won't conver them in thus post.

Example3a

Example 3a

Of course other type of objects can be used like texts which we can edit their data using the Text Object Output node. I encourage you to try the Curve Object Output node as well using curve objects.

LEAVE A COMMENT

unkerjay

unkerjay

You mention text as an object, but, there’s very few examples in yours (or others, including Jacques updates) on what can be done with text. Zach Hixson has just begun to touch upon text. MiesnerMedia is another one with a C4D Mograph tutorial, Thinking Penguin has done some work with text as has Jimmy Gunawan over at Blender Sushi (actually, the most that I’ve seen).

Text can be separated into Objects via node. Then it becomes problematic (at least for me) as to how to get it from there into something say as simple as an array controlled by an empty.

Well there are examples of how it’s done. Granted, but, with other objects. Text, tends to need to be either converted to mesh (or curves) or broken down via the separate text objects node. As such, it’s not the same as other objects. So knowing that it can be done with other objects doesn’t seem to be enough clarification for doing it with text.

I give credit to ALL who know far more than I do about Blender and how to make it sing and dance. I appreciate ALL that Blender does for FREE. I’m not unappreciative.

More on text would be nice.

Also, a number of your node examples, I’ve noticed Jacques doing the same thing, have nodes off frame connected to something else. I’ve mentioned it on Blender Artists. Maybe I missed it, or am just not up on the technique. My apologies. It won’t be the first (or likely the last time). Sverchok has built in the ability to import and export nodes via JSON or via Github. It would be nice, across nodes - materials, textures, compositing, animation, sverchok to have a uniform ability to save, share, import and export nodes. Even complex, detailed examples and explanations of nodes don’t take the place of a blender file or easier access to the nodes absent that.

I REALLY appreciate what you and others are doing with Animation Nodes and your willingness to share and create ALL this useful material.

Thank you for your consideration.

Suggestions, comments, criticism - welcome.

Thankx


unkerjay

unkerjay

Even Jacques, the developer, has noted the addition, absence, deprecation, elimination of nodes as a part of the development, improvement process. So, the task of keeping up with what can be done and how is a moving target. There was some really great stuff done a few years back that now is easily outdated given the changes to the most current version of Animation Nodes. Kudos to Jacques for vastly improving the documentation. And again to you and others for sharing your understanding and expertise. I take issue with the saying “Those who can, do. Those who can’t, teach.” We ALL get our understanding and experience from somewhere. There are those of us who are intuitive, gifted, and those of us who are not.

And I would take issue with the perceptions of that quote against what I’ve seen done by so many who teach. Apparently, you, they are “do”ing quite well.

We all have different ways of “do”ing and different ways of learning. The quote seems somewhat arrogant and shortsighted in regards to that reality.

More observations.

Thanx


Omar Ahmad

Omar Ahmad

There’s very few examples in yours or others (about text).

I do think that there isn’t a lot of resources about dealing with text object in Animation Nodes, either in the documentation, my posts or others’. Other people have expressed frustration about this as well. There is a reason for this (at least for me) and I will explain that in my next point.

Text can be separated into Objects via node. …. Text, tends to need to be either converted to mesh (or curves) or broken down via the separate text objects node.

The thing about texts in Animation Nodes is that we rely on blender’s text objects and font data, those objects and data being limited, in turn limit us when we try to make something out of it. One of the many limitations is the non-ability to control individual properties of the characters of text objects, as you stated, one can use the Separate Text Objects node to separate the text into individual characters then edit their properties as he wish, however, this is very inefficient and impose even more limitations. In fact, I think this node destroys everything Animation Nodes is trying to be because it is what I call an “operational” node, it doesn’t fit in the design of AN, it can’t be used along side other nodes. Those facts stops me (and may be others) from creating anything with text in AN (or in blender), it simply isn’t working.

What to do about it? Well, we can overcome some of the limitations with workarounds, those workarounds are of course still inefficient, as an example, consider this question which I answered with a workaround which the asker in turn used to do:

Example

The solution to our text problem is obvious, AN need to have its own text system. However, I imagine it is very hard for Jacques to implement something like this, even if he decided to, I imagine it won’t be anytime soon.

It is also worth noting that the documentation will have a detailed guide to texts next month, this might guide you through some of what you are trying to do.

I think that explains why nobody wants to deal with texts and I understand your frustration because I feel just like you.

Also, a number of your node examples, I’ve noticed Jacques doing the same thing, have nodes off frame connected to something else.

We do this because:

  1. We want the reader to stop reading for a second, start thinking, and try to guess what should be the nodes off-frame. This encourage self-study.
  2. Sometimes the off-frame nodes are just visible in another screenshot.
  3. Sometimes it is obvious.

I understand that it might sometime be annoying, but hey, you can always ask for feedback in any form and we will most certainly answer you.

Sverchok has built in the ability to import and export nodes via JSON or via Github. It would be nice, across nodes - materials, textures, compositing, animation, sverchok to have a uniform ability to save, share, import and export nodes.

I believe Jacques is working on that currently, you should probably expect it in v2.1. Developments happens in the Templates branch if I am not mistaken.

I will personally start to provide blend files and probably the templates files in the future. I have a resource section in the blog that needs to be filled.

Even Jacques, the developer, has noted the addition, absence, deprecation, elimination of nodes as a part of the development, improvement process. So, the task of keeping up with what can be done and how is a moving target.

I understand, I personally have to rewrite some parts of my blog every time something changes. But it is a price we have to pay for innovation and development. It should be noted that there is a very detailed release notes with examples that inform you of whatever was removed, added or changed. This should save you from what you just mentioned. Here is the release notes of v2.0. Also, the documentation is updated even before the new version gets released, so if you get stuck, you can just go visit the documentation. As you said, the documentation was improved and will further improve and as I said, there will be guides for everything soon enough.

I take issue with the saying “Those who can, do. Those who can’t, teach.”

I definitely agree with what you have to say about this quote.

Lastly, I want to thank you for sharing your thoughts and comments with me. Thanks !


Procedural Bookshelf In Animation Nodes
Procedural Bookshelf In Animation Nodes
Charts In Animation Nodes: Pie Charts
Charts In Animation Nodes: Pie Charts
Charts In Animation Nodes: Grouped Bar Charts
Charts In Animation Nodes: Grouped Bar Charts