void Scene::update_asset_paths(const StringDictionary& mappings) { BaseGroup::update_asset_paths(mappings); do_update_asset_paths(mappings, cameras()); if (impl->m_environment.get()) impl->m_environment->update_asset_paths(mappings); do_update_asset_paths(mappings, environment_edfs()); do_update_asset_paths(mappings, environment_shaders()); }
bool AssetHandler::handle_assets() const { StringArray paths; Scene* scene = m_project.get_scene(); if (scene) scene->collect_asset_paths(paths); Frame* frame = m_project.get_frame(); if (frame) frame->collect_asset_paths(paths); do_collect_asset_paths(paths, m_project.render_layer_rules()); do_collect_asset_paths(paths, m_project.configurations()); vector<string> unique_paths = array_vector<vector<string> >(paths); sort(unique_paths.begin(), unique_paths.end()); unique_paths.erase( unique(unique_paths.begin(), unique_paths.end()), unique_paths.end()); StringDictionary mappings; bool success = true; for (size_t i = 0, e = unique_paths.size(); i < e; ++i) { string asset_path = unique_paths[i]; if (!handle_asset(asset_path)) success = false; mappings.insert(unique_paths[i], asset_path); } if (!success) return false; if (scene) scene->update_asset_paths(mappings); if (frame) frame->update_asset_paths(mappings); do_update_asset_paths(mappings, m_project.render_layer_rules()); do_update_asset_paths(mappings, m_project.configurations()); // If we copied all assets, we no longer need the absolute search paths, so remove them. if (m_mode == CopyAllAssets) remove_absolute_search_paths(m_project.search_paths()); return true; }
void BaseGroup::update_asset_paths(const StringDictionary& mappings) { do_update_asset_paths(mappings, colors()); do_update_asset_paths(mappings, textures()); do_update_asset_paths(mappings, texture_instances()); #ifdef APPLESEED_WITH_OSL do_update_asset_paths(mappings, shader_groups()); #endif do_update_asset_paths(mappings, assemblies()); do_update_asset_paths(mappings, assembly_instances()); }