for g in v.groups:
g.group = group_index_map[g.group]
- def prepare_uv(self, obj, progress):
- if obj.material_tex and self.use_uv!='NONE':
- layer = UvLayer("material_tex")
-
- if self.use_uv=='UNIT0':
- self.uv_layers = [layer]
- layer.unit = 0
- else:
- self.uv_layers.append(layer)
- layer.unit = max((u.unit+1 for u in self.uv_layers if u.unit is not None), default=0)
-
- layer.uvs = [None]*len(self.loops)
- for f in self.faces:
- uv = mathutils.Vector(((f.material_index+0.5)/len(self.materials), 0.5))
- for i in f.loop_indices:
- layer.uvs[i] = uv
-
+ def prepare_uv(self, progress):
# Form a list of UV layers referenced by materials with the array atlas
# property set
array_uv_layers = [t.uv_layer for m in self.materials if m.array_atlas for t in m.texture_slots if t and t.texture_coords=='UV']
progress.set_task("Vertex groups", 0.5, 0.6)
mesh.prepare_vertex_groups(obj)
progress.set_task("Preparing UVs", 0.6, 0.8)
- mesh.prepare_uv(obj, progress)
+ mesh.prepare_uv(progress)
progress.set_task("Render sequence", 0.8, 1.0)
mesh.prepare_sequence(progress)