Page MenuHome

mesh_utils.triangle_random_points fails with a TypeError.
Closed, ResolvedPublic

Description

Blender Version
Broken: 2.80
Worked: 2.79

mesh_utils.triangle_random_points function fails with an error:

  File "/home/omar/projects/blender2.80/2.80/scripts/modules/bpy_extras/mesh_utils.py", line 459, in triangle_random_points
    area1 = area_tri(*tv[0])
TypeError: area_tri

Exact steps for others to reproduce the error
Execute the following script in a scene with an object:

import bpy
from bpy_extras import mesh_utils
mesh = bpy.data.objects[0].data
mesh.calc_loop_triangles()
points = mesh_utils.triangle_random_points(100, mesh.loop_triangles)

It seems this bug was introduced in D3539.