event.registerΒΆ
Associate an event with a handler function
This function lets you associate an event to a function to be called when this event occurs. Note that handlers are called in an unpredicted order. The event handlers are called always with the signaled event as first argument, and the rest of the arguments given to event.signal.
Guerilla signals the following predefined events:
Application events:
- appready (event): called when application is ready and running (note that the initial document might not exist at that point, especially when running the Maya to Guerilla plugin)
- appclose (event): called before the application closes
- newdocument (event, Document): called after a new document is created
- loaddocument (event, Document): called after a document is loaded
- savedocument (event, Document): called before a document is saved
- closedocument (event, Document): called before a document is closed
- exportedproject (event): called when the export plugin finished generating the main project document (which is to be written as a .gproject file)
- exportedhostproject (event): called when the export plugin finished generating the host project document (which is to be written as a .ghostproject file)
- refloaded (event, refnode): called after a reference is loaded and before referenced nodes are merged into the scene. refnode is the loaded reference node, and children of refnode are the nodes contained in that reference. These nodes are not yet part of the Document, and have not yet been prefixed with the reference name. Additionnaly, some referenced nodes may be discarded once merged in the Document.
- refmerged (event, refnode, nodes): called after a reference is loaded and after referenced nodes are merged into the scene. refnode is the loaded reference node, nodes is the list of merged nodes in Document.
- prerender (event): called before a render action is performed
- postrender (event): called after a render action is performed. Note: the event is called right after to render commands are sent to the renderer, not after the render finished.
- pushrender (event, Render): called after a render is pushed.
Arguments:
event The event name to registerhandler The event handler to register