# object.update

Source: https://docs.lightair.app/developers/remote-api/object.update

> Changes an object: its name, place, size, rotation, opacity, visibility, lock, or its source's settings.

JSON-RPC 2.0 method of Lightair's Remote API (ws://localhost:4455/rpc). Group: Objects and sources. Script plugins need the `project.write` permission.

Position and size are in canvas pixels, in the primary canvas unless `canvas` is given. Visibility changes on every canvas the object is laid out on, unless `canvas` is given. `settings` are merged into its source's settings key by key.

Everything given is one undo step.

## Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `object` | `string` | yes | The object's id or name. |
| `scene` | `string` | no | Its scene's id or name. Default: the scene being edited. |
| `canvas` | `string` | no | A canvas's id or name. |
| `name` | `string` | no | A new name. |
| `visible` | `boolean` | no | Show or hide it. |
| `locked` | `boolean` | no | Lock or unlock it. |
| `x` | `number` | no | Left edge. |
| `y` | `number` | no | Top edge. |
| `width` | `number` | no | Width, at least 1. |
| `height` | `number` | no | Height, at least 1. |
| `rotation` | `number` | no | Rotation in degrees. |
| `opacity` | `number` | no | 0 to 1. |
| `settings` | `object` | no | Settings merged into its source's. |

## Result

| Name | Type | Required | Description |
|---|---|---|---|
| `(the object)` | `object` | no | The object as state.get lists it. |

## Errors

Not found (-32004) for an unknown scene, object or canvas. Invalid params (-32602) for `settings` on a group, which has no source.

## Events

- `workspace.changed`
- `object.visible`

## From an AI agent

The MCP server's `update_object` reaches this method.

## Example

```json
{ "jsonrpc": "2.0", "id": 1, "method": "object.update", "params": { "object": "Title", "x": 100, "y": 80, "opacity": 0.8 } }
```

Result:

```json
{ "id": "019ad3f4-1a2b-7c3d-8e4f-5a6b7c8d9e0f", "name": "Title", "kind": "text_ft2_source_v2", "source": "019ad3f4-2b3c-7d4e-9f50-6b7c8d9e0f1a", "parent": null, "visible": true, "locked": false, "x": 100, "y": 80, "width": 384, "height": 179.2, "rotation": 0, "opacity": 0.8 }
```

## Related

- [object.add](https://docs.lightair.app/developers/remote-api/object.add.md)
- [object.move](https://docs.lightair.app/developers/remote-api/object.move.md)
- [source.update](https://docs.lightair.app/developers/remote-api/source.update.md)
