2010
03.25

I found this tutorial when I was looking up how to bake textures with Cinema4D with UVW mapping to Papervision.

Taken from: http://inspiration.inlovewith.com/archives/38

Here is a way to load Collada files exported from Cinema 4D R11 into Papervision 2.0, with optionally transparent transparent textures.

Step 1: SAVING OUT THE COLLADA

So, you have a Cinema 4D file that looks all nice.
# Click on each object and hit “c” to make the object editable. The icon should change to a triangle.

Now your file is ready for Collada export.
– Choose File -> export -> COLLADA
– Save as model.dae in the model folder (make a backup before if you like)
– Check all the checkboxes in the COLLADA export dialog that comes up once you click save

As you will notice no textures will be saved out. You’ll have to do this manually for each texture.

Step 2: EXPORTING THE TEXTURES AS (transparent) PNG FILES
First, click the materials and in the Tag propery, make sure you use UVW Mapping

Right-click on an object and choose Cinema 4D Tags -> Bake Texture
In the bake texture tag properties window:
– click on the […] and choose a file name for your texture. Use the same as the object’s name, so cylinder for our first object, and make sure to navigate to the model folder.
– Choose PNG as format
– Choose automatic size

In the bake texture options window:
– Choose surface color
– Click Bake

Now your texture has been saved as cylinderSurface_Color.png in the model folder.
Do the same for the cylinder.

You will now have the files cubeSurface_Color.png and cylinderSurface_Color.png. Rename them to cube.png and cylinder.png

These textures have been saved out without transparency. I don’t know any way to do this, if you know, please comment!

Open cube.png in Photoshop, make it transparent and green and save it (still as a PNG).

Step 3: CONNECTING THE TEXTURES WITH THE MODELS IN FLASH
1
Open model.dae in a text editor. Scroll down to the end, there we can find our Cylinder and Cube. Locate the tag and make a note of the target=”#IDXXX” attribute. This is the id we’ll use to connect the materials.

2
Open the main.fla and the main.as files in Flash. Here you can see how we load the two textures and map them to ID5 and ID3 which we took from the collada file.
var materials:MaterialsList = new MaterialsList();

var cylinderMaterial:BitmapFileMaterial = new BitmapFileMaterial(”model/cylinder.png”);
cylinderMaterial.doubleSided = true;
materials.addMaterial(cylinderMaterial, “ID5″);

var cubeMaterial:BitmapFileMaterial = new BitmapFileMaterial(”model/cube.png”);
cubeMaterial.doubleSided = true;
materials.addMaterial(cubeMaterial, “ID3″);

daeFile = new DAE();
daeFile.load(”model/model.dae”, materials);
daeFile.scaleX = daeFile.scaleY = daeFile.scaleZ = 0.5; // change for your model
daeFile.z = 100;
_markerNode.addChild(daeFile);
.

This might not give the complete picture, there can be 100ds of variables affecting this kind of work, but hopefully it will get you up and running. It took me four days to get here, so I wanted to share it, as it was almost impossible to find any info on the subject.

2 comments so far

Add Your Comment
  1. The title of your blogpost was very misleading. I was expecting something about a Pina Colada. How dare you.

  2. i found this tutorial very useful and it saved plenty of my time
    so thank you
    good job