camera_fit_selection

Frames the selected nodes, visible or not, keeping the view direction. invalid_params when nothing is selected.

Command

Usage

TypeScript
surface.execute('camera_fit_selection', { padding?, tight?, animate?, durationMs?, easing?, viewport? })

Parameters

  • paddingnumber

    Optional

  • tightboolean

    Optional

  • animateboolean

    Optional

  • durationMsnumber

    Optional

  • easing"linear" | "cubic-in" | "cubic-out" | "cubic-in-out"

    Optional

  • viewportstring

    the slot (viewport id); the first by default

    Optional

Returns

object with eye, target, up, projection, transition, in the ok: true envelope.

JSON
{
  "type": "object",
  "properties": {
    "eye": {
      "type": "object",
      "description": "f64 world-space point or direction",
      "properties": {
        "x": {
          "type": "number"
        },
        "y": {
          "type": "number"
        },
        "z": {
          "type": "number"
        }
      },
      "required": [
        "x",
        "y",
        "z"
      ]
    },
    "target": {
      "type": "object",
      "description": "f64 world-space point or direction",
      "properties": {
        "x": {
          "type": "number"
        },
        "y": {
          "type": "number"
        },
        "z": {
          "type": "number"
        }
      },
      "required": [
        "x",
        "y",
        "z"
      ]
    },
    "up": {
      "type": "object",
      "description": "f64 world-space point or direction",
      "properties": {
        "x": {
          "type": "number"
        },
        "y": {
          "type": "number"
        },
        "z": {
          "type": "number"
        }
      },
      "required": [
        "x",
        "y",
        "z"
      ]
    },
    "projection": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "perspective",
            "orthographic"
          ]
        },
        "fovYDeg": {
          "type": "number"
        },
        "height": {
          "type": "number"
        }
      },
      "required": [
        "kind"
      ]
    },
    "transition": {
      "type": "integer",
      "minimum": 1
    }
  },
  "required": [
    "eye",
    "target",
    "up",
    "projection"
  ]
}

See also