How To: Export textured models from CityEngine into Unity
CityEngine models can be exported to Wavefront OBJ files along with any associated textures and opened in the 3D game engine, Unity. However, issues with drawing models in Unity may arise if export settings are not set correctly.
- In CityEngine, select all of the models to be exported.
Left-clicking and dragging from bottom-right to top-left allows users to select every part of every model that is partially included in the select box. Left-clicking and dragging from top-left to bottom-right only selects the part of the models that are fully in the select box.
- Go to File > Export Models.
- Select the Autodesk FBX option.
- Use the following settings in the Export model wizard:
• Export Geometry: Models with Shape Fallback
• Vertex Normals: Write vertex normals
• Normals Indexing: Allow shared normals
• Texture Coordinates: Write all UV layers
• In the Global Offset section, click the Center button.
• Include Materials: Checked
• Collect Textures: Checked
• Embed Textures: Checked
- In Unity, navigate to the Asset menu > Import new asset, and navigate to the .fbx file.
- Drag and drop the model from the Assets window into the scene.
If the model flickers or moves in the scene when navigating, it is most likely too far from the origin. Ensure the model is selected in the Hierarchy, and change the position of the model to 0, 0, 0.
- CityEngine Help: Exporting Models
- CityEngine Tutorials
- Unity Documentation: 3D formats
- Esri Support Blog: Exporting Textured CityEngine Models
- Video - CityEngine Essential Skills: Exporting Projects