# Node

> What every object in a document can do.

Symbols in this group are spelled `otio_node_…`. An SDK drops that prefix.

## `child_at`

`otio_node_child_at` · method

Returns one of an object's children.

```c
OtioStatus otio_node_child_at(
    const OtioDocument *source,
    OtioNode parent,
    size_t index,
    OtioNode *out_child,
    OtioBuffer *out_error);
```

| Parameter | Type | Role |
| --- | --- | --- |
| `source` (optional) | `document` | document in |
| `parent` | `node` | receiver |
| `index` | `size` | input |
| `out_child` | `node` | output |
| `out_error` | `text` | error |

## `child_count`

`otio_node_child_count` · getter

Returns how many children an object holds.

Tracks, stacks, bare compositions and serializable collections hold children; anything else reports `OTIO_STATUS_WRONG_KIND`.

```c
OtioStatus otio_node_child_count(
    const OtioDocument *source,
    OtioNode parent,
    size_t *out_count,
    OtioBuffer *out_error);
```

| Parameter | Type | Role |
| --- | --- | --- |
| `source` (optional) | `document` | document in |
| `parent` | `node` | receiver |
| `out_count` | `size` | output |
| `out_error` | `text` | error |

## `children`

`otio_node_children` · getter

Returns an object's children.

```c
OtioStatus otio_node_children(
    const OtioDocument *source,
    OtioNode parent,
    OtioNode *out_nodes,
    size_t capacity,
    size_t *out_count,
    OtioBuffer *out_error);
```

| Parameter | Type | Role |
| --- | --- | --- |
| `source` (optional) | `document` | document in |
| `parent` | `node` | receiver |
| `out_nodes` | `list<node>` | output list |
| `capacity` | `size` | list capacity |
| `out_count` | `size` | output count |
| `out_error` | `text` | error |

## `equals`

`otio_node_equal` · method

Returns whether two handles have the same value.

Within one document that is object identity: two handles are equal only if they were issued for the same occupant of the same slot. Handles from two different documents can be equal without naming the same object, since a handle is scoped to the document that issued it.

```c
bool otio_node_equal(OtioNode left, OtioNode right);
```

| Parameter | Type | Role |
| --- | --- | --- |
| `left` | `node` | receiver |
| `right` | `node` | input |

## `find_clips`

`otio_node_find_clips` · getter

Returns every clip at or below an object, in order.

```c
 *     otio_node_find_clips(document, timeline, NULL, 0, &count, NULL);
```

| Parameter | Type | Role |
| --- | --- | --- |
| `source` (optional) | `document` | document in |
| `node_handle` | `node` | receiver |
| `out_nodes` | `list<node>` | output list |
| `capacity` | `size` | list capacity |
| `out_count` | `size` | output count |
| `out_error` | `text` | error |

## `highest_ancestor`

`otio_node_highest_ancestor` · getter

Returns the outermost object above this one.

```c
OtioStatus otio_node_highest_ancestor(
    const OtioDocument *source,
    OtioNode node_handle,
    OtioNode *out_ancestor,
    OtioBuffer *out_error);
```

| Parameter | Type | Role |
| --- | --- | --- |
| `source` (optional) | `document` | document in |
| `node_handle` | `node` | receiver |
| `out_ancestor` | `node` | output |
| `out_error` | `text` | error |

## `is_none`

`otio_node_is_none` · getter

Returns whether a handle names no object.

```c
bool otio_node_is_none(OtioNode node);
```

| Parameter | Type | Role |
| --- | --- | --- |
| `node` | `node` | receiver |

## `schema_kind`

`otio_node_kind` · getter

Returns what kind of object a handle names.

The answer is the most specific kind the library knows: a clip reports `OTIO_NODE_KIND_CLIP`, never `OTIO_NODE_KIND_ITEM`, and a linear time warp `OTIO_NODE_KIND_LINEAR_TIME_WARP`, never `OTIO_NODE_KIND_TIME_EFFECT`. An object read from a schema the library does not know reports `OTIO_NODE_KIND_UNKNOWN_SCHEMA`.

