- prog_step = 0
-
- # Split by the UV layer used for TBN vectors first so connectivity
- # remains intact for TBN vector computation
- tbn_layer_index = -1
- if self.tbn_vecs:
- uv_names = [u.name for u in self.uv_layers]
- if self.tbn_uvtex in uv_names:
- prog_count += 1
- tbn_layer_index = uv_names.index(self.tbn_uvtex)
- progress.push_task_slice("Computing TBN", 0, prog_count)
- self.split_vertices(self.find_uv_group, progress, tbn_layer_index)
- progress.set_task_slice(self.tbn_uvtex, 1, prog_count)
- self.compute_tbn(tbn_layer_index, progress)
- progress.pop_task()
- prog_step = 2
+ if tangent_layer_index>=0:
+ prog_count += 1
+ task.set_slices(prog_count)
+
+ if tangent_layer_index>=0:
+ subtask = task.next_slice("Computing tangents")
+ self.split_vertices(self.find_uv_group, subtask, tangent_layer_index)
+ subtask = task.next_slice(self.tangent_uvtex)
+ self.compute_tangents(tangent_layer_index, subtask)