This tab can be used to create all types of commands or actions that can, for example, be called when the object to which the tag is assigned (tagged object) is clicked or double-clicked. For those of you who start to panic when they hear the word "script", adding commands (or commenting them out via # or //) is easy: Open the
Make sure to remove the comments (Python: #; C.O.F.F.E.E.: //) from in front of functions and commands and to add a tab space (
Here you can select which scripting language you want to use. If None is selected, scripting will be disabled - existing scripts will not be deleted.
This is where you enter your script(s). Several predefined functions are already included for which can be activated by simply removing the # or // in front of the respective function.
The following predefined functions are available (support and documentation for Python and C.O.F.F.E.E. can also be found at http://developers.maxon.net):
This is called when the user first clicks the mouse button or taps the screen with the stylus. Here you can adjust the proxy object using a script, adjust the document mode using doc.SetMode(MODE_ID) or adjust the active tool to be used by this object with doc.SetAction(TOOL_ID). You can also prepare any data you need for the drag.
This is called continuously during a mouse interaction for each refresh as the mouse moves. You cannot change the proxy object, document mode or tool at this point.
This is called when the user releases the mouse button and signals the end of the user interaction. You can reset tools or kill off any memory-hungry objects that have been allocated in mouseDown or mouseDrag at this point.
This is called when the user selects the object to which the tag is assigned. The tag has to be selected (When Selected option).
This is called when the user deselects the object to which the tag is assigned.
This is called when the object is highlighted by the mouse cursor.
This is called when the object's highlight status is removed by the mouse cursor moving off of the object.
This is called when a message is set to the object, the arguments are id and data. The data is typically a dictionary in Python and a void or BaseContainer in C.O.F.F.E.E. containing the message structure/private information. See the SDK docs for an explanation of messages.
This is called to allow you to draw directly into the Viewport using the passed argument bd (BaseDraw).
Clicking on this button will open the Expression-Editor, which offers a more comfortable coding field. Both script fields are linked with each other. Therefore, it doesn’t matter which field you use to enter your code - the other field will be updated automatically.