# 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#componentchangetype) | eventType  | Type of change.                      |
| [Occurrence](./scene_types#occurrence)                   | occurrence | Occurrence the component belongs to. |
| [Component](./scene_types#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#scenechangetype) | eventType       | Type of change.                               |
| [Occurrence](./scene_types#occurrence)           | occurrence      | Occurrence concerned by change.               |
| [Occurrence](./scene_types#occurrence)           | child           | Child occurrence for child insertion/removal. |
| [Occurrence](./scene_types#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#animation) | animation | Added animation. |

### AnimationChanged

```python
def onAnimationChanged(animation):
    pass


id = scene.addAnimationChangedCallback(onAnimationChanged)


...


scene.removeAnimationChangedCallback(id)
```

Parameters

| Type                                 | Name      | Description        |
| ------------------------------------ | --------- | ------------------ |
| [Animation](./scene_types#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#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#selectionchangetype) | type        | Type of change (CLEARED, ADDED or REMOVED).                             |
| [OccurrenceList](./scene_types#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#variantchangetype) | type    | Type of change (ADDED, REMOVED, CURRENT\_CHANGED). |
| [Variant](./scene_types#variant)                     | variant |                                                    |

### onRayProbe

```python
def ononRayProbe(proberID, proberInfo):
    pass


id = scene.addonRayProbeCallback(ononRayProbe)


...


scene.removeonRayProbeCallback(id)
```

Parameters

| Type                                   | Name       | Description         |
| -------------------------------------- | ---------- | ------------------- |
| [Ident](./core_types#ident)            | proberID   | The ray propber ID. |
| [ProberInfo](./scene_types#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#ident)            | proberID   | The sphere propber ID. |
| [ProberInfo](./scene_types#proberinfo) | proberInfo | The prober's info.     |
