ScriptButtons

ScriptLinks - Linking scripts to Blender

Python scripts can be attached to DataBlocks with the ScriptButtons window, and assigned events that define when they should be called.

The ScriptButtons are accessed via the icon in the the ButtonsWindow header.

ScriptLinks can be added for the following DataBlocks

When you are able to add a script link an icon appears in the header, similar to the ones that are used in the IPO Window. Selecting one of the icons brings up the ScriptLink buttons group in the left of the ScriptButtons window.

DataBlocks can have an arbitrary number of ScriptLinks attached to them - additional links can be added and deleted with the "New" and "Del" buttons, similar to Material Indices. Scripts are executed in order, beginning with the script linked at index one.

When you have at least one scriptlink the Event type and link buttons are displayed. The link button should be filled in with the name of the Text object to be executed. The Event type indicates at what point the script will be executed,

Scripts that are executed because of events being triggered receive additional input by objects in the Blender module.

Scene ScriptLinks

The ScriptLink buttons for Scenes are always available in the ScriptButtons, and function exactly in the manner described above. Events available for SceneScriptLinks are:

  • FrameChanged - This event is executed every time the user changes frame, and during rendering and animation playback.

  • OnLoad - This event is executed whenever the Scene is loaded, ie. when the file is initially loaded, or when the user switches to the current scene.

  • Redraw - This event is executed every time Blender redraws its Windows.