Skip to content

Commit

Permalink
fix: fix unexpected float error in Blender 3.1 and limit the possibil…
Browse files Browse the repository at this point in the history
…ity of dividing by zero errors on manual user input
  • Loading branch information
tristan-hm committed May 27, 2022
1 parent b58520d commit 1cdac6c
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion generators/recon_poly.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def modal(self, context, event):
self.dirty = True
elif self.key_alt:
self.segments_input_stream = update_stream(self.segments_input_stream, event.type)
self.segments = get_stream_value(self.segments_input_stream)
self.segments = int(get_stream_value(self.segments_input_stream, min_value=3))
self.dirty = True

elif self.key_reset:
Expand Down
2 changes: 1 addition & 1 deletion power_mods/array_cubed.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def modal(self, context, event):
elif self.key_numeric_input:
if self.key_no_modifiers:
self.count_streams[self.axis] = update_stream(self.count_streams[self.axis], event.type)
self.axes[self.axis][1] = get_stream_value(self.count_streams[self.axis])
self.axes[self.axis][1] = int(get_stream_value(self.count_streams[self.axis]))
self.dirty = True
elif self.key_ctrl:
self.offset_streams[self.axis] = update_stream(self.offset_streams[self.axis], event.type)
Expand Down
2 changes: 1 addition & 1 deletion power_mods/bevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def modal(self, context, event):
self.dirty = True
elif self.key_alt:
self.segments_input_stream = update_stream(self.segments_input_stream, event.type)
self.segments = get_stream_value(self.segments_input_stream)
self.segments = int(get_stream_value(self.segments_input_stream, min_value=1))
self.dirty = True
elif self.key_ctrl:
self.profile_input_stream = update_stream(self.profile_input_stream, event.type)
Expand Down
2 changes: 1 addition & 1 deletion power_mods/circular_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def modal(self, context, event):
elif self.key_numeric_input:
if self.key_no_modifiers:
self.count_input_stream = update_stream(self.count_input_stream, event.type)
self.count = get_stream_value(self.count_input_stream, min_value=2)
self.count = int(get_stream_value(self.count_input_stream, min_value=2))
self.dirty = True
elif self.key_alt:
self.angle_input_stream = update_stream(self.angle_input_stream, event.type)
Expand Down
2 changes: 1 addition & 1 deletion power_mods/edge_bevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def modal(self, context, event):
self.dirty = True
elif self.key_alt:
self.segments_input_stream = update_stream(self.segments_input_stream, event.type)
self.segments = get_stream_value(self.segments_input_stream)
self.segments = int(get_stream_value(self.segments_input_stream, min_value=1))
self.dirty = True
elif self.key_ctrl:
self.profile_input_stream = update_stream(self.profile_input_stream, event.type)
Expand Down
2 changes: 1 addition & 1 deletion power_mods/screw.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def modal(self, context, event):
elif self.key_numeric_input:
if self.key_no_modifiers:
self.segments_input_stream = update_stream(self.segments_input_stream, event.type)
self.segments = get_stream_value(self.segments_input_stream)
self.segments = int(get_stream_value(self.segments_input_stream, min_value=3))
self.dirty = True
elif self.key_alt:
self.angle_input_stream = update_stream(self.angle_input_stream, event.type)
Expand Down
2 changes: 1 addition & 1 deletion power_mods/vertex_bevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def modal(self, context, event):
self.dirty = True
elif self.key_alt:
self.segments_input_stream = update_stream(self.segments_input_stream, event.type)
self.segments = get_stream_value(self.segments_input_stream)
self.segments = int(get_stream_value(self.segments_input_stream, min_value=1))
self.dirty = True
elif self.key_ctrl:
self.profile_input_stream = update_stream(self.profile_input_stream, event.type)
Expand Down

0 comments on commit 1cdac6c

Please sign in to comment.