11
$\begingroup$

Edit: This thread is not concerned with Instances and their usage in normal blender but with the usage of instance object node in animation nodes

I struggle with a probably simple question. I created a simple circle array. The elements of the array are created with object instance node. In my advanced case i want to create smaller circles, offset them and so on. I can do this by simply copying the circle-array-loop but it is not handy.

I tried to to it with a simple example but i does not work out. I created a simple loop that offsets 4 instances of a cube. I created an object list output for the loop to put the results in a new object instance node and offset it with a new loop. But it works only with the first element.

Some advice?

enter image description here

enter image description here

Here is my current project including node tree. By instancing the loop i thought I'll be able to change the number of orbiting circles on the fly (inluding some math for the radius)...

enter image description here

$\endgroup$

3 Answers 3

11
$\begingroup$

Unfortunally the Object Instancer does not work in subprograms, because node it has to monitor the scene to keep track of a specific set of objects. It's very similiar to the Separate Text Object node.

There are two main ways to work around that:

  1. Calculate the number of objects you need and create that many before the loop starts. For a simple grid there is also a template:

    enter image description here

  2. Make the first row of instances using AN and then use the array modifier like I did in this audio animation:

    enter image description here

    For that the source object needs an array modifier and you have to activate Copy Full Object in the Object Instancer node so that the modifiers are copied to the instances as well.

    enter image description here

[EDIT]:

I just created a node tree that does parts of what you want to archieve. You may be able to use it as a reference:

enter image description here

Basically I use approach 1. here. The first loop splits the long object list into multiple shorter lists with equal length. The second loop calculates the positions of the objects.

$\endgroup$
3
  • $\begingroup$ It is a shame. My life would have been so easy. :D Thank you for the provided examples. In my current project i'll need to find a different solutionen, but they are very helpfull to understand AN better. Thans for that. $\endgroup$
    – maegmaeg
    Jan 31, 2016 at 11:19
  • $\begingroup$ Wow. I would upvote it, if I had not done this earlier. Thank you a lot. Exactly what I wanted to do... $\endgroup$
    – maegmaeg
    Jan 31, 2016 at 13:27
  • $\begingroup$ Is it possible to implement in the future the Instancer within a Loop feature or Instancer which can handle object list as an input? $\endgroup$
    – Prag
    Mar 8, 2018 at 15:07
5
$\begingroup$

This answer isn't specific to animation nodes, but it may still be useful to use this with animation nodes.


Instance of instances are supported via Groups, which can be instanced using empties that instances those groups (dupli-groups).

There are some limitations however:

  • You can't add modifiers to dupli-groups (that apply to all instances)
    Though the instances themselves may have modifiers.
  • The state of the mesh-data in the dupli-group can't different between instances.
    A character being instanced for eg, could not have a different pose in each group instance.
$\endgroup$
1
  • $\begingroup$ Is your answer really related to animation nodes or to normal workflow in blender? $\endgroup$
    – maegmaeg
    Jan 31, 2016 at 9:58
4
$\begingroup$

I don't think it is likely to happen in AN, since AN clearly tells you that you cannot put Instancer node in a subprogram.

One way to do this in AN is to generate location list one time for all instances.

For 2D Grid or even 3D Grid array, you can simply use the preset, which can be found in the Templates menu at the right side of the header.

Besides, as @ideasman42 said, using dupli-group is not a bad workaround. You can first create instances for the first loop, then group them manually, then use them as dupli-group of a target object (it has to be a non-empty object! Because AN cannot create instance for empty. So here you have to use dupli-group instead of group instance. Don't worry, the target itself won't be actually rendered once you use dupli-group for it), then you can create instances for this target object as the second loop. Something like this:

enter image description here

$\endgroup$
1
  • $\begingroup$ Probably my basic example is misleading as it does not point to my usecase. I'll add a new image. I want to use an object, create instances and distribute them evenly on an circle. I achieved this by calculating X and Y-coordinates with simple math. Elsewhere Jaques helped me to use matrices to rotate the result around world origin. That works great, but my idea was to us an second instance object node to duplicate my circle and to give the instances different values for radius and rotation. I can do that by duplicating the loop and it is okay, I only hoped it can be done with less nodes. $\endgroup$
    – maegmaeg
    Jan 31, 2016 at 12:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .