How to Import Assets

From Thrive Developer Wiki
Jump to navigation Jump to search

This page or section contains outdated information. This often happens when plans are changed after something has been written.

First you need the import tool. You can download the latest release to get it (after 0.4.2 is released, for now you need a dev build). The import tool is LeviathanEditor.

Additionally if you are making a modified version of an asset you'll want to download the raw version of the asset. The raw versions are stored here. Note that you need Git and Git LFS to clone it properly. Some assets that don't need to be converted are stored in the main repo, but also use Git LFS.

These instructions are for modellers. For programmers there are instructions here: Running the Import Script

How to run the tool

There is currently no GUI for the importing. LeviathanEditor can be ran from the terminal or cmd.exe with the import flag. There is also a helper script included (AssetImportHelper.rb) if you have ruby installed (on Windows use Ruby installer) you can just double click the script to run it (or in terminal / cmd.exe run "ruby AssetImportHelper.rb"). Note: the script needs the os gem to run (install with the command "gem install os", once you have ruby installed and added to PATH). It will automatically create the source and target folders on first run. Then you can place your raw assets in the "raw assets" folder and run the script again. The processed assets will be placed in the "processed assets" folder.

If you prefer running it like a command line tool, it works like this: "LeviathanEditor --import source_folder target_folder" Replace source_folder and target_folder with the folders where the raw assets are and where the assets should be placed. For example you can create two folders next to LeviathanEditor called "raw" and "assets", and use a command like "LeviathanEditor --import raw assets". Be careful with spaces in the filenames as you need to put quotes around the path if there are spaces.

Once imported you can rename the .asset file and move it into the Thrive Data folder to have the game detect the file. You can replace an existing file to have your asset version replace it.

Asset requirements

The type of asset to import is detected based on the extension:

  • Image files should be .png files (and a multiple of 4 in size)
  • Models need to be .fbx files (blender has a default exporter for fbx)

Options files

The importing of assets can be tweaked by including options json files. For example the image compression and animation importing can be set using these files.

Requirements for Models

There is an outdated page that has some general instructions for how to make models that are suitable for importing: blender-and-ogre-tutorial

Here's a short list:

  • Model must be placed at 0,0,0
  • No rotation may be set
  • No scaling may be used (use scaling / rotating in vertex edit mode to not apply the scaling to the model, but directly to the vertices)
  • Armatures need to have named animation tracks (note: when importing a specialized options file is needed to import animated meshes)
  • Vertice count needs to be reasonable compared to how much screen space the model takes up