Emit and handle editor events

While a user works in the editor, their actions trigger events in the JavaScript environment. Other editor sub-systems and plug-ins listen for these events and respond to them by carrying out more actions -- which may in turn emit more events for other systems to respond to.

You can connect your plug-in to this event framework by listening for events that happen in the editor, and by emitting new events of your own.

Responding to an event

You can make your plug-in listen for and respond to events by:

Emitting a new event

You can make your plug-in send out a new event to all listeners in the editor by:

Finding out event names

You need to use event names as a key when you register a listener. So, in order to take full advantage of the event framework in your plug-in, you need to know the names of the events that the editor emits, and when those events occur.

We are currently working on putting together an exhaustive list that includes all events, whether they are triggered in the editor's JavaScript layer, the plug-in layer, or the back-end C# layer. We'll make that list public as soon as possible.

For now, your plug-in will mostly be limited to respond to events that you trigger from your own plug-in. However, you can also look through the editor's JavaScript modules and the built-in plug-ins installed with 3ds Max Interactive to look for calls to the on(), emit() and offer() functions of the event service.