I would like to know how to create an iris with animation nodes. Specifically to be able to create one leaf so that it can be duplicated placed around a circle and aligned to the edge of circle and then be able to rotate inward, as an iris would do as in this example, https://www.youtube.com/watch?v=QINfesdpxVs. I would like to be able to do this with animation nodes so that I could can just make and modify one leaf and also control the amount of leafs as needed without having to create and move things as I'm doing now outside of AN in Blender.
1 Answer
Yes, this is pretty straightforward with AN.
I created an object called "Vane01" which is the individual curved slice of the iris. This is the individual object in the upper right of the gif.
Then I created a set of nodes which duplicates Vane01 around a circle, and rotates those duplicates in parallel to make the iris.
I started with a bezier circle, then used the AN "evaluate spline" node to select 16 points evenly spaced along that curve.
Using the Object Instancer, I made 16 copies of Vane01, then located them at each of the points provided by Evaluate Spline.
Evaluate Spline also provides the tangent angle at the selected point, which allows you to angle the Vane copies around the curve.
Then, by adding the rotation angle of the original object, I rotate each of the Vane copies. This allows all of the iris elements to rotate smoothly in parallel, providing the Iris effect. It is important that Vane1 (and thus every copy) has its origin at the pivot location of the base, so it can rotate there instead of the center of mass.
By editing Vane01, different shapes can be tried out. Also, the node layout has an integer input variable which allows you to vary the number of vanes in the iris.
Here's the blend file for the simple iris model. I made this in Blender 2.79, using Animation Nodes 2.0.4.
Complex version
As practice for myself, I also made a more complex version, which dynamically adds guides for the vanes. I wanted to see what shape of frame would be required to make the Iris work correctly.
I've also attached that .blend as well if you're interested.
Here's the blend file for the complex iris model. HTH.
-
1$\begingroup$ Thanks for your effort this is a great help. $\endgroup$ Aug 13, 2019 at 13:18