COLLADA Proxy
From Blue Mars Developer Guidebook
There are security restrictions on this article
|
|
How to make an object with collision proxy from two COLLADA files
This tutorial includes a brief recap of extracting COLLADA .dae files exported from SketchUp, details about using bmImportCmd.exe to convert two .dae's into one .cgf object with collision proxy, and bringing the .cgf into a Blue Mars Editor (CityEditor or ItemEditor).
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.
SketchUp
- 1. In SketchUp, make sure each polygon in your model is assigned a material with a texture file
- 2. Export the model with File > Export > 3DModel... to your Game/Objects/MyData directory; this creates a .kmz file.
- 3. To extract the model, rename the .kmz extension to .zip, grab the model (.dae) & texture file and place them in your MyData directory.
- 4. 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 collision proxy mesh:
- The render (visual) mesh:
Using BmImportCmd's -ProxyGeometry option to create the .cgf object
- 5. To make the process a little simpler, you can copy Bin32/bmImport.exe and bmImportCmd.exe to your MyData directory where your .dae files are sitting
- 6. Open up a command prompt (just in case, a reminder:)
- 7. Then navigate to your directory and create your .cgf with the -proxyGeometry option followed by the proxy mesh, the render mesh, and the name of the new cgf to create. Don't forget to use the -mtl option to automatically setup the material. Here's an example:
C:\BlueMars\Game\Objects\MyData\newCombineProxyInBmImport>bmImportCmd.exe -mtl -proxyGeometry proxyMesh.dae renderMesh.dae result.cgf
Loading in Blue Mars
- 8. Load the new .cgf in the ItemEditor or CityEditor (as a Brush from the Rollup Bar), select it, open the Material Editor (m is the shortcut), and click the Get Material From Selection icon to see the automatically generated material, in this case "result.mtl".
- You may need to assign your Diffuse texture and turn up the Opacity if it came in as 0.
- 9. The proxy sub material already has the NoDraw shader assigned, and in the CityEditor, you can see the gray proxy with p_draw_helpers 1 in the console
Now this object can be placed in your city, block or shop and its collision proxy will be respected.







