Category Archives: Design

Anything to do with 2d, 3d or design work

cinema 4d and some rpf love

There was a bit of banter on twitter about DOF in Cinema 4D and I have to say I’ve never had really good results with it. Most people seem to complain about it not working with fur, reflections and other post effects it’s common issues from what I gather but my reason for not using it was always time. It takes too long to run out the effect, test to see if it looks ok, tweak and re-render. So years ago while I was still working in video I stumbled across the rpf file format. This was in the days before twitter, blogging and general social sharing of info so it was a shocker at the time to find info you needed sometimes. rpf files store a lot of info and you actually end up with a set of files that have not only your scene, alpha but also some 3d data. What I will attempt to demo is how to use of this info. I admit that this may not be the best workflow, several people have mentioned other tricks that I may play with but this is to show how I’ve done things in the past.

Cinema 4DSo enough blathering, the first thing is to put together a basic scene to demo how the rpf file works. Here I’ve got a bunch of cubes stretching away, a couple of lights and a camera. Heres one of the first things to note, there is a light with a brightness of 0. I’ve called it ‘place 1’ and its tucked away between the 4th and 5th cube. More on that later.

Cinema 4DNext I animate the camera and go to the render settings, fill in the options and this is our second take note part. See the ‘compositing project file’ options? Ever seen that before? No? Great Scott man you’ve missed out then. Tick the save box and the 3d data box then click the save project file option, select your destination and hit render.

Cinema 4DWhat you get is a bunch of rpf files and a project file with the extension aec. ‘Whats that then?’ I hear you cry (actually everyone is snoring so I’ll shout it myself.


Well, its an After Effects project file but if you try to open it in after effects right now it will just throw a fit, get moody and ignore it so you need to install the AE plugin that comes with Cinema 4D.

Go to the Cinema 4D folder, find the ‘Exchange Plugins’ folder > After Effect > win/osx folder (pick for your system) and within there should be CS folders with plugins for each version of CS. Open up your one, unzip the file within and place it within your AE plugins folder.

Got it?

Good, now go start up AE and goto import > File and pick the aec file NOT the rpf file. I know normal instinct is to import an image sequence but this is the magic part.

Cinema 4DWhat imports (if your plugin is in place) is a folder and a couple of comps. One of them will be the scene while the other will be called something like Camera+Light, the third thing will be your image sequence of the rpf files. Time to have some fun.

Double click the camera+light comp and you will see each of your lights and a camera as a layer. Each item will be labeled as you left it in Cinema 4D so some logic helps and you should find your placeholders there. Here I’ve imported a random image into the comp, made it 3d and copied the x,y,z position from ‘place 1’ and put it into twittertop’s (0,0,785.158)… And lo, did the jpg take on the exact position of the placeholder.

Cinema 4DIts also worth remembering that you can edit the lights with AE and change the colour, brightness etc… it wont affect your rendered rpf files but it will affect anything you add to the scene in AE.

Cinema 4DNow we switch back to our main scene (untitled 1 on the screen shots) and if you scrub the timeline back and forth you will see the camera pan around the jpg as if its part of the scene, well thats a bit rubbish isn’t it? It just appears over the top of the scene. Pointless at this stage but lets dig a little deeper into AE.

Cinema 4DFirstly put the Camera+lights layer below the rpf layer. Select the rpf later and goto effect > 3d channel > Depth Matte and apply it to the sequence. You may find your layer vanishes in the preview window but this is fine, drop down the effects on the rpf layer and then drop down the depth matte. Now comes the magic, you need to tweak this number until you see something happen, with this the number sometimes has to be quite high and in this case its -2600. As you change the number you should see the cubes vanish as the depth matte moves down the depth. Oooooo its like some kind of evil wizardry that’s stealing the cubes….

Cinema 4DScrub the timeline back and forth and you may notice that the depth matte isn’t perfect if you camera moves, its working on a fixed point from the camera so you may need to keyfrome the effect if your camera moves.

Cinema 4DOnce you have this setup you want to have the other cubes appear so select the rpf layer, duplicate it (cmd+d on a mac, buggered if i know on a pc) and move it below the camera+light layer. Finally Invert the depth matte with the invert option (its that simple). We now have our image wedged inbetween our cubes.

Cinema 4DNow we come to the final bit and what kicked all of this off, DOF. You can use the effect from effect > 3d channel > Depth of field for this. At this point the info from the depth matte comes in handy as if you want the DOF to be based around your imported image you simply use the same depth numbers here. Yes you will need to keyframe but you know how to copy and paste keyframes don’t you? If you don’t you can copy a keyfrome, select where you want to paste it. So you copy the depth key frome and paste it onto the DOF focal plane. Copy the DOF filter and paste it onto the other RPF layer and your done apart from the mass amount of tinkering your mind is currently ticking over with.

I used this depth trick to produce the Kamppi advert a few years ago so you can see it in action on my YouTube channel.

For those who care to try out a final thing, heres my quick project with files and stuff. You may need to tweak some of the paths but thats your problem, not mine. Suck it up and act like a man… or a woman. I’m not sexist.

rpf-demo project download its 16mb if your interested. Please feel free to ask away either on here or twitter and I will do my best to answer as best I can.

Weapons of choice

The little chaps coming along well.
Cthulhu so far
As I’ve had a couple of questions about my work I thought I’d share a photo of the tools I’m using at the moment for my sculpture. I’m mainly using these four even though I’ve a big selection of them that I’ve collected over the years.

From left to right they are:
– A flat blade with a curve to the tip for smoothing out flat areas and on the other end is a rounded halfball for small depressions
– A wooden tool with a shallow bend at one end and a thicker bit to the other end
– A sharp edged scraping tool useful for removing material smoothly with a flat end the other side. I have to say I don’t use the lower end much
– A home made tool which is a brass tube with a piece of wire held in place with a bit of Milliput and the wire is hammered flat like a screwdriver end. This tool has been invaluable for making the wrinkles around the eyes and hands

My other tools include a number of home made ones, shop bought and some dental tools that a very kind dentist gave to me years ago. I was given about a dozen in total as he said he can only use them for a short time before they have to be replaced so rather than chuck them away he donated them to my worthy cause. As a number of them turned out to be the same I traded a few for bits (students work well on barter systems), some I modified to different shapes by hammering or grinding them while the rest are perfectly good tools that I still have the pleasure to own. Over the years I’ve collected quite a few bits with weird and wonderful (if sharp) edges but there always seems to be a basic few I reach for when starting something.

On a related note, HP Lovecraft appears in an article on the BBC site which talks about the recent anniversary of his death. While Cthulhu is obviously one of his most recognisable creations, I’ve always had a soft spot for the Deep Ones. ‘Shadow over Innsmouth’ is my favourite story of his and on a more recent reading I couldn’t help but snigger at a reference to Ipswich (even if it is the one in the USA). While at college I once tried to sculpt a deep one but gave up after struggling with the basic shape, maybe it’s about time I tried again.

Days cycled to work: 55
Days driven all the way to work: 0
Days driven half way to drop the car off at the garage to have a service: 1
Days tramped along in snow and ice: 2