Skip to content

Commit

Permalink
asset import
Browse files Browse the repository at this point in the history
  • Loading branch information
jankrassnigg committed Aug 13, 2024
1 parent f7c8f09 commit 423ae79
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ An animation clip represents a single motion, such as a walk cycle, a jump or ot
>
> In animation graph nodes animation clips are **not referenced directly** but rather through a name mapping. This mapping is configured in the [animation graph asset](animation-graphs/animation-graph-asset.md).
## Importing Many Animation Clips Quickly

In the [asset browser](../../assets/asset-browser.md) select to show `<Importable Files>` then find your source animation clip file. Right click on it, and from the *Import As* sub-menu select `Animation Clips (All)`. Finally, select an [animated mesh](animated-mesh-asset.md) as the preview model.

After this, the editor creates a new animation clip document for each animation that it finds in the file.

## Asset Properties

* `File`: The file from which to import the animation clip.
Expand Down
22 changes: 15 additions & 7 deletions pages/docs/assets/import-assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,23 @@ To create these documents you have two options: Manual or automatic import.

## Create Documents Manually

You can manually create documents via *File > Create...*. In the file creation dialog, choose the file extension for the desired asset type and specify where to store the document. The newly created document will be in a blank state. You will need to fill out all the properties, including where the source files are located.
You can manually create documents by right clicking into the [asset browser](asset-browser.md) and selecting *New > Asset Type*. If you right clicked free space, the asset document will be created in the folder that is selected on the left. If you right clicked another document, the new document will be created in the same folder as the selected asset.

The new document will be in a blank state. You need to fill out all the properties, including where the source files are located.

This method always works for all asset types and for some types it is the only way. Since this method always involves multiple, mostly simple steps, it can become tedious. Therefore, some asset types provide a way to automate much of this process.

## Create Documents Automatically

For asset types that are mostly defined by a single source file (e.g. [textures](../graphics/textures-overview.md) and [meshes](../graphics/meshes/mesh-asset.md)), the editor often provides an importing method that automates most of the trivial setup.

The most convenient way is to find the source asset file in the [asset browser](asset-browser.md) (ensure it shows *importable files*), right-click on it and select **Import As**. This sub-menu makes it possible to quickly import one or multiple assets as a specific asset type. It does so fully automatically. If you want to have a few more options, select **Import...** instead.
### Quick Import

The **most convenient** way is to find the source asset file in the [asset browser](asset-browser.md) (ensure it shows *importable files*), right-click on it and select **Import As**. This sub-menu makes it possible to quickly import one or multiple assets as a specific asset type. It does so fully automatically. For some file types this method also allows to import assets quickly multiple times. For example, [animation clips](../animation/skeletal-animation/animation-clip-asset.md) are often packed into a single file, which requires them to be imported many times.

### Controlled Import

If you want to have a few more options, select **Import...** instead.

Another method is to select **Project > Import Assets...** or press **CTRL+I** to open a file browse dialog. Navigate to the file(s) that you want to import and select them. If you want to know which asset types are currently supported for automatic import, you can open the dropdown with the allowed file extensions here.

Expand All @@ -26,16 +34,16 @@ Afterwards, you will be presented with a table of options how to import the sele

Here we selected four files for import. One .obj file and three .jpg files. The automatic import uses heuristics to make an educated guess how to import certain source files. Here it already suggests to import the "_col.jpg" file as a diffuse texture, the "_nrm.jpg" file as a normal map and so on. If the heuristic is incorrect, you can use the dropdown on the left to fix it.

It also suggests the target document file name. You can either click *Browse* or double click into the text field to change the target file name.

Some source files can be imported in multiple ways. For example the .obj file could be imported as a mesh for rendering or as a mesh for physics. Often you want to import the same mesh for both, so you want two asset documents (a *Mesh* and a *Collision Mesh*) which reference the same input file. Therefore this table lists the .obj file twice but with different import options in the dropdown box. If, for example, you do not want a mesh to be imported as collision mesh, at all, you can just select *No Import* from the respective dropdown.

Once you click *Import* the asset documents are generated and you can then open them. If background asset processing is enabled, the editor will already start transforming the asset data. Otherwise open each document and click the button of a white box with the green arrow to manually trigger the asset transform.

![Transform Asset](media/transform-asset.png)
Once you click *Import* the asset documents are generated and you can then open them. If background asset processing is enabled, the editor will already start [transforming](assets-overview.md#asset-transform) the asset data.

The automatic import creates the documents using a set of rules to fill out its properties, depending on the template that you selected for it. So for example an image imported as a "diffuse texture" and one imported as a "normal map" are mostly the same, except that a few options are already configured in a certain way for you. You should review all options for correctness afterwards.

### Import Via Drag And Drop

The methods above assume that the source asset is already present inside one of the project's [data directories](../projects/data-directories.md). If that is not the case, you can drag and drop a file into the [asset browser](asset-browser.md) to copy the file into the selected directory. This also automatically launches the asset import dialog mentioned above.

## Video: How to import textures

[![video](https://img.youtube.com/vi/x4qUFga-Jis/0.jpg)](https://www.youtube.com/watch?v=x4qUFga-Jis)
Expand Down
Binary file modified pages/docs/assets/media/asset-import.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 423ae79

Please sign in to comment.