Skip to content

Commit

Permalink
Deep copy textures in copy_meta_from (pyvista#564)
Browse files Browse the repository at this point in the history
  • Loading branch information
banesullivan authored Feb 3, 2020
1 parent d9519e5 commit 16fbeab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyvista/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1006,8 +1006,9 @@ def copy_meta_from(self, ido):
self._active_scalars_info = ido.active_scalars_info
self._active_vectors_info = ido.active_vectors_info
if hasattr(ido, '_textures'):
self._textures = ido._textures

self._textures = {}
for name, tex in ido._textures.items():
self._textures[name] = tex.copy()

@property
def point_arrays(self):
Expand Down
4 changes: 4 additions & 0 deletions pyvista/core/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,3 +499,7 @@ def repeat(self):
@repeat.setter
def repeat(self, flag):
self.SetRepeat(flag)

def copy(self):
"""Make a copy of this textrue."""
return Texture(self.to_image().copy())

0 comments on commit 16fbeab

Please sign in to comment.