Skip to content

Commit

Permalink
made .bounds and .model_bounds return None if there's no model.
Browse files Browse the repository at this point in the history
  • Loading branch information
pokepetter committed Oct 26, 2024
1 parent 15ca587 commit 85dc7ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ursina/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,12 +881,14 @@ def model_bounds(self):
size = end - start
return Bounds(start=start, end=end, center=center, size=size)

return Vec3(0,0,0)
return None


@property
def bounds(self):
_bounds = self.model_bounds
if _bounds is None:
return None
return Bounds(start=_bounds.start*self.scale, end=_bounds.end*self.scale, center=_bounds.center, size=_bounds.size*self.scale)


Expand Down

0 comments on commit 85dc7ec

Please sign in to comment.