Camera#

Camera

A camera from Docking Camera (KURS), on an onboard camera part or a docking port.

Base class: SpaceCenter.Module

A Camera object is returned as {"id": ..., "class": ...}, its identifier and the name of its own class. An argument is that object or the identifier alone. A path that acts on an object takes the identifier as (id).

GET /docking-camera/camera/(id)/name#

Name of the PartModule. For example, “ModuleEngines”.

Inherited from SpaceCenter.Module.

Parameters:
  • id – The identifier of the Camera object.

Response JSON Object:
  • value (string)

GET /docking-camera/camera/(id)/part#

The part that contains this module.

Inherited from SpaceCenter.Module.

Parameters:
  • id – The identifier of the Camera object.

Response JSON Object:
  • value (SpaceCenter.Part)

GET /docking-camera/camera/(id)/config#

The static configuration of the module, as found in the part’s cfg file. This provides access to data that is not exposed as a field, such as the resources produced by a generator. Returns null if the module’s configuration node cannot be found.

Inherited from SpaceCenter.Module.

Parameters:
  • id – The identifier of the Camera object.

Response JSON Object:
  • value (SpaceCenter.ConfigNode)

GET /docking-camera/camera/(id)/field-list#

A list of all the fields of the module, including those not visible in the right-click menu of the part. Filter by GET /space-center/part-field/(id)/visible to get just the visible ones.

Inherited from SpaceCenter.Module.

Parameters:
  • id – The identifier of the Camera object.

Response JSON Object:
  • value (list<SpaceCenter.PartField>)

GET /docking-camera/camera/(id)/event-list#

A list of all the events of the module, including those not currently visible or active. Events are the clickable buttons visible in the right-click menu of the part. Filter by GET /space-center/part-event/(id)/visible and GET /space-center/part-event/(id)/active to get just the ones shown in the menu.

Inherited from SpaceCenter.Module.

Parameters:
  • id – The identifier of the Camera object.

Response JSON Object:
  • value (list<SpaceCenter.PartEvent>)

GET /docking-camera/camera/(id)/action-list#

A list of all the actions of the module. These are the parts actions that can be assigned to action groups in the in-game editor.

Inherited from SpaceCenter.Module.

Parameters:
  • id – The identifier of the Camera object.

Response JSON Object:
  • value (list<SpaceCenter.PartAction>)

POST /docking-camera/camera/(id)/image#

The image from the camera, 256 by 256 pixels. Throws an exception if the camera is off or not started.

Note

The camera is switched on by setting the IsEnabled field of its PartCameraModule or DockingCameraModule to true, which also opens the camera window.

Parameters:
  • id – The identifier of the Camera object.

Request JSON Object:
  • format (StdLib.ImageFormat) – The format of the image. Optional, defaults to "png".

  • quality (int32) – The quality of a JPEG image, from 1 to 100. Optional, defaults to 75.

Response JSON Object:
  • value (bytes) – The image data.