Extraction of 3d models from Cities Skylines game and incorporation in PreScan - AD-EYE/AD-EYE_Core GitHub Wiki
Summary
Extracting 3D models
Directly from Cities: Skylines game
- Open the game.
- About ModTools: For all information and for installation you can visit here → https://steamcommunity.com/sharedfiles/filedetails/?id=450877484. It is an in-game tool that we use here to extract 3D models and textures.
- Make sure ModTools is installed and enabled.
- Then load the map, click on a building (or a vehicule) and click on Dump Assets. Images/cs_dumpasset.PNG
The 3D object will be dumped in this directory. The object's format is Wavefront (.obj).
Images/cs_dumpasset_window.PNG
Notes:
- Sometimes the texture's colors you see in-game won't be the same as the dumped one.
- Sometimes the .obj is broken and can not be imported in Blender (even though the .obj can be opened in 3D viewer of Windows).
With Asset Studio
This solution works for every Unity games. You have to download Asset Studio. https://github.com/Perfare/AssetStudio/releases
-
Once downloaded, go to File → Load Folder → Go to this directory : C:\Program Files (x86)\Steam\steamapps\common\Cities_Skylines And then load the folder called Cities_Data.
-
The file downloaded, go to assets, you can vizualize the 3D objects (In “mesh” category), choose one, right click on it and choose “Go to scene hierarchy “. Images/as_go_to_scene.PNG
-
Now you can tick all the cases related with this object, they have almost the same name (in order to import also the textures, but often there will be only one to tick).
-
And then Model → Export selected objects (split).
The export format is .fbx and the textures are already applied so the 3D model is ready to be imported in PreScan. If it is not the case, you will have to put the textures manually.
Adding textures in Blender
If you extracted the 3D model from the game directly (or it didn't work from Asset Studio), you have to put the textures manually.
- Go to File → Import → Select the format you want. With Modtools, the file will be a Wavefront (.obj). With AssetStudio, it will be FBX (.fbx).
-
You will often have the choice between 2 files, select the one where there is not “LOD” in its name.
-
Then, go to UV Editing menu, your screen will look like this:
- On the left screen, click on “Open”, then go to the directory where your 3D object was, the textures are also at the same directory, I recommand to do a folder for each 3D model in order to not get lost.
-
Select the image (like here, you will have a lot of images, it will be generally the heaviest one, in this example it is 1.3 MiB) Images/blender_uv_open.PNG
-
Select the 3D model (click on it) and then push TAB (these step is for visualizing if the meshes is applied correctly to the image) Images/blender_TAB.PNG
-
Now you can go to the Shading menu.
-
On the bottom screen click on Add → Texture → Image Texture, it will create a new node that you will have to connect like this: Images/blender_shadingnode.PNG
-
Then you have to click on the icon on the left of “New” to browse to the image you imported before.
Quicker way:
You can skip the UV editing, in our case the mesh will always be correctly applied to the texture, if you exported with Modtools. You can go directly to the Shading menu and instead of browsing the image you can directly click on “Open” and browse to the image.
- Once done you can export the COLLADA (.dae) format in order to import it on Prescan
Importing on PreScan
With the Model Preparation Tool
-
Open the “Model Preparation Tool”. Images/prescan_open.png
-
Go to File → New.
-
Import the file (the file must be in COLLADA (.dae) format). Images/prescan_file.PNG
-
On the right, click on “Canvas Data”, you have to fill the editor data : Enter a category, the main tab, the subtab, the model name (very important, it is the name that will appear on PreScan) and a description. Images/prescan_canvas.PNG
-
Finally, you have to save your work here C:\Users\Public\Documents\Prescan\GenericModels or here C:\Users\adeye\AD-EYE_Core\Prescan_models (If PreScan path was modified) It is recommanded to do the following structure folder.
Note: Once the model saved, PreScan has to be launched again to take into account the new models.
With User Library Elements Wizards
- This is a most straightforward method to add 3D models.
- Open PreScan → Tools → User Library Elements Wizards a window will open. From there, folders can be added or removed. When a a folder is selected, an element can be added to it.
Images/PreScan_UserLibrary1.PNG
- Then, browse to the 3D model and click next to every step, unless some modifications is needed.