[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41997] trunk/blender: UI/RNA:
Campbell Barton
ideasman42 at gmail.com
Sun Nov 20 01:52:17 CET 2011
> +++ trunk/blender/release/scripts/startup/bl_ui/space_clip.py 2011-11-20 00:32:39 UTC (rev 41997)
> @@ -474,16 +474,14 @@
> return sc.mode == 'RECONSTRUCTION' and sc.clip
>
> def draw_header(self, context):
> - sc = context.space_data
> - tracking = sc.clip.tracking
> - stab = tracking.stabilization
> -
> + stab = context.space_data.clip.tracking.stabilization
> +
> self.layout.prop(stab, "use_2d_stabilization", text="")
>
> def draw(self, context):
> layout = self.layout
> - sc = context.space_data
> - tracking = sc.clip.tracking
> +
> + tracking = context.space_data.clip.tracking
> stab = tracking.stabilization
>
> layout.active = stab.use_2d_stabilization
Hi Thomas, I don't think these kinds of cleanup commits are that
worthwhile (referring specifically changes in space_clip.py),
it means if you want to access one of these members later - devs are
likely to add in duplicate lookups eg.
if context.space_data.clip.tracking.foo and
context.space_data.clip.tracking.bar:
...
rather than...
if tracking.foo and tracking.bar:
...
in python storing intermediate vars gives a little overhead but its
nothing like the slowdown of getattr lookups, multiple times.
- Campbell
More information about the Bf-committers
mailing list