Skip to content

Commit

Permalink
made Mesh not generate if vertices is [] and not just None.
Browse files Browse the repository at this point in the history
  • Loading branch information
pokepetter committed Jun 21, 2023
1 parent 7ce749c commit e75becf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ursina/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __init__(self, vertices=None, triangles=None, colors=None, uvs=None, normals
if value is None:
setattr(self, name, [])

if self.vertices is not None:
if self.vertices:
self.generate()


Expand Down Expand Up @@ -192,6 +192,10 @@ def __repr__(self):
else:
return self.recipe

def __str__(self):
if hasattr(self, 'name'):
return self.name


def __add__(self, other):
self.vertices += other.vertices
Expand All @@ -205,6 +209,7 @@ def __add__(self, other):
self.uvs += other.uvs



def __deepcopy__(self, memo):
m = Mesh(self.vertices, self.triangles, self.colors, self.uvs, self.normals, self.static, self.mode, self.thickness)
m.name = self.name
Expand Down

0 comments on commit e75becf

Please sign in to comment.