# Core

> Python API events

### AfterEntityPropertyChanged

```python
def onAfterEntityPropertyChanged(entity, property, entityType):
    pass


id = core.addAfterEntityPropertyChangedCallback(onAfterEntityPropertyChanged)


...


core.removeAfterEntityPropertyChangedCallback(id)
```

Parameters

| Type                          | Name       | Description                 |
| ----------------------------- | ---------- | --------------------------- |
| [Entity](./core_types#entity) | entity     | Entity changed.             |
| [String](./core_types#string) | property   | Property changed.           |
| [Int](./core_types#int)       | entityType | Type of the entity changed. |

### AfterModulePropertyChanged

```python
def onAfterModulePropertyChanged(module, property):
    pass


id = core.addAfterModulePropertyChangedCallback(onAfterModulePropertyChanged)


...


core.removeAfterModulePropertyChangedCallback(id)
```

Parameters

| Type                          | Name     | Description       |
| ----------------------------- | -------- | ----------------- |
| [String](./core_types#string) | module   | Module changed.   |
| [String](./core_types#string) | property | Property changed. |

### AfterUndoRedo

```python
def onAfterUndoRedo(onlyPropertyChanged):
    pass


id = core.addAfterUndoRedoCallback(onAfterUndoRedo)


...


core.removeAfterUndoRedoCallback(id)
```

Parameters

| Type                            | Name                | Description                                                         |
| ------------------------------- | ------------------- | ------------------------------------------------------------------- |
| [Boolean](./core_types#boolean) | onlyPropertyChanged | If true, the change in the undo/redo step is only property changes. |

### AtExit

```python
def onAtExit():
    pass


id = core.addAtExitCallback(onAtExit)


...


core.removeAtExitCallback(id)
```

### BeforeEntityPropertyChanged

```python
def onBeforeEntityPropertyChanged(entity, property):
    pass


id = core.addBeforeEntityPropertyChangedCallback(onBeforeEntityPropertyChanged)


...


core.removeBeforeEntityPropertyChangedCallback(id)
```

Parameters

| Type                          | Name     | Description       |
| ----------------------------- | -------- | ----------------- |
| [Entity](./core_types#entity) | entity   | Entity changed.   |
| [String](./core_types#string) | property | Property changed. |

### BeforeModulePropertyChanged

```python
def onBeforeModulePropertyChanged(module, property):
    pass


id = core.addBeforeModulePropertyChangedCallback(onBeforeModulePropertyChanged)


...


core.removeBeforeModulePropertyChangedCallback(id)
```

Parameters

| Type                          | Name     | Description       |
| ----------------------------- | -------- | ----------------- |
| [String](./core_types#string) | module   | Module changed.   |
| [String](./core_types#string) | property | Property changed. |

### BeforeSessionReset

```python
def onBeforeSessionReset():
    pass


id = core.addBeforeSessionResetCallback(onBeforeSessionReset)


...


core.removeBeforeSessionResetCallback(id)
```

### BeforeUndoRedo

```python
def onBeforeUndoRedo(onlyPropertyChanged):
    pass


id = core.addBeforeUndoRedoCallback(onBeforeUndoRedo)


...


core.removeBeforeUndoRedoCallback(id)
```

Parameters

| Type                            | Name                | Description                                                         |
| ------------------------------- | ------------------- | ------------------------------------------------------------------- |
| [Boolean](./core_types#boolean) | onlyPropertyChanged | If true, the change in the undo/redo step is only property changes. |

### CurrentFileChanged

```python
def onCurrentFileChanged():
    pass


id = core.addCurrentFileChangedCallback(onCurrentFileChanged)


...


core.removeCurrentFileChangedCallback(id)
```

### EnteringUnsafeMode

```python
def onEnteringUnsafeMode():
    pass


id = core.addEnteringUnsafeModeCallback(onEnteringUnsafeMode)


...


core.removeEnteringUnsafeModeCallback(id)
```

### EntityDestroyed

```python
def onEntityDestroyed(entity):
    pass


id = core.addEntityDestroyedCallback(onEntityDestroyed)


...


core.removeEntityDestroyedCallback(id)
```

Parameters

| Type                          | Name   | Description      |
| ----------------------------- | ------ | ---------------- |
| [Entity](./core_types#entity) | entity | Entity detroyed. |

### LeavingUnsafeMode

```python
def onLeavingUnsafeMode():
    pass


id = core.addLeavingUnsafeModeCallback(onLeavingUnsafeMode)


...


core.removeLeavingUnsafeModeCallback(id)
```

### LicenseClientDisconnected

```python
def onLicenseClientDisconnected():
    pass


id = core.addLicenseClientDisconnectedCallback(onLicenseClientDisconnected)


...


core.removeLicenseClientDisconnectedCallback(id)
```

### LicenseClientReconnected

```python
def onLicenseClientReconnected():
    pass


id = core.addLicenseClientReconnectedCallback(onLicenseClientReconnected)


...


core.removeLicenseClientReconnectedCallback(id)
```

### OnConsoleMessage

```python
def onOnConsoleMessage(text, verboseLevel):
    pass


id = core.addOnConsoleMessageCallback(onOnConsoleMessage)


...


core.removeOnConsoleMessageCallback(id)
```

Parameters

| Type                            | Name         | Description      |
| ------------------------------- | ------------ | ---------------- |
| [String](./core_types#string)   | text         | Message content. |
| [Verbose](./core_types#verbose) | verboseLevel | Verbose level.   |

### OnSessionReset

```python
def onOnSessionReset():
    pass


id = core.addOnSessionResetCallback(onOnSessionReset)


...


core.removeOnSessionResetCallback(id)
```

### ProgressChanged

```python
def onProgressChanged(progress):
    pass


id = core.addProgressChangedCallback(onProgressChanged)


...


core.removeProgressChangedCallback(id)
```

Parameters

| Type                    | Name     | Description          |
| ----------------------- | -------- | -------------------- |
| [Int](./core_types#int) | progress | Current progression. |

### ProgressStepFinished

```python
def onProgressStepFinished():
    pass


id = core.addProgressStepFinishedCallback(onProgressStepFinished)


...


core.removeProgressStepFinishedCallback(id)
```

### ProgressStepStart

```python
def onProgressStepStart(stepName):
    pass


id = core.addProgressStepStartCallback(onProgressStepStart)


...


core.removeProgressStepStartCallback(id)
```

Parameters

| Type                          | Name     | Description               |
| ----------------------------- | -------- | ------------------------- |
| [String](./core_types#string) | stepName | Name of the started step. |

### DebugEvent

```python
def onDebugEvent(event_type):
    pass


id = core.addDebugEventCallback(onDebugEvent)


...


core.removeDebugEventCallback(id)
```

Parameters

| Type                    | Name        | Description                 |
| ----------------------- | ----------- | --------------------------- |
| [Int](./core_types#int) | event\_type | The type of signal to emit. |

### AfterCustomPropertyAdded

```python
def onAfterCustomPropertyAdded(entity, property, entityType):
    pass


id = core.addAfterCustomPropertyAddedCallback(onAfterCustomPropertyAdded)


...


core.removeAfterCustomPropertyAddedCallback(id)
```

Parameters

| Type                          | Name       | Description                          |
| ----------------------------- | ---------- | ------------------------------------ |
| [Entity](./core_types#entity) | entity     | Entity with custom property.         |
| [String](./core_types#string) | property   | Custom property that has been added. |
| [Int](./core_types#int)       | entityType | Type of the entity.                  |

### UndoRedoStackChanged

```python
def onUndoRedoStackChanged():
    pass


id = core.addUndoRedoStackChangedCallback(onUndoRedoStackChanged)


...


core.removeUndoRedoStackChangedCallback(id)
```
