-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmesh.py
More file actions
23 lines (18 loc) · 700 Bytes
/
mesh.py
File metadata and controls
23 lines (18 loc) · 700 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from pygin.component import Component
class Mesh(Component):
def __init__(self, game_object):
super(Mesh, self).__init__(game_object)
self.check_material()
def check_material(self):
"""
check whether the game_object material was defined before create the mesh
"""
if self.game_object.material is None:
raise Exception("GameObject {0} must have a material defined in order to have a Mesh"
.format(type(self.game_object).name))
def get_material(self):
"""
get the material of this mesh
:return: the game_object material
"""
return self.game_object.material