Motion kit command

file.import

File

File ▸ Import; with `addToComp` (files dropped on the Timeline or the Composition viewer) they also become layers of the active comp ([`add_to_comp`]).

Kit
Motion 0.1.0 (.kmotion)
Changes the document
yes

Parameters

Parameters of file.import
NameTypeRequiredDescription
addToCompbooleannoalso add them to the active comp, at time?, index?, position?: as in layer.addItem
alphabeticalbooleannoForce Alphabetical Order: every image of that type in the folder, by name
backgroundbooleannoprobe the files in a background job, job.list / job.wait; returns {job}
dragbooleannodropped files: Settings ▸ Import ▸ Default Drag Import As; files import as stills unless sequence
frameRatenumbernofps (image sequences; default Settings ▸ Import ▸ Sequence Footage)
importAs"footage" | "composition" | "compositionLayerSizes"noPSD, PDF, .ai and EPS files
layerinteger | stringnoname|index (footage of one PSD layer); footage of one PSD layer
pagestringnonumber from 1 (PDF / .ai page); PDF / .ai page
pathsstring[]nofiles or folders
sequencebooleannothe Sequence checkbox: true imports numbered stills of one run as one image sequence, one picked file bringing its whole run and several picked files that range; default: a numbered still brings its run, except dropped files (drag), which import as stills as is usual; folders' runs import as sequences; false imports stills and a folder's files individually

Call through motion_run

text
motion_run {
  "path": "<file>.kmotion",
  "steps": [{ "command": "file.import" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: addToComp, alphabetical, background, drag, frameRate, importAs, layer, page, paths, sequence. motion_run answers the step’s result in completed[i].result.

Result

The kit gives no result schema for this command.

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "addToComp": {
      "description": "also add them to the active comp, at time?, index?, position?: as in layer.addItem",
      "type": "boolean"
    },
    "alphabetical": {
      "description": "Force Alphabetical Order: every image of that type in the folder, by name",
      "type": "boolean"
    },
    "background": {
      "description": "probe the files in a background job, job.list / job.wait; returns {job}",
      "type": "boolean"
    },
    "drag": {
      "description": "dropped files: Settings ▸ Import ▸ Default Drag Import As; files import as stills unless sequence",
      "type": "boolean"
    },
    "frameRate": {
      "description": "fps (image sequences; default Settings ▸ Import ▸ Sequence Footage)",
      "type": "number"
    },
    "importAs": {
      "description": "PSD, PDF, .ai and EPS files",
      "enum": [
        "footage",
        "composition",
        "compositionLayerSizes"
      ],
      "type": "string"
    },
    "layer": {
      "description": "name|index (footage of one PSD layer); footage of one PSD layer",
      "oneOf": [
        {
          "description": "layer id as motion_inspect lists it (when no layer has that id, its 1-based stack position)",
          "type": "integer"
        },
        {
          "description": "layer id as receipts print it (\"51\"), a layer name, or #n for the n-th from the top",
          "type": "string"
        }
      ]
    },
    "page": {
      "description": "number from 1 (PDF / .ai page); PDF / .ai page",
      "type": "string"
    },
    "paths": {
      "description": "files or folders",
      "items": {
        "type": "string",
        "x-khp-file": {
          "accept": [
            "mp4",
            "m4v",
            "mov",
            "mkv",
            "webm",
            "png",
            "jpg",
            "jpeg",
            "gif",
            "webp",
            "tif",
            "tiff",
            "bmp",
            "exr",
            "psd",
            "psb",
            "svg",
            "pdf",
            "ai",
            "eps",
            "wav",
            "wave",
            "bwf",
            "aif",
            "aiff",
            "mp3",
            "mp2",
            "m4a",
            "aac",
            "flac",
            "ogg",
            "opus",
            "gltf",
            "glb",
            "obj"
          ],
          "access": "read"
        }
      },
      "type": "array"
    },
    "sequence": {
      "description": "the Sequence checkbox: true imports numbered stills of one run as one image sequence, one picked file bringing its whole run and several picked files that range; default: a numbered still brings its run, except dropped files (drag), which import as stills as is usual; folders' runs import as sequences; false imports stills and a folder's files individually",
      "type": "boolean"
    }
  },
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (motion_commands through @kition/[email protected], built from KitionAI/kition-motion@4719aa7). As data: commands.jsonl.