DEKI/ENGINE docs
manual api reference
Deki 0.40.1
Modular C++ engine with a visual editor, for 2D and 3D
Loading...
Searching...
No Matches
DekiEditor::AssetDatabase Class Reference

Static asset import and GUID lookup for editor tools, like Unity's AssetDatabase. More...

#include <C:/Users/kirby/Documents/Github/deki/deki-editor/deki-editor/include/deki-editor/AssetDatabase.h>

Static Public Member Functions

static std::string AssetPathToGUID (const std::string &path)
 The GUID of the asset at a project-relative path, or "" if not found.
static void GetSpritesheetAssets (std::vector< std::pair< std::string, std::string > > &outAssets)
 Fills outAssets with every texture that has sub-assets (spritesheets).
static const SubAssetInfo * GetSubAsset (const std::string &guid)
 The sub-asset with this GUID, or nullptr.
static const std::vector< SubAssetInfo > * GetSubAssets (const std::string &parentGuid)
 The sub-assets of a parent asset, or nullptr when it has none.
static std::string GUIDToAbsolutePath (const std::string &guid)
 The absolute path of an asset, or "" if not found.
static std::string GUIDToAssetPath (const std::string &guid)
 The project-relative path of an asset, or "" if not found.
static void ImportAsset (const std::string &path)
 Imports or reimports one asset, rebuilding its cache.
static void Initialize (AssetPipeline *pipeline)
 Called by the editor at startup.
static void Refresh ()
 Scans for modified files and reimports them.
static void Shutdown ()
 Called by the editor at exit.

Detailed Description

Static asset import and GUID lookup for editor tools, like Unity's AssetDatabase.

Tools call it without knowing about AssetPipeline.

Usage: DekiEditor::AssetDatabase::ImportAsset("assets/sprites/player.png"); std::string guid = DekiEditor::AssetDatabase::AssetPathToGUID("assets/sprites/player.png");

Member Function Documentation

◆ AssetPathToGUID()

std::string DekiEditor::AssetDatabase::AssetPathToGUID ( const std::string & path)
static

The GUID of the asset at a project-relative path, or "" if not found.

◆ GetSpritesheetAssets()

void DekiEditor::AssetDatabase::GetSpritesheetAssets ( std::vector< std::pair< std::string, std::string > > & outAssets)
static

Fills outAssets with every texture that has sub-assets (spritesheets).

◆ GetSubAsset()

const SubAssetInfo * DekiEditor::AssetDatabase::GetSubAsset ( const std::string & guid)
static

The sub-asset with this GUID, or nullptr.

◆ GetSubAssets()

const std::vector< SubAssetInfo > * DekiEditor::AssetDatabase::GetSubAssets ( const std::string & parentGuid)
static

The sub-assets of a parent asset, or nullptr when it has none.

◆ GUIDToAbsolutePath()

std::string DekiEditor::AssetDatabase::GUIDToAbsolutePath ( const std::string & guid)
static

The absolute path of an asset, or "" if not found.

◆ GUIDToAssetPath()

std::string DekiEditor::AssetDatabase::GUIDToAssetPath ( const std::string & guid)
static

The project-relative path of an asset, or "" if not found.

◆ ImportAsset()

void DekiEditor::AssetDatabase::ImportAsset ( const std::string & path)
static

Imports or reimports one asset, rebuilding its cache.

path is project-relative, e.g. "assets/sprites/player.png".

◆ Initialize()

void DekiEditor::AssetDatabase::Initialize ( AssetPipeline * pipeline)
static

Called by the editor at startup.

◆ Refresh()

void DekiEditor::AssetDatabase::Refresh ( )
static

Scans for modified files and reimports them.

◆ Shutdown()

void DekiEditor::AssetDatabase::Shutdown ( )
static

Called by the editor at exit.


The documentation for this class was generated from the following file: