[yt-svn] commit/yt: samskillman: Setting self.center in __init__ after setup_box_properties was doing bad things,
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Thu Dec 5 14:30:51 PST 2013
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/commits/be524f912750/
Changeset: be524f912750
Branch: yt
User: samskillman
Date: 2013-12-05 23:19:51
Summary: Setting self.center in __init__ after setup_box_properties was doing bad things,
and forced the focus of the rendering to *always* be at the center of the box.
This causes many issues down the road when doing rotations/etc. Since self.center
and self.region were only being used here for later drawing grid boundaries, I
have moved things around to those specific routines, and *never* update the
.center attribute from that part.
Affected #: 1 file
diff -r 235c3b3d90ae5030d7631106ccdab3e2276358cf -r be524f912750b192aab75b9e5aacdab3421b2e6c yt/visualization/volume_rendering/camera.py
--- a/yt/visualization/volume_rendering/camera.py
+++ b/yt/visualization/volume_rendering/camera.py
@@ -239,8 +239,7 @@
else:
self.use_kd = isinstance(volume, AMRKDTree)
self.volume = volume
- self.center = (self.re + self.le) / 2.0
- self.region = self.pf.h.region(self.center, self.le, self.re)
+ self.region = None
def _setup_box_properties(self, width, center, unit_vectors):
self.width = width
@@ -299,6 +298,9 @@
>>> write_bitmap(im, 'render_with_grids.png')
"""
+ if self.region is None:
+ self.region = self.pf.h.region((self.re + self.le) / 2.0,
+ self.le, self.re)
corners = self.region.grid_corners
levels = self.region.grid_levels[:,0]
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list