Skip to content
Snippets Groups Projects
Commit 973e85bd authored by Patrick-White-4's avatar Patrick-White-4 Committed by Philipp Oeser
Browse files

Extra objects: Fix TypeError when torus knot added

TypeError is thrown when `torus knot object +` added with `7*6` preset.
`torus_res` is an IntProperty, and after python 3.10, implicit conversion
from float to int is not happening. Cast division value explicity to int to
fix the problem.

Pull Request: https://projects.blender.org/blender/blender-addons/pulls/104810
parent 2a562f9a
Branches
Tags
No related merge requests found
...@@ -698,7 +698,7 @@ class torus_knot_plus(Operator, AddObjectHelper): ...@@ -698,7 +698,7 @@ class torus_knot_plus(Operator, AddObjectHelper):
print("Approximate average TK length = %.2f" % avgTKLen) print("Approximate average TK length = %.2f" % avgTKLen)
# x N factor = control points per unit length # x N factor = control points per unit length
self.torus_res = max(3, avgTKLen / links * 8) self.torus_res = max(3, int(avgTKLen / links) * 8)
# update align matrix # update align matrix
self.align_matrix = align_matrix(self, context) self.align_matrix = align_matrix(self, context)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment