0
0

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: blender/blender-addons#104810
This commit is contained in:
Patrick-White-4 2023-08-01 13:41:10 +02:00 committed by Pratik Borhade
parent 9d5a6ef938
commit 08ec3386cd

View File

@ -700,7 +700,7 @@ class torus_knot_plus(Operator, AddObjectHelper):
print("Approximate average TK length = %.2f" % avgTKLen)
# 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
self.align_matrix = align_matrix(self, context)