Skip to content

Development Notes

jonpas edited this page Sep 10, 2023 · 5 revisions

Editor Previews

All Editor Preview images are stored in addons/assets/previews/ and used with EDITORPROPERTY(class) macro. Every public vehicle and unit should have an Editor Preview.

To facilitate the large amount of content, the process is as simplified as possible.

  1. Follow steps 1-4 of Configuring Asset Previews with addition of:
    • maxScreenShotFolderSizeMB = 10000; // 10 GB
    • Sampling 100%
    • Depth of Field to 1 or higher
    • Ambient Occlusion on (Strong/Hard)
  2. Run the following code in Debug Console to:
    • Generate new class previews:
      [0.5, "all", [], [], [], ["TACU_NewClass"]] spawn BIS_fnc_exportEditorPreviews;
    • Generate new faction previews:
      [0.5, "all", [], [], ["tacu_new_faction"]] spawn BIS_fnc_exportEditorPreviews;
    • Generate all previews:
      private _addons = "true" configClasses (configFile >> "CfgPatches") apply {configName _x} select {
          _x select [0, 5] == "tacu_" &&
          !("faction_overwrites" in _x) /* ignore as it would generate dependency classes */
      };
      [0.5, "all", [], [], _addons] spawn BIS_fnc_exportEditorPreviews;
    Note: Increase 0.5 to 1 or higher if your PC does not render textures quickly enough.
  3. Resize all images to 455x256 and save them in JPG format using ImageMagick:
    for f in *.png; do magick convert -resize 455x256 $f -set filename:fname %t +adjoin '%[filename:fname].jpg'; done
    Note: for-loop instead of magick convert *.png due to memory limitations.
  4. Copy all JPG format images to addons/assets/previews/ (delete all first to avoid retaining any removed classes).
Clone this wiki locally