```c
OtioStatus otio_node_kind(
    const OtioDocument *source,
    OtioNode node_handle,
    OtioNodeKind *out_kind,
    OtioBuffer *out_error);
```

| Parameter | Type | Role |
| --- | --- | --- |
| `source` (optional) | `document` | document in |
| `node_handle` | `node` | receiver |
| `out_kind` | `OtioNodeKind` | output |
| `out_error` | `text` | error |

## `name`

`otio_node_name` · getter

Returns an object's name, which is empty for an object that has none.

```c
OtioStatus otio_node_name(
    const OtioDocument *source,
    OtioNode node_handle,
    OtioBuffer *out_name,
    OtioBuffer *out_error);
```

| Parameter | Type | Role |
| --- | --- | --- |
| `source` (optional) | `document` | document in |
| `node_handle` | `node` | receiver |
| `out_name` | `text` | output |
| `out_error` | `text` | error |

## `none`

`otio_node_none` · constructor

Returns the handle that names no object.

Fields that may be absent, such as a timeline's tracks before one is set, report this. Compare against it with `otio_node_is_none`.

```c
 * one, or `otio_node_none()` to leave the clip as it is. It returns
 * `OTIO_STATUS_OK`, or any other status to stop the read or write, having
 * written a NUL-terminated sentence to `message`, which has room for
 * `message_capacity` bytes, saying why. The call that ran it then fails with
 * `OTIO_STATUS_PLUGIN_ERROR` and that sentence.
 *
 * The registry is process-wide, so a plugin must be safe to call from any
 * thread that reads or writes.
 */
typedef OtioStatus (*OtioPluginFn)(
    void *context,
    OtioDocument *document,
    OtioNode target,
    OtioNode arguments,
    OtioNode *out_result,
    char *message,
    size_t message_capacity);
```

## `overlapping`

`otio_node_overlapping` · getter

Returns whether an object sits over its neighbours rather than beside them.

Only a transition does, which is why one does not advance the playhead when a track is laid out.

```c
OtioStatus otio_node_overlapping(
    const OtioDocument *source,
    OtioNode node_handle,
    bool *out_overlapping,
    OtioBuffer *out_error);
```

| Parameter | Type | Role |
| --- | --- | --- |
| `source` (optional) | `document` | document in |
| `node_handle` | `node` | receiver |
| `out_overlapping` | `bool` | output |
| `out_error` | `text` | error |

## `parent`

`otio_node_parent` · getter · may answer nothing

Returns the composition an object sits in.

Reports `OTIO_STATUS_NO_VALUE` for an object that is in none, which is what a freshly created one is.

```c
OtioStatus otio_node_parent(
    const OtioDocument *source,
    OtioNode node_handle,
    OtioNode *out_parent,
    OtioBuffer *out_error);
```

| Parameter | Type | Role |
| --- | --- | --- |
| `source` (optional) | `document` | document in |
| `node_handle` | `node` | receiver |
| `out_parent` | `node` | output |
| `out_error` | `text` | error |

## `run_hook`

`otio_node_run_hook` · method

Runs every script attached to the hook `hook` on an object, each on what the one before returned, and writes what the last returned to `out_result`: upstream's `hooks.run`.

`arguments` is the scripts' argument map as a JSON object, or null for an empty one. With no script attached, the object itself comes back. A hook that was never declared, by an attachment or as one of the four every read and write runs, is `OTIO_STATUS_PLUGIN_ERROR`, as is a script that fails or is not registered.

```c
OtioStatus otio_node_run_hook(
    OtioDocument *document,
    OtioNode node_handle,
    const char *hook,
    const char *arguments,
    OtioNode *out_result,
    OtioBuffer *out_error);
```

| Parameter | Type | Role |
| --- | --- | --- |
| `document` | `document` | document mut |
| `node_handle` | `node` | receiver |
| `hook` | `text` | input |
| `arguments` (optional) | `text` | input |
| `out_result` | `node` | output |
| `out_error` | `text` | error |

