[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28924] trunk/blender/release/scripts/ templates/operator_modal_view3d.py: replace context.areas.spaces[0] with context.space_data
Campbell Barton
ideasman42 at gmail.com
Sun May 23 07:34:46 CEST 2010
Revision: 28924
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28924
Author: campbellbarton
Date: 2010-05-23 07:34:45 +0200 (Sun, 23 May 2010)
Log Message:
-----------
replace context.areas.spaces[0] with context.space_data
Modified Paths:
--------------
trunk/blender/release/scripts/templates/operator_modal_view3d.py
Modified: trunk/blender/release/scripts/templates/operator_modal_view3d.py
===================================================================
--- trunk/blender/release/scripts/templates/operator_modal_view3d.py 2010-05-23 02:02:04 UTC (rev 28923)
+++ trunk/blender/release/scripts/templates/operator_modal_view3d.py 2010-05-23 05:34:45 UTC (rev 28924)
@@ -10,13 +10,13 @@
def execute(self, context):
- v3d = context.area.spaces[0]
+ v3d = context.space_data
rv3d = v3d.region_3d
rv3d.view_location = self._initial_location + Vector(self.properties.offset)
def modal(self, context, event):
- v3d = context.area.spaces[0]
+ v3d = context.space_data
rv3d = v3d.region_3d
if event.type == 'MOUSEMOVE':
@@ -33,10 +33,9 @@
return {'RUNNING_MODAL'}
def invoke(self, context, event):
- active_space = context.area.spaces[0]
- if active_space.type == 'VIEW_3D':
- v3d = active_space
+ if context.space_data.type == 'VIEW_3D':
+ v3d = context.space_data
rv3d = v3d.region_3d
context.manager.add_modal_handler(self)
More information about the Bf-blender-cvs
mailing list