if flags[i] and not flags[(i+l-1)%l]:
return self.vertices[i:]+self.vertices[:i]
- def get_edge(self, v1, v2):
+ def get_edge(self, v1, v2):
key = make_edge_key(v1.index, v2.index)
for e in self.edges:
if e.key==key:
if type(arg)==str:
self._layer = None
self.name = arg
+ self.uvs = []
else:
self._layer = arg
self.name = arg.name
self.vertex_groups = mesh.vertex_groups
# Clone basic data
- self.vertices = [Vertex(v) for v in self.vertices]
+ self.vertices = [Vertex(v) for v in mesh.vertices]
for v in self.vertices:
v.groups = [VertexGroup(g) for g in v.groups]
- self.faces = [Face(f) for f in self.polygons]
- self.edges = [Edge(e) for e in self.edges]
- self.loops = self.loops[:]
- self.materials = self.materials[:]
+ self.faces = [Face(f) for f in mesh.polygons]
+ self.edges = [Edge(e) for e in mesh.edges]
+ self.loops = mesh.loops[:]
+ self.materials = mesh.materials[:]
# Clone only the desired UV layers
- if self.use_uv=='NONE' or not self.uv_layers:
+ if self.use_uv=='NONE' or not mesh.uv_layers:
self.uv_layers = []
else:
- self.uv_layers = [UvLayer(u) for u in self.uv_layers]
+ self.uv_layers = [UvLayer(u) for u in mesh.uv_layers]
self.uv_layers = sorted([u for u in self.uv_layers if not u.hidden], key=(lambda u: (u.unit or 1000, u.name)))
if self.use_uv=='UNIT0':