## `schema_name`

`otio_node_schema_name` · getter

Returns the schema name an object serializes as, such as `"Clip"`.

```c
OtioStatus otio_node_schema_name(
    const OtioDocument *source,
    OtioNode node_handle,
    OtioBuffer *out_name,
    OtioBuffer *out_error);
```

| Parameter | Type | Role |
| --- | --- | --- |
| `source` (optional) | `document` | document in |
| `node_handle` | `node` | receiver |
| `out_name` | `text` | output |
| `out_error` | `text` | error |

## `schema_version`

`otio_node_schema_version` · getter

Returns the schema version an object serializes as.

```c
OtioStatus otio_node_schema_version(
    const OtioDocument *source,
    OtioNode node_handle,
    uint32_t *out_version,
    OtioBuffer *out_error);
```

| Parameter | Type | Role |
| --- | --- | --- |
| `source` (optional) | `document` | document in |
| `node_handle` | `node` | receiver |
| `out_version` | `uint32` | output |
| `out_error` | `text` | error |

## `set_name`

`otio_node_set_name` · setter

Sets an object's name.

```c
OtioStatus otio_node_set_name(
    OtioDocument *target,
    OtioNode node_handle,
    const char *name,
    OtioBuffer *out_error);
```

| Parameter | Type | Role |
| --- | --- | --- |
| `target` | `document` | document mut |
| `node_handle` | `node` | receiver |
| `name` | `text` | input |
| `out_error` | `text` | error |

## `to_json`

`otio_node_to_json` · method

Writes one object of a document as OTIO JSON.

Upstream's `write_to_string` takes any object, not only a timeline, so this does too.

```c
OtioStatus otio_node_to_json(
    const OtioDocument *source,
    OtioNode node,
    size_t indent,
    OtioBuffer *out_json,
    OtioBuffer *out_error);
```

| Parameter | Type | Role |
| --- | --- | --- |
| `source` (optional) | `document` | document in |
| `node` | `node` | receiver |
| `indent` | `size` | input |
| `out_json` | `text` | output |
| `out_error` | `text` | error |

## `transformed_time`

`otio_node_transformed_time` · method

Restates an instant from one object's clock in another's.

```c
OtioStatus otio_node_transformed_time(
    const OtioDocument *source,
    OtioRationalTime time,
    OtioNode from,
    OtioNode to,
    OtioRationalTime *out_time,
    OtioBuffer *out_error);
```

| Parameter | Type | Role |
| --- | --- | --- |
| `source` (optional) | `document` | document in |
| `time` | `OtioRationalTime` | input |
| `from` | `node` | receiver |
| `to` | `node` | input |
| `out_time` | `OtioRationalTime` | output |
| `out_error` | `text` | error |

## `transformed_time_range`

`otio_node_transformed_time_range` · method

Restates a span from one object's clock in another's.

```c
OtioStatus otio_node_transformed_time_range(
    const OtioDocument *source,
    OtioTimeRange range,
    OtioNode from,
    OtioNode to,
    OtioTimeRange *out_range,
    OtioBuffer *out_error);
```

| Parameter | Type | Role |
| --- | --- | --- |
| `source` (optional) | `document` | document in |
| `range` | `OtioTimeRange` | input |
| `from` | `node` | receiver |
| `to` | `node` | input |
| `out_range` | `OtioTimeRange` | output |
| `out_error` | `text` | error |

## `visible`

`otio_node_visible` · getter

Returns whether an object covers what is beneath it when its composition is flattened.

```c
OtioStatus otio_node_visible(
    const OtioDocument *source,
    OtioNode node_handle,
    bool *out_visible,
    OtioBuffer *out_error);
```

| Parameter | Type | Role |
| --- | --- | --- |
| `source` (optional) | `document` | document in |
| `node_handle` | `node` | receiver |
| `out_visible` | `bool` | output |
| `out_error` | `text` | error |

---

Page: https://otio-rust-docs.vercel.app/reference/node/
