# Asset Database

## Overview

The **Asset Database** is a *database* of all the **Assets** that are either used in the **Project** or available to be used at runtime. It allows the user to keep track of all these **Assets** and have easy access to information about them, such as how many times they are used in the **Project** or their location.

In summary, the **Asset Database** shows two sets of **Assets**:

* **Assets** that are currently used in the **Project**. These are added automatically when used in the **Project**.
* **Assets** that are available to be used in the **Project** at runtime. These have to be added manually from the [**Asset Manager**](https://docs.incari.com/incari-studio/2024.1/modules/asset-manager).

![](https://4263346935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLnh3x8s9fddWeG8TaAug%2Fuploads%2Fgit-blob-60a5a78b12ecb61b7df0c2550ebbcdf4984a451e%2Fassetdatabase120241.png?alt=media)

For each **Asset**, the **Asset Database** displays the following information:

* `ID`: Unique identifier for the **Asset**.
* `Icon`: Icon that represents the `Type` of **Asset**.
* `Type`: Type of **Asset**.
* `Label`: *Label* for the **Asset**. By default, it is set to the filename and it can be edited directly in the **Asset Database**.
* `Source`: The origin of an **Asset**.
* `Path`: *Path* to the file. For **Assets** located in the **Project Asset** folder, it shows the relative *path*, and for other **Assets**, it shows the full *path*.
* `#`: Number of times that the **Asset** is used in the **Project**.

And it offers two options:

* `Highlight asset in Asset Manager`: Press this option to highlight the **Asset** in the **Asset Manager**.
* `Remove asset from Asset Database`: Press this option to remove the **Asset** from the **Asset Database**.

## Adding Assets to the Asset Database

There are three ways in which **Assets** can be added to the **Asset Database**: [Using **Assets** in the **Project**](#using-assets-in-the-project), [manually](#manually), or [using **Logic**](#at-runtime-using-logic).

### Using Assets in the Project

Using an **Asset** automatically adds it to the **Asset Database**.

![](https://4263346935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLnh3x8s9fddWeG8TaAug%2Fuploads%2Fgit-blob-fe93cb30c45feba750e94f9a30862797e217d213%2Fassetdatabase220241.gif?alt=media)

### Manually

An **Asset** can be added manually to the **Asset Database**. To do this, simply drag and drop a file in the **Asset Database**. This can be done from the **Asset Manager** or from the *File Explorer*, thus allowing one to add files that are not in the **Asset** folder.

There are three special cases:

* **Keyboard Layouts** have to be added in [**Project Settings**](https://docs.incari.com/incari-studio/2024.1/modules/project-settings/keyboard) and then they will be automatically added to the **Asset Database**.
* **Fonts** have to be added in [**Project Settings**](https://docs.incari.com/incari-studio/2024.1/modules/project-settings/fonts) and then they will be automatically added to the **Asset Database**.
* **Materials** are automatically added to the **Asset Database** when created in the [**Asset Manager**](https://docs.incari.com/incari-studio/2024.1/modules/asset-manager).

![](https://4263346935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLnh3x8s9fddWeG8TaAug%2Fuploads%2Fgit-blob-ffceff781c01c274814b8df76d054427a56611db%2Fassetdatabase320241.gif?alt=media)

### At runtime using Logic

**Assets** can be added to the **Asset Database** using **Logic**. For this purpose, use the [**Add to Asset Database** **Node**](https://docs.incari.com/incari-studio/2024.1/toolbox/incari/asset/add-to-asset-database), which receives the *path* of the file to be added to the **Asset Database**.

See in the image below a simple example of how to add an **Asset** to the **Asset Database** in the **Logic**, using, besides the **Add to Asset Database** **Node**, the [**String Value** **Node**](https://docs.incari.com/incari-studio/2024.1/toolbox/string/stringvalue):

![](https://4263346935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLnh3x8s9fddWeG8TaAug%2Fuploads%2Fgit-blob-310eed7b5167793aca130150fb04d4f518023564%2Fassetdatabase420241.png?alt=media)

## Features

The **Asset Database** offers several features that are useful for managing **Assets**. These are: [search](#search), [filter](#filter), [highlight use](#highlight-use), [highlight in **Asset Manager**](#highlight-in-asset-manager) and [remove](#remove).

### Search

The search bar on the top right of the **Asset Database** allows the user to search **Assets** by either `ID` or `Label`.

![](https://4263346935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLnh3x8s9fddWeG8TaAug%2Fuploads%2Fgit-blob-a85457e6d0574a3aa40d66ddd43739cd9ef63402%2Fassetdatabase520241.gif?alt=media)

### Filter

The filter on the top right of the **Asset Database** allows the user to filter the **Assets** by `Type`.

![](https://4263346935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLnh3x8s9fddWeG8TaAug%2Fuploads%2Fgit-blob-aac86ecdce580f0e56da360ce7b5a61e1d35cb99%2Fassetdatabase620241.gif?alt=media)

### Highlight use

By clicking on the `ID` of an **Asset**, its use in the **Scene Outliner** and **Viewport** will be highlighted.

![](https://4263346935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLnh3x8s9fddWeG8TaAug%2Fuploads%2Fgit-blob-1ab585b5b2e49badfcfc8475947c9abe959d76c0%2Fassetdatabase720241.gif?alt=media)

### Highlight in Asset Manager

By clicking on the magnifying glass on an **Asset** entry, this **Asset** will be highlighted in the **Asset Manager**.

![](https://4263346935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLnh3x8s9fddWeG8TaAug%2Fuploads%2Fgit-blob-ee8821b24229b00aed97655607cd92bf8bd6ec72%2Fassetdatabase820241.gif?alt=media)

### Remove

To remove an **Asset** from the **Asset Database**, click on the minus on the far right of an **Asset** entry.

If an **Asset** was not manually added to the **Asset Database** (it was added only by being present somewhere in a **Scene**), it will be removed when it is no longer used. For example, if a single **Sprite** uses some image and either the **Sprite** or image is deleted, the **Asset** in the **Asset Database** will be removed.

However, if the **Asset** was manually dragged into the **Asset Database** and there are no current useages of the **Asset**, it will remain in the **Database** but the counter will reach 0.

![](https://4263346935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLnh3x8s9fddWeG8TaAug%2Fuploads%2Fgit-blob-2ee06616ca48fdac7cc41a7a189e1ea8b503c59b%2Fassetdatabase920241.gif?alt=media)

### In Logic Editor

All **Assets** in the **Asset Database** can be dragged to the **Logic Editor**. This will create a **Node** of the **Asset** which has one output that matches the *type* of the **Asset**. This allows the user to easily use any **Asset** in their **Logic**.
