Uniquely Color Clones for a Matte with Cinema 4D's Formula Effector

Photo of Rick Barrett

Instructor Rick Barrett

Share this video
  • Duration: 04:09
  • Views: 3931
  • Made with Release: 17
  • Works with Release: 17 and greater

Create a Matte via based on MoGraph id or UVW coordinates.

Learn how to create a matte pass that uniquely colors each clone using the Formula Effector. You'll first learn how to apply a greyscale value to clones based on their ID value. Next you'll use MoGraph UVW coordinates (which store the original relative position of clones) to create an RGB matte.



- In this Cinema 4D quick tip, I'll show you a couple of techniques for using the formula effector to generate a matte pass that puts a unique color on each clone within a cloner. We have a simple five by five cloner here, and I'm going to simply add a formula effector. If you've watched prior quick tips, you already know that in the formula, we can simply type ID, and that's going to be a value of 0 up to 125 in this case, because we have a five by five by five grid. In this case, we want to go ahead and divide that by count. So we're basically getting a percentage of 0 to 100%. What you see is that with the default transform here, we're basically scaling and moving these clones as a percentage, much like you get with a step effector, it's actually applying to each clone individually. A step effector on a grid array will actually only apply in one direction. Let's go ahead and clear out the position and scale, and instead we're going to turn on the color mode. Now, we're basically getting a unique gray scale value on each of these cubes. Some of these gray scale values are so close that you won't be able to tell the difference, unless you actually sample them. And of course, if you want to make a matte pass out of this, what you're going to want to do is pull this color into the material system by creating a new material, turn on only luminance, and in the luminance channel, go ahead and add a MoGraph color shader. Now if we apply that material to our cloner, you'll see that we get a unique luminent value on each clone. But, what if we want to actually get an RGB grid based on the position of the clone in the initial grid? We can do that as well within the formula effector, because we also have access to these UVW variables. These UVW coordinates do not relate to the texture at all. What they actually are is an internal coordinate system on the cloner that relates to the original position of the clone in the set. With a grid array, we have the U direction, the V direction, and the W direction. If we enter a formula here of just U, what we're going to get is a gray scale value that goes from forward to back, and what we can do is then set the color mode to user defined, and color this as red. We'll go full red. We also want to make sure to enable the use alpha strength check box. Right now, it's going from red to white, because the default color in the cloner is white. What we want to do is actually go ahead and make that black so that everything's adding on top of black. Now we're going black to red. Now what we do is we just simply create another formula effector, and this one we're going to simply type V, and we're going to clear out the position and scale. In the color mode, we're going to set it to user defined and use green, and use alpha strength. The one other thing we need to do here is go down to the blending mode, and we need to add this on top of the prior effector. We'll go ahead and add one more formula effector for the other dimension, W, and we'll turn off the position and scale, and set the color mode to user defined with blue, use alpha strength, and blending mode add. Now that you can see that we've built a matte based on the original position of each clone in the grid, and you can pull a matte from the red channel to get just the U dimension, from the green channel to get just the V dimension, or from the blue channel to get the W dimension, or you can grab a unique clone by matting an RG and B value. The really cool thing about this, again, is that if I apply other effectors to this, these are still colored based on their original position in the clone set. You can create some really neat effects with that. Have fun matting your clones.
Resume Auto-Scroll?