Past events

Toolbox

Contents

Introduction

There are a number of interfaces in cs and cel which can serve as callbacks to discover things happening in engine. To be able use this functionality, one must inherit from special base classes for python.

There are two modules in csexternal repository that provide such classes, one for cs and one for cel: cscallback and celcallback.

In general for a given interface, there is a base class, with the naming convention of prefixing with py instead of i as is normal for interfaces.

Example

For example, in iMovableListener this would be pyMovableListener. And to use it just declare your class inheriting from this, and implement the needed functions in interface from python:

Note how the constructor for all callback classes requires that you pass the object registry (in the previous example, it is assumed ObjectRegistry is the object registry, and Movable a valid movable).