diff --git a/Docs/generate_map_from_fbx.md b/Docs/generate_map_from_fbx.md new file mode 100644 index 000000000..46e381a24 --- /dev/null +++ b/Docs/generate_map_from_fbx.md @@ -0,0 +1,71 @@ +

Automatically generate a map from RoadRunner

+ +!!! important + The given scripts only works if the files are kept in the folders + detailed below. + +This script is aimed to reduce the time needed to setup a map inside Carla's project. +Also, in combination of the [import / export scripts](export_import_dist.md) will allow +the user to generate a simple map without opening Unreal Engine. + +!!! important + The script does heavy use of Unreal's capabilities, so it is needed to be installed + and setup, as the import fbx action is done directly over the code project, not a + distribution build. + + +

How to import a fbx

+The current script only work for files placed with the follow structure (RoadRunnerFiles is +located in the root folder): + +```sh +RoadRunnerFiles/ +├── README.txt +├── MapToImport01 +│   ├── Asphalt1_Diff.png +│   ├── Asphalt1_Norm.png +│   ├── Asphalt1_Spec.png +│   ├── Grass1_Diff.png +│   ├── Grass1_Norm.png +│   ├── Grass1_Spec.png +│   ├── LaneMarking1_Diff.png +│   ├── LaneMarking1_Norm.png +│   ├── LaneMarking1_Spec.png +│   ├── MapToImport01.fbx +│   └── MapToImport01.xodr +└── MapToImport02 + ├── Asphalt1_Diff.png + ├── Asphalt1_Norm.png + ├── Asphalt1_Spec.png + ├── Concrete1_Diff.png + ├── Concrete1_Norm.png + ├── Concrete1_Spec.png + ├── Grass1_Diff.png + ├── Grass1_Norm.png + ├── Grass1_Spec.png + ├── LaneMarking1_Diff.png + ├── LaneMarking1_Norm.png + ├── LaneMarking1_Spec.png + ├── MapToImport02.fbx + └── MapToImport02.xodr +``` + +Under RoadRunnerFiles, place each "Export" folder obtained from RoadRunner and +rename it with the name of the map to be imported. It have to match the .fbx +and .xodr files. + +Now, simply go into the PythonAPI folder and run generate_map.py + +!!! important + The script, by default, checks the /Unreal/CarlaUE4/Content/Carla/Maps for matching names. + If a map with the same name as a to-be-imported map is found, it will notify the user and won't do anything. + To override this, generate_map.py can be invoked with the --force flag. + +After the script finishes, all a map with the same name of the folder and files will be located under +/Unreal/CarlaUE4/Content/Carla/Maps with all the static meshes and placed, textures, waypoints and routes +generated. + +!!! important + There is a bug in RoadRunner that generates wrong materials automatically and they get broken inside Unreal. + By adding the flag --usecarlamats the meshes will use the materials provided by Carla's project, + that will also react to the weather. \ No newline at end of file diff --git a/Docs/index.md b/Docs/index.md index adf500e8d..6778c3810 100644 --- a/Docs/index.md +++ b/Docs/index.md @@ -26,6 +26,7 @@ * [Running in a Docker](carla_docker.md) * [How to make a new map with RoadRunner](how_to_make_a_new_map.md) * [How to link Epic's Automotive Materials](epic_automotive_materials.md) + * [How to automatically generate a map from RoadRunner](generate_map_from_fbx.md) * [How to export and import maps to distribution builds](export_import_dist.md)

Contributing

diff --git a/mkdocs.yml b/mkdocs.yml index 899801cfa..67b343003 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -21,6 +21,7 @@ pages: - 'Running in a Docker': 'carla_docker.md' - "How to make a new map with RoadRunner": 'how_to_make_a_new_map.md' - "How to link Epic's Automotive Materials": 'epic_automotive_materials.md' + - "How to automatically generate a map from RoadRunner": 'generate_map_from_fbx.md' - "How to export and import maps to distribution builds": 'export_import_dist.md' - Contributing: - 'Contribution guidelines': 'CONTRIBUTING.md'