From Blue Mars Developer Guidebook
How to make an object with collision proxy from two COLLADA files
This tutorial includes an example of converting two .dae's files exported from SketchUp 7.1 into one .cgf object with a collision proxy in the Item Editor. The resulting .cgf can then be used in either the City, Block, Shop or Interior Editors.
Clarification: this does work for .dae's created with applications other than SketchUp, but if your application has the ability to rename materials (like 3DSMax, Maya, XSI, Blender, etc), then the method of using "proxy" in the material name, generally described on this page will likely be more convenient. However, some COLLADA exporters may not preserve the material names. This may result in the proxy material not processing correctly, and the proxy mesh will not have collisions. In this case, it is probably easiest to generate the .cgf from two meshes.
- 1. In SketchUp, make sure each polygon in your model is assigned a material
- 2. Select the model and export with File > Export > 3DModel...
- a) In the Export Model prompt, browse to a folder in your Game/Objects/MyData directory.
- b) Choose COLLADA file (*.dae) and the Export type.
- c) If the model is a component, then you'll need to hit the Options button and un-check Preserve Component Hierarchies.
- d) Finally, hit Export to save the DAE.
- 3. Repeat the process to create a .dae for both your proxy & render meshes. The example below shows one mesh representing the collision proxy, and one (slightly) more detailed mesh representing the render mesh.
- The render (visual) mesh:
- The collision proxy mesh:
- How the meshes should be positioned relative to one another:
- Note: The collision mesh will always be placed at the origin when the DAE files are converted to a single .cgf. So if the meshes are offset from the scene origin when exported, then the proxy mesh will not align correctly with the render mesh.
Using the Blue Mars Item Editor to Create the .cgf Object
- 1. Open the Blue Mars Item Editor and go to File -> Open.
- 2. Browse to the location of the render mesh .dae file, select the file and hit Open.
- 3. In the COLLADA Converter Tool, click the Expert tab.
- 4. The Expert tab should settings need to be:
- a) Insure that the render meshes .dae as the Input File. This is automatically set from step 2, so you shouldn't have to worry about this step.
- b) Un-check Generate auto-proxy shape using bounding box.
- c) Check Set custom proxy file, and set the file path to the proxy collision .dae file.
- 5. Click Convert, Overwrite, and Load.
- The newly converted .cgf file should appear in the Item Editor's render window.
- Preview the proxy mesh in the Item Editor by pressing Shift+P on your keyboard.