# Scene

> Python API events

### ComponentChanged

```python
def onComponentChanged(eventType, occurrence, component):
    pass

id = scene.addComponentChangedCallback(onComponentChanged)

...

scene.removeComponentChangedCallback(id)
```

Parameters

| Type                                                        | Name       | Description                          |
| ----------------------------------------------------------- | ---------- | ------------------------------------ |
| [ComponentChangeType](./scene_types.md#componentchangetype) | eventType  | Type of change.                      |
| [Occurrence](./scene_types.md#occurrence)                   | occurrence | Occurrence the component belongs to. |
| [Component](./scene_types.md#component)                     | component  | Component concerned by change.       |

### SceneChanged

```python
def onSceneChanged(eventType, occurrence, child, finalOccurrence):
    pass

id = scene.addSceneChangedCallback(onSceneChanged)

...

scene.removeSceneChangedCallback(id)
```

Parameters

| Type                                                | Name            | Description                                   |
| --------------------------------------------------- | --------------- | --------------------------------------------- |
| [SceneChangeType](./scene_types.md#scenechangetype) | eventType       | Type of change.                               |
| [Occurrence](./scene_types.md#occurrence)           | occurrence      | Occurrence concerned by change.               |
| [Occurrence](./scene_types.md#occurrence)           | child           | Child occurrence for child insertion/removal. |
| [Occurrence](./scene_types.md#occurrence)           | finalOccurrence | Occurrence in the tree impact by the event.   |

### AnimationAdded

```python
def onAnimationAdded(animation):
    pass

id = scene.addAnimationAddedCallback(onAnimationAdded)

...

scene.removeAnimationAddedCallback(id)
```

Parameters

| Type                                    | Name      | Description      |
| --------------------------------------- | --------- | ---------------- |
| [Animation](./scene_types.md#animation) | animation | Added animation. |

### AnimationChanged

```python
def onAnimationChanged(animation):
    pass

id = scene.addAnimationChangedCallback(onAnimationChanged)

...

scene.removeAnimationChangedCallback(id)
```

Parameters

| Type                                    | Name      | Description        |
| --------------------------------------- | --------- | ------------------ |
| [Animation](./scene_types.md#animation) | animation | Changed Animation. |

### AnimationCleared

```python
def onAnimationCleared():
    pass

id = scene.addAnimationClearedCallback(onAnimationCleared)

...

scene.removeAnimationClearedCallback(id)
```

### AnimationRemoved

```python
def onAnimationRemoved(animation):
    pass

id = scene.addAnimationRemovedCallback(onAnimationRemoved)

...

scene.removeAnimationRemovedCallback(id)
```

Parameters

| Type                                    | Name      | Description        |
| --------------------------------------- | --------- | ------------------ |
| [Animation](./scene_types.md#animation) | animation | Removed Animation. |

### IsolateBegan

```python
def onIsolateBegan():
    pass

id = scene.addIsolateBeganCallback(onIsolateBegan)

...

scene.removeIsolateBeganCallback(id)
```

### IsolateEnded

```python
def onIsolateEnded():
    pass

id = scene.addIsolateEndedCallback(onIsolateEnded)

...

scene.removeIsolateEndedCallback(id)
```

### SelectionChanged

```python
def onSelectionChanged(type, occurrences):
    pass

id = scene.addSelectionChangedCallback(onSelectionChanged)

...

scene.removeSelectionChangedCallback(id)
```

Parameters

| Type                                                        | Name        | Description                                                             |
| ----------------------------------------------------------- | ----------- | ----------------------------------------------------------------------- |
| [SelectionChangeType](./scene_types.md#selectionchangetype) | type        | Type of change (CLEARED, ADDED or REMOVED).                             |
| [OccurrenceList](./scene_types.md#occurrencelist)           | occurrences | Only if type is ADDED or REMOVED, list of added or removed occurrences. |

### VariantChanged

```python
def onVariantChanged(type, variant):
    pass

id = scene.addVariantChangedCallback(onVariantChanged)

...

scene.removeVariantChangedCallback(id)
```

Parameters

| Type                                                    | Name    | Description                                        |
| ------------------------------------------------------- | ------- | -------------------------------------------------- |
| [VariantChangeType](./scene_types.md#variantchangetype) | type    | Type of change (ADDED, REMOVED, CURRENT\_CHANGED). |
| [Variant](./scene_types.md#variant)                     | variant |                                                    |

### onRayProbe

```python
def ononRayProbe(proberID, proberInfo):
    pass

id = scene.addonRayProbeCallback(ononRayProbe)

...

scene.removeonRayProbeCallback(id)
```

Parameters

| Type                                      | Name       | Description         |
| ----------------------------------------- | ---------- | ------------------- |
| [Ident](./core_types.md#ident)            | proberID   | The ray propber ID. |
| [ProberInfo](./scene_types.md#proberinfo) | proberInfo | The prober's info.  |

### onSphereProbe

```python
def ononSphereProbe(proberID, proberInfo):
    pass

id = scene.addonSphereProbeCallback(ononSphereProbe)

...

scene.removeonSphereProbeCallback(id)
```

Parameters

| Type                                      | Name       | Description            |
| ----------------------------------------- | ---------- | ---------------------- |
| [Ident](./core_types.md#ident)            | proberID   | The sphere propber ID. |
| [ProberInfo](./scene_types.md#proberinfo) | proberInfo | The prober's info.     |
