Skip to content

Commit

Permalink
wxGUI/animation: fix 3D rendering (#1551)
Browse files Browse the repository at this point in the history
Includes fix for Python3 for deleting items in dict
  • Loading branch information
petrasovaa committed Apr 28, 2021
1 parent 86efb3e commit 632116c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions gui/wxpython/animation/controller.py
Expand Up @@ -364,6 +364,8 @@ def _updateAnimations(self, activeIndices, mapNamesDict=None):
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)
Expand All @@ -378,6 +380,8 @@ def _updateAnimations(self, activeIndices, mapNamesDict=None):
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
)
Expand Down
4 changes: 3 additions & 1 deletion gui/wxpython/animation/provider.py
Expand Up @@ -367,6 +367,8 @@ def Render(self, cmdList, regions, regionFor3D, bgcolor, force, nprocs):

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
Expand Down Expand Up @@ -753,7 +755,7 @@ def Clear(self):
"""
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])
Expand Down

0 comments on commit 632116c

Please sign in to comment.