---
title: "layer.tree: Layer Property Tree — Motion kit command — Kition"
description: "Returns `layer`'s property tree at `time` (comp seconds): every group and property with its path (as prop.set takes, e.g. transform/position), value, keyframes and expression, `depth` levels deep. Read before setting properties."
canonical: "https://developer.kition.ai/docs/kits/motion/commands/layer.tree"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/motion/commands/layer.tree](https://developer.kition.ai/docs/kits/motion/commands/layer.tree)

# layer.tree

**Layer Property Tree.** Returns `layer`'s property tree at `time` (comp seconds): every group and property with its path (as prop.set takes, e.g. transform/position), value, keyframes and expression, `depth` levels deep. Read before setting properties.

- Kit: Motion 0.1.0 (.kmotion); reference: [Motion kit commands](https://developer.kition.ai/docs/kits/motion.md)
- Changes the document: no
- Acts on: `layer` (one id), which a run step’s `on` fills

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `comp` | `integer \| string` | no |  |
| `depth` | `integer` | no |  |
| `layer` | `integer \| string` | no |  |
| `time` | `number` | no | comp s |

## Call through motion_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: `comp`, `depth`, `layer`, `time`. motion_run answers the step’s result in `completed[i].result`.

## Result

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `blendMode` | `string` | no |  |
| `id` | `integer` | no |  |
| `in` | `number` | no |  |
| `index` | `integer` | no |  |
| `label` | `string` | no |  |
| `lightKind` | `string` | no |  |
| `name` | `string` | no |  |
| `out` | `number` | no |  |
| `parent` | `any` | no |  |
| `properties` | `object` | no |  |
| `start` | `number` | no |  |
| `stretch` | `number` | no |  |
| `switches` | `object` | no |  |
| `time` | `number` | no |  |
| `trackMatte` | `any` | no |  |
| `type` | `string` | no |  |

```json
{
  "additionalProperties": true,
  "properties": {
    "blendMode": {
      "type": "string"
    },
    "id": {
      "type": "integer"
    },
    "in": {
      "type": "number"
    },
    "index": {
      "type": "integer"
    },
    "label": {
      "type": "string"
    },
    "lightKind": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "out": {
      "type": "number"
    },
    "parent": {},
    "properties": {
      "additionalProperties": true,
      "properties": {
        "children": {
          "items": {
            "additionalProperties": true,
            "properties": {
              "children": {
                "items": {},
                "type": "array"
              },
              "enabled": {
                "type": "boolean"
              },
              "match": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "path": {
                "type": "string"
              },
              "uid": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "type": "array"
        },
        "enabled": {
          "type": "boolean"
        },
        "match": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "path": {
          "type": "string"
        },
        "uid": {
          "type": "integer"
        }
      },
      "type": "object"
    },
    "start": {
      "type": "number"
    },
    "stretch": {
      "type": "number"
    },
    "switches": {
      "additionalProperties": true,
      "properties": {
        "adjustment": {
          "type": "boolean"
        },
        "audio": {
          "type": "boolean"
        },
        "collapse": {
          "type": "boolean"
        },
        "effects": {
          "type": "boolean"
        },
        "frame_blend": {
          "type": "string"
        },
        "guide": {
          "type": "boolean"
        },
        "locked": {
          "type": "boolean"
        },
        "motion_blur": {
          "type": "boolean"
        },
        "quality": {
          "type": "string"
        },
        "sampling": {
          "type": "string"
        },
        "shy": {
          "type": "boolean"
        },
        "solo": {
          "type": "boolean"
        },
        "three_d": {
          "type": "boolean"
        },
        "video": {
          "type": "boolean"
        }
      },
      "type": "object"
    },
    "time": {
      "type": "number"
    },
    "trackMatte": {},
    "type": {
      "type": "string"
    }
  },
  "type": "object"
}
```

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "comp": {
      "oneOf": [
        {
          "description": "comp's item id as motion_inspect lists it",
          "type": "integer"
        },
        {
          "description": "the item id as receipts print it (\"1\"), or the comp's name",
          "type": "string"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Item"
      ]
    },
    "depth": {
      "type": "integer"
    },
    "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"
        }
      ],
      "x-khp-index": "#",
      "x-khp-index-numbers": true,
      "x-khp-name": "name",
      "x-khp-types": [
        "Layer"
      ]
    },
    "time": {
      "description": "comp s",
      "type": "number"
    }
  },
  "returns": "nodes with `path`",
  "type": "object"
}
```

Generated from the command list of @kition/motion-darwin-arm64@0.1.0 and the kit itself (motion_commands through @kition/cli@0.1.1, built from KitionAI/kition-motion@4719aa7).
