comp. sci. 2  

Sketchup and Materials

shapes


     This tutorial will explain how to fix materials used in your sketchup models. *** If you have already created you model and just want to fix the materials, goto section #2.

Section#1 (creating and exporting a sketchup model)

1. Save your sketchup project, as you save it create a new-folder for your project files to reside. As you can see I named the folder dead-end-efa (note my (efa) initals in the folder name) and I named the shape file dead-end, the dead-end directory was created when I exported my project as a 3D Model - see our next step...

2. Export your sketchup project as a 3D Model, as shown below:



Section#2 (Moving and Fixing the models folder)


3. Finally we get to the heart of the mater. The exported collada (.dae)file will reference a subdirectory, but will us relative addressing. Torque does not support relative addressing for material files, more on that later. The second problem is that the sketchup collada (.dae) file will use Material0, Material1, Material2, etc. for each of the materials used in your model. We must have unique material names or our Torque world becomes very hard to manage...
line
4. O.K., lets move and fix our model's folder. Copy the folder to /art/shapes/interiors/Buildings or whereever else it need to go. Mine looks like this:

folder

line
Step#5, shown below, will let you manually alter the sketchup Collada (.dae) file. You can also use this handy little program (fix-dae.exe) which allows you to drag and drop your collada (.dae) file and then use save-as to automatically make all needed changes...
line

5. Use an editor (NotePad++ works best) to replace all the instances of Material0 to shape-name0, and Material1 to shape-name1, etc. (instead of shape-name, use the name of your shape), until you don't have any more to replace. Use the global replacement feature of the editor, under [Edit][Find] as shown below...

edit

O.K., you are finished. Now just Save your modified collada (.dae) file. When you create the first instance of your model, in a game, a materials.cs file will automatically be created. There after, if you wish to change any of your textures, just replace the texture file with a new one or use the built in material editor. Now that your materials have a unique name you shouldn't have any problems...

*** I'll probably write a program to automate this process and redue this tutorial, but for now this works. line