~ubuntu-branches/ubuntu/lucid/blender/lucid

« back to all changes in this revision

Viewing changes to source/blender/python/api2_2x/doc/API_related.py

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2009-08-06 22:32:19 UTC
  • mfrom: (1.2.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20090806223219-8z4eej1u8levu4pz
Tags: 2.49a+dfsg-0ubuntu1
* Merge from debian unstable, remaining changes:
  - debian/control: Build-depend on python-2.6 rather than python-2.5.
  - debian/misc/*.desktop: Add Spanish translation to .desktop 
    files.
  - debian/pyversions: 2.6.
  - debian/rules: Clean *.o of source/blender/python/api2_2x/
* New upstream release (LP: #382153).
* Refreshed patches:
  - 01_sanitize_sys.patch
  - 02_tmp_in_HOME
  - 10_use_systemwide_ftgl
  - 70_portability_platform_detection
* Removed patches merged upstream:
  - 30_fix_python_syntax_warning
  - 90_ubuntu_ffmpeg_52_changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
184
184
 Space Handler script links:
185
185
 ---------------------------
186
186
 
187
 
 This is a new kind of script linked to spaces in a given window.  Right now
188
 
 only the 3D View has the necessary hooks, but the plan is to add access to
189
 
 other types, too.  Just to clarify naming conventions: in Blender, a screen
190
 
 is partitioned in windows (also called areas) and each window can show any
191
 
 space.  Spaces are: 3D View, Text Editor, Scripts, Buttons, User Preferences,
 
187
 These are scripts linked to spaces in a given window.  Right now
 
188
 only the 3D View has the necessary hooks.  Just to clarify naming
 
189
 conventions: in Blender, a screen is partitioned in windows (also
 
190
 called areas) and each window can show any space.
 
191
 Spaces are: 3D View, Text Editor, Scripts, Buttons, User Preferences,
192
192
 Oops, etc. 
193
193
 
194
194
 Space handlers are texts in the Text Editor, like other script links, but they
196
196
 text file}} must inform:
197
197
  1. that they are space handlers;
198
198
  2. the space they belong to;
199
 
  3. whether they are EVENT or DRAW handlers.
 
199
  3. whether they are EVENT, EVENT_RELEASE (EVENT ones reporting key release events) or DRAW handlers.
200
200
 
201
201
 Example header for a 3D View EVENT handler::
202
202
 
203
203
  # SPACEHANDLER.VIEW3D.EVENT
204
204
 
 
205
 Example header for a 3D View EVENT handler that also receives release events::
 
206
 
 
207
  # SPACEHANDLER.VIEW3D.EVENT.ALL
 
208
 
205
209
 Example header for a 3D View DRAW handler::
206
210
 
207
211
  # SPACEHANDLER.VIEW3D.DRAW
216
220
  - process it (the script must set Blender.event to None then);
217
221
  - ignore it.
218
222
 
 
223
 EVENT ALL space handlers (header: # SPACEHANDLER.VIEW3D.EVENT.ALL) are executed
 
224
 both for key presses (Blender.event = Blender.SpaceHandlers.VIEW3D_EVENT) and
 
225
 for key releases (Blender.event = Blender.SpaceHandlers.VIEW3D_EVENT_RELEASE).
 
226
 
219
227
 Setting C{Blender.event = None} tells Blender not to go on processing itself
220
228
 the event, because it was grabbed by the script.
221
229
 
248
256
  - B{bylink} is the same: True if the script is running as a script link;
249
257
  - B{link}: integer from the L{Blender}.SpaceHandlers constant dictionary,
250
258
    tells what space this handler belongs to and the handler's type
251
 
    (EVENT, DRAW);
 
259
    (EVENT, EVENT_RELEASE, DRAW);
252
260
  - B{event}:
253
261
     - EVENT handlers: an input event (check keys and mouse events in
254
262
       L{Draw}) to be processed or ignored;
258
266
       presses (since we don't pass releases) as 1 and mouse movements
259
267
       (Draw.MOUSE.X and Draw.MOUSE.Y) as the current x or y coordinate,
260
268
       for example;
 
269
     - EVENT_RELEASE handlers (EVENT handlers executed during key release events): 0;
261
270
     - DRAW handlers: 0 always.
262
271
 
263
272
 B{Guidelines (important)}: