Loading...
Logo
Processing Forum
Here i'm going to show you my quick and dirty method for creating animations and rendering them using Cinema 4d.

The Process

1. Draw 3d models in processing.
2. Export an obj for each frame.
3. Load objs into Cinema 4d.
4. Sequentially hide and unhide the models each frame creating the animation.
5. Render it all out.

ObjExporterrr

I have tried out many libraries for exporting objs in processing. The best i found was the obj exporter / octane render library by muehlseifeThe main thing it provided better than other libraries was accurate co-ordinates for the center of the exported model, the model itself sits at 0,0,0 and doesn't have a mysterious center floating somewhere nearby.

I modified the library slightly (3 lines), just so that you can choose what the filename is allowing you to put "###" somewhere so it creates sequentially numbered models for each frame.

If you download the original there are great examples on how to use it. Just remember to add the filename to the constructor like this;

Copy code
  1.  oct = new octaneRenderer(this,"filename###"); 

One this to note is that in order for the model to be centered, the library does a translation before exporting so you need to make sure you haven't already done a translation which will affect this. For example, i normally translate everything to the center so i can see whats going on. Something like this;

Copy code
  1. void draw() { 
  2.   background(0);
  3.   translate(width/2,height/2)
  4.   if(exportObj){ //<- export if mouse was pressed
  5.     oct.exportObj();
  6.     oct.setMaterial("globe",100,100,100,255);
  7.     oct.setObject("Globe");
  8.     exportObj = false;
  9.   }  else { //<- If not exporting translate to the center
  10.     translate(width/2,height/2)
  11.   }
  12.   renderGlobe(); 
  13. }

Importing into Cinema 4d

This is a pain because of Cinema 4d's bad support of objs. 

The best way is to use  Riptide Pro which is a plugin an supports batch import of objs into the same scene. A free way is to use Cinema 4d's Content Browser to navigate to where your objs are and drag and drop them into your scene and hit enter loads of time.

Creating the animation in Cinema 4d

In order to make the animation you need a different obj visible every frame. This would be a very tedious process but I found a c4d with and xpresso script which does this for you. You can get it here.  import-mesh-xpresso.c4d

Now the models are sorted alphabetically so you will need them to be in order after they are sorted. The way to do this is have "###" in the filename so processing numbers them, eg, filename001, filename002, filename003. Make that there are 0s in the otherwise filename9 will be after filename89, if that makes sense.

Once all your objs are in Cinema 4d and in the right order you select them all and drag them into the object called blender. This object has all the scripting. Remember into not under.

Then render it out :) 

This took a lot of trial and error and a LOT of googling so hopefully this will help anyone looking to do something similar to me.

Have fun!

Replies(2)

Most of the links in this thread are not working. Would be good to make an update ! Hugs !


I tried similar stuff using the free Pov-ray which can render beautiful images.
Pov-ray: http://www.povray.org

(there is a pov-ray-exporter : http://java.net/projects/povwriter/pages/Home which I didn't use at the time)

and then you can make a movie from the images.

e.g.
http://www.youtube.com/watch?v=ywzFigk-wfI



Approach to make all text files in processing
When you make all text files in processing, one for each frame of your movie and you give them an incresing number such as a000001.pov to a006000.pov.
pov-ray can load them one by one and make images from them :

Code in Pov-Ray:
Copy code
  1. #include concat("a", str(frame_number, -6, 0), ".pov");
  2. Render it with Final_Frame=6000 (+kff6000) and it renders files
  3. a000001.pov to a006000.pov.

Let this run over night or during 1-3 days including the nights, non-stop.

Then make a movie from the bmp files Pov-ray made using pjBmp2Avi or so:
http://www.digital-digest.com/software/download.php?sid=1017&ssid=0&did=2