camera_fit
Frames the visible scene, or nodeIds (hidden nodes count, unknown ids are ignored, an empty list is the visible scene, no known id is invalid_params), keeping the view direction. padding (≥ 1) multiplies the bounding sphere; tight frames the box corners instead. No change when nothing is visible.
Usage
surface.execute('camera_fit', { nodeIds?, padding?, tight?, animate?, durationMs?, easing?, viewport? })Parameters
nodeIdsstring[]paddingnumbertightbooleananimatebooleandurationMsnumbereasing"linear" | "cubic-in" | "cubic-out" | "cubic-in-out"viewportstringthe slot (viewport id); the first by default
Returns
object with eye, target, up, projection, transition, in the ok: true envelope.
{
"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"
]
}