Creating a String of DNA Using Clones
In this tutorial we will create a string of DNA using clones. Thanks to MoGraph, this type of animation can be created in the blink of an eye. We will also use MoGraph to alternate the color of each string of DNA.
Start by opening the following file:
The first section of DNA has already been built - now all MoGraph has to do is generate clones to create a string of DNA.
Generating the clones
Each sphere already has its own material applied to it. The connecting rod will, however, be colored using a MoGraph shader.
We will begin by using clones to create the string of DNA. Create a
Of course the clones must also be rotated to form a spiral shape. This can also be done stepwise by, for example, setting the Setp Rotation.H value to -24°. This can also be done using a
An Effector can automatically be assigned to a specific Cloner object by simply selecting that Cloner object and creating an Effector from the
Now that the string of DNA has its spiral shape we will turn our attention to the connecting rod’s material.
Random materials for the clones
We will primarily use MoGraph to apply random materials to the DNA. First, we will create a new material by double-clicking on an empty area of the Material Manager.
Select the Color channel in the material’s Attribute Manager settings and create a Multi Shader by clicking on the arrow next to the Texture parameter and selecting Multi Shader from the menu.
Click on the name of the shader you just created to make its parameters visible in the Attribute Manager. Here you can define colorful gradients for your DNA. The gradients defined here will later be randomly assigned by another Effector. In order for this Effector to be able to correctly access the gradients we will set the Shader Properties’ Mode setting to Color Brightness. A Random Effector will be used to select a shader based on the brightness of random colors.
The image above shows four different sample Gradient shaders (of course you can define any colors you like). Each of these shaders has a gradient consisting of two colors, which can be defined by simply clicking on the color handles and selecting the desired color combination.
Set each Gradient’s Type option to 2D-V to make the gradient run horizontally along the connecting bars.
Assign the material to the Cloner object - not to the Cylinder object. The Effector will then assign the material to the Cylinder object’s Child objects as well.
If we render the scene in the Viewport we will see the material on the clones but it does not vary. This is why we will now add a Random Effector.
To do so, select the Cloner object in the Object Manager and then select
Switch to the Effector tab and select a Random Mode of your choosing (for our sample scene - see link below - we have selected Turbulence).
You can compare your results with our sample scene by clicking on the following link: