From 1038c76c551be5f8d4b083f05fd2ed06f16c767a Mon Sep 17 00:00:00 2001 From: Andrew Wiggin Date: Thu, 17 Nov 2011 05:03:07 +0000 Subject: Add access to UVs from python, patch python unwrap scripts to work wtih ngons --- release/scripts/modules/bpy_types.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'release/scripts/modules/bpy_types.py') diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index bb1e9988ec2..eeb8f375c3d 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -442,6 +442,20 @@ class MeshFace(StructRNA): ord_ind(verts[3], verts[0]), ) +class MeshPolygon(StructRNA): + __slots__ = () + + @property + def edge_keys(self): + verts = self.vertices[:] + vlen = len(self.vertices) + return [ord_ind(verts[i], verts[(i+1) % vlen]) for i in range(vlen)] + + @property + def loops(self): + start = self.loop_start + end = start + self.loop_total + return range(start, end) class Text(bpy_types.ID): __slots__ = () -- cgit v1.2.3