Blockbench Reference Docs
    Preparing search index...
    interface SharedOptions {
        compileAnimation?: (animation: Animation) => any;
        importFile?: (file: FileResult, auto_loaded?: boolean) => void;
        loadFile?: (file: FileResult, animation_filter?: string[]) => void;
        multiple_per_file: boolean;
        pickFile?: () => void;
        reloadAnimation?: (animation: Animation) => void;
        saveAnimation?: (animation: Animation, save_as?: boolean) => void;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    compileAnimation?: (animation: Animation) => any

    Compile a specified animation into animation file content

    Type Declaration

      • (animation: Animation): any
      • Parameters

        • animation: Animation

          Animation to compile

        Returns any

        Compiled subpart of an animation file

    importFile?: (file: FileResult, auto_loaded?: boolean) => void

    Given a file input, imports the animations from the file into the current project, while adding undo entries and handling other logic

    Type Declaration

      • (file: FileResult, auto_loaded?: boolean): void
      • Parameters

        • file: FileResult

          File to import

        • Optionalauto_loaded: boolean

          For specific formats, set to true if the file was automatically loaded instead of based on explicit user input

        Returns void

    loadFile?: (file: FileResult, animation_filter?: string[]) => void

    Load the animations from an animation file into the project. Not required on generic codecs

    Type Declaration

      • (file: FileResult, animation_filter?: string[]): void
      • Parameters

        • file: FileResult

          File to load

        • Optionalanimation_filter: string[]

          If specified, only animations with an ID in the list get imported

        Returns void

    multiple_per_file: boolean

    Set to true if multiple animations can be included per animation file

    pickFile?: () => void

    Opens a file picker to select and import animations using the codec

    reloadAnimation?: (animation: Animation) => void

    Reload a given animation from its file on disk

    saveAnimation?: (animation: Animation, save_as?: boolean) => void

    Save the specified animation to its file. If no file exists, or save_as is true, this can open a file save dialog

    Type Declaration

      • (animation: Animation, save_as?: boolean): void
      • Parameters

        • animation: Animation

          Animation to save

        • Optionalsave_as: boolean

          If true, pick a new location to save to

        Returns void