Skip to content

Commit 74d411a

Browse files
committed
Make texture class configurable
1 parent cbc9b4d commit 74d411a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

pywavefront/material.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141

4242

4343
class Material:
44+
texture_cls = Texture
45+
4446
def __init__(self, name, is_default=False, has_faces=False):
4547
"""
4648
Create a new material
@@ -131,22 +133,22 @@ def set_emissive(self, values=None):
131133
self.emissive = self.pad_light(values or [])
132134

133135
def set_texture(self, name, search_path):
134-
self.texture = Texture(name, search_path)
136+
self.texture = self.texture_cls(name, search_path)
135137

136138
def set_texture_ambient(self, name, search_path):
137-
self.texture_ambient = Texture(name, search_path)
139+
self.texture_ambient = self.texture_cls(name, search_path)
138140

139141
def set_texture_specular_color(self, name, search_path):
140-
self.texture_specular_color = Texture(name, search_path)
142+
self.texture_specular_color = self.texture_cls(name, search_path)
141143

142144
def set_texture_specular_highlight(self, name, search_path):
143-
self.texture_specular_highlight = Texture(name, search_path)
145+
self.texture_specular_highlight = self.texture_cls(name, search_path)
144146

145147
def set_texture_alpha(self, name, search_path):
146-
self.texture_alpha = Texture(name, search_path)
148+
self.texture_alpha = self.texture_cls(name, search_path)
147149

148150
def set_texture_bump(self, name, search_path):
149-
self.texture_bump = Texture(name, search_path)
151+
self.texture_bump = self.texture_cls(name, search_path)
150152

151153
def unset_texture(self):
152154
self.texture = None

0 commit comments

Comments
 (0)