mirror of
https://github.com/3b1b/manim.git
synced 2025-09-01 00:48:45 +00:00
Have image mobject remember the filepath to the Image
This commit is contained in:
parent
7732d2f0ee
commit
6cdbe0d67a
1 changed files with 5 additions and 2 deletions
|
@ -22,10 +22,13 @@ class ImageMobject(Mobject):
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, filename, **kwargs):
|
def __init__(self, filename, **kwargs):
|
||||||
path = get_full_raster_image_path(filename)
|
self.set_image_path(get_full_raster_image_path(filename))
|
||||||
|
super().__init__(**kwargs)
|
||||||
|
|
||||||
|
def set_image_path(self, path):
|
||||||
|
self.path = path
|
||||||
self.image = Image.open(path)
|
self.image = Image.open(path)
|
||||||
self.texture_paths = {"Texture": path}
|
self.texture_paths = {"Texture": path}
|
||||||
super().__init__(**kwargs)
|
|
||||||
|
|
||||||
def init_data(self):
|
def init_data(self):
|
||||||
self.data = {
|
self.data = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue