Wiki

Clone wiki

KRaster Importer for Unity / KRasterSettings

User Preferences: KRaster Importer

To display the user preferences for this plugin in Unity, click on the Edit menu > Preferences... > KRaster Importer section.

You can hover the mouse on any field to show a tooltip with its explanation.

User Preferences: KRaster Importer

Show in Preview

These preferences control what info is displayed in the preview area when inspecting source images. They don't affect importation.

External Programs

This mode is not required if using only simple sRGB KRA/ORA to PNG conversions.

There are 3 settings that control the external programs called to export files from the source images. These are disabled by default, and must only be enabled after the user has the programs installed. The user must locate the program's path (unless it's accessible from the PATH system variable). The arguments pattern must also be correct for the called program. Defaults are provided according to user's OS.
It's prudent to test the command on one file first before doing many importations in a large project.

  1. OpenRaster Converter: for images from ORA files
  2. Krita Image Converter: for images from KRA/KRZ files
  3. Krita Animation Exporter: for animations from KRA/KRZ files

It's recommended that the user installs Krita and enable the 2nd and 3rd options above. This allows dealing properly with HDR, non-sRGB color spaces, animations and KRZ files. It also allows converting to formats other than PNG and using the manual image converter.

The Krita command from the 2nd option can also be copied to the 1st option, for ORA files. The default command uses LazPaint to export from ORA. However, enabling the 1st option should not be necessary at all, unless you really want to convert ORA to a format other than PNG for some reason.

The command included for the animation exporter will use Krita to generate each frame separately at the output path. Krita appends a numeric suffix to the filename to differentiate frames.

Since importation is synchronous, a timeout is used to kill the process if it takes too long to finish. This time is per file processed. If you have issues with slow conversions being interrupted too early, you may increase this value or use -1 to disable the timeout.

⚠️ Important
Due to a bug in Krita (still not fixed as of v5.2.2), if Krita was already running when called to do the conversion, it will hang forever. This can cause Unity to freeze during asset (re)importation, until you close Krita or the timeout is reached.
⚠️ Important
Krita allows various settings when exporting an image. When called via command, Krita picks the last used settings. If you have compatibility issues, make sure they're set correctly by opening Krita and manually exporting some file, so it can remember the correct settings later, when being called from Unity. You need to enable Flatten the image when available. Don't forget to store alpha channel (transparency) too.

Recommended Krita export settings:

EXR PNG TIFF
Recommended Krita export options for EXR Recommended Krita export options for PNG Recommended Krita export options for TIFF

Home

Updated