Przeglądaj źródła

wxGUI/animation: fix 3D rendering (#1551)

Includes fix for Python3 for deleting items in dict
Anna Petrasova 4 lat temu
rodzic
commit
632116c558

+ 4 - 0
gui/wxpython/animation/controller.py

@@ -364,6 +364,8 @@ class AnimationController(wx.EvtHandler):
                     continue
                 anim = [anim for anim in self.animationData if anim.windowIndex == i][0]
                 regions = anim.GetRegions()
+                if anim.viewMode == "3d":
+                    regions = [None] * len(regions)
                 self.animations[i].SetFrames(
                     [
                         HashCmds(cmdList, region)
@@ -378,6 +380,8 @@ class AnimationController(wx.EvtHandler):
                     continue
                 anim = [anim for anim in self.animationData if anim.windowIndex == i][0]
                 regions = anim.GetRegions()
+                if anim.viewMode == "3d":
+                    regions = [None] * len(regions)
                 identifiers = sampleCmdMatrixAndCreateNames(
                     anim.cmdMatrix, mapNamesDict[anim.firstStdsNameType[0]], regions
                 )

+ 3 - 1
gui/wxpython/animation/provider.py

@@ -367,6 +367,8 @@ class BitmapRenderer:
 
         filteredCmdList = []
         for cmd, region in zip(cmdList, regions):
+            if cmd[0] == "m.nviz.image":
+                region = None
             filename = GetFileFromCmd(self._tempDir, cmd, region)
             if (
                 not force
@@ -753,7 +755,7 @@ class MapFilesPool(DictRefCounter):
         """
         Debug.msg(4, "MapFilesPool.Clear")
 
-        for key in self.dictionary.keys():
+        for key in list(self.dictionary.keys()):
             if self.referenceCount[key] <= 0:
                 name, ext = os.path.splitext(self.dictionary[key])
                 os.remove(self.dictionary[key])