Open 3D Engine Atom Gem API Reference
23.05.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
|
#include <BuilderSettingManager.h>
Inherits QObject.
Public Member Functions | |
AZ_TYPE_INFO (BuilderSettingManager,"{8E95726D-4E3A-446C-99A6-D02863640EAC}") | |
AZ_CLASS_ALLOCATOR (BuilderSettingManager, AZ::SystemAllocator) | |
const PresetSettings * | GetPreset (const PresetName &presetName, const PlatformName &platform="", AZStd::string_view *settingsFilePathOut=nullptr) const |
AZStd::vector< AZStd::string > | GetFileMasksForPreset (const PresetName &presetName) const |
const BuilderSettings * | GetBuilderSetting (const PlatformName &platform) const |
const PlatformNameList | GetPlatformList () const |
Return A list of platform supported. | |
const AZStd::map< FileMask, AZStd::unordered_set < PresetName > > & | GetPresetFilterMap () const |
const AZStd::unordered_set < PresetName > & | GetFullPresetList () const |
const PresetName | GetPresetNameFromId (const AZ::Uuid &presetId) |
Find preset name based on the preset id. | |
StringOutcome | LoadConfig () |
Load configurations files from both project and gem default config folders. | |
StringOutcome | LoadConfigFromFolder (AZStd::string_view configFolder) |
void | ReloadPreset (const PresetName &presetName) |
Reload preset from config folders. | |
const AZStd::string & | GetAnalysisFingerprint () const |
void | MetafilePathFromImagePath (AZStd::string_view imagePath, AZStd::string &metafilePath) |
PresetName | GetSuggestedPreset (AZStd::string_view imageFilePath) const |
AZStd::vector< AZStd::string > | GetPossiblePresetPaths (const PresetName &presetName) const |
AZStd::string | GetFileMask (AZStd::string_view imageFilePath) const |
Extract the file mask of a file path. | |
PresetName | GetDefaultPreset () const |
Return the default opaque preset name. | |
PresetName | GetDefaultAlphaPreset () const |
Return the default alpha preset name. | |
AZStd::vector< PresetName > | GetPresetsForFileMask (const FileMask &fileMask) const |
Return all preset names associated with this file mask. | |
bool | IsValidPreset (PresetName presetName) const |
Return true if the preset name is valid. | |
bool | DoesSupportPlatform (AZStd::string_view platformId) |
Static Public Member Functions | |
static BuilderSettingManager * | Instance () |
static void | CreateInstance () |
static void | DestroyInstance () |
static void | Reflect (AZ::ReflectContext *context) |
Static Public Attributes | |
static const char * | s_environmentVariableName |
static AZ::EnvironmentVariable < BuilderSettingManager * > | s_globalInstance |
static AZStd::mutex | s_instanceMutex |
static const PlatformName | s_defaultPlatform |
static const char * | s_defaultConfigFolder |
static const char * | s_projectConfigRelativeFolder |
static const char * | s_builderSettingFileName |
static const char * | s_presetFileExtension |
Friends | |
class | ImageProcessingTest |
BuilderSettingManager is a singleton which responses to manage preset settings and some global settings for image builder. It loads all presets from *.settings file. The settings file need to be loaded before builder or editor starting process any image. Preset is a collection of some parameters which used for convert and export image to formats used in runtime. It's used as template to provide default settings when process certain type of texture When process an image, a texture setting will be loaded (from legacy .exportsettings or new .imagesettings) or generated for this image. The texture setting will need to reference to a preset which is used to initialize the texture setting. Each preset setting may have different values on different platform, but they are using same uuid.
AZStd::vector<AZStd::string> ImageProcessingAtom::BuilderSettingManager::GetPossiblePresetPaths | ( | const PresetName & | presetName | ) | const |
Get the possible preset config's full file paths This function is only used for setting up image's source dependency if a preset file is missing Otherwise, the preset's file path can be retrieved in GetPreset() function
const AZStd::map<FileMask, AZStd::unordered_set<PresetName> >& ImageProcessingAtom::BuilderSettingManager::GetPresetFilterMap | ( | ) | const |
Return A map of preset settings based on their filemasks. filemask string, empty string means no filemask set of preset setting names supporting the specified filemask
PresetName ImageProcessingAtom::BuilderSettingManager::GetSuggestedPreset | ( | AZStd::string_view | imageFilePath | ) | const |
Find a suitable preset a given image file.
imageFilePath,: | Filepath string of the image file. The function may load the image from the path for better detection |
image,: | an optional image object which can be used for preset selection if there is no match based file mask. |
StringOutcome ImageProcessingAtom::BuilderSettingManager::LoadConfigFromFolder | ( | AZStd::string_view | configFolder | ) |
Load configurations files from a folder which includes builder settings and presets Note: this is only used for unit test. Use LoadConfig() for editor or game launcher
void ImageProcessingAtom::BuilderSettingManager::MetafilePathFromImagePath | ( | AZStd::string_view | imagePath, |
AZStd::string & | metafilePath | ||
) |
Provides a full path to the adjacent metafile of a given texture/image file.
imagePath | File path string to the texture/image file. |
Output | metafilePath File path string to the adjacent texture/image metafile. |