| 246 | } |
| 247 | |
| 248 | void scene_editor_app::import_scene(const std::string & path) |
| 249 | { |
| 250 | if (!path.empty()) |
| 251 | { |
| 252 | gizmo->clear(); |
| 253 | renderer_payload.reset(); |
| 254 | |
| 255 | int width, height; |
| 256 | glfwGetWindowSize(window, &width, &height); |
| 257 | the_scene.reset({ width, height }, false); // don't create implicit objects if importing |
| 258 | |
| 259 | the_scene.import_environment(path); |
| 260 | |
| 261 | auto asset_base = global_asset_dir::get()->get_asset_dir(); |
| 262 | |
| 263 | // Resolve polymer-local assets |
| 264 | the_scene.resolver->add_search_path(asset_base); |
| 265 | |
| 266 | // Resolve project assets |
| 267 | const auto parent_dir = parent_directory_from_filepath(path); |
| 268 | log::get()->engine_log->info("resolving local `{}` directory.", parent_dir); |
| 269 | the_scene.resolver->add_search_path(parent_dir); |
| 270 | |
| 271 | the_scene.resolver->resolve(); |
| 272 | |
| 273 | glfwSetWindowTitle(window, path.c_str()); |
| 274 | } |
| 275 | else |
| 276 | { |
| 277 | throw std::invalid_argument("path was empty...?"); |
| 278 | } |
| 279 | |
| 280 | polymer::global_debug_mesh_manager::get()->initialize_resources(&the_scene); |
| 281 | } |
| 282 | |
| 283 | void scene_editor_app::open_material_editor() |
| 284 | { |
nothing calls this directly
no test coverage detected