Fix T95444: dxf import issue with curve object

File with curve object can not be imported after python 3.10
Cast count value explicitly to int for fixing the import problem

Reviewed By: mont29

Maniphest Tasks: T95444

Differential Revision: https://developer.blender.org/D14156
This commit is contained in:
Pratik Borhade 2022-02-21 12:00:38 +01:00 committed by Bastien Montagne
parent bfcf35f746
commit 7476c1ac24
Notes: blender-bot 2023-02-14 18:24:53 +01:00
Referenced by issue #95444, Cant Import DXF file
1 changed files with 2 additions and 2 deletions

View File

@ -189,7 +189,7 @@ class Do:
# type(self, dxf entity, blender curve data)
def _cubic_bezier_closed(self, ptuple, curve):
count = (len(ptuple)-1)/3
count = int((len(ptuple) - 1) / 3)
points = [ptuple[-2]]
ptuples = ptuple[:-2]
points += [p for p in ptuples]
@ -204,7 +204,7 @@ class Do:
b[i].handle_right = self.proj(points[j + 1])
def _cubic_bezier_open(self, points, curve):
count = (len(points) - 1) / 3 + 1
count = int((len(points) - 1) / 3 + 1)
spl = curve.splines.new('BEZIER')
b = spl.bezier_points
b.add(count - 1)