Skip to content
This repository has been archived by the owner on Nov 10, 2024. It is now read-only.

Commit

Permalink
avoid naming issue
Browse files Browse the repository at this point in the history
close #72
  • Loading branch information
Vinc3r committed Sep 21, 2020
1 parent 72cdc20 commit a80c593
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Binary file modified _testFiles_/testFile-blender2.8.blend
Binary file not shown.
9 changes: 9 additions & 0 deletions retico/uvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,17 @@ def rename_uv_channels():
# function core
for obj in objects_selected:
mesh = obj.data
# no uv
if len(mesh.uv_layers) < 0:
continue
# only one uv chan
if len(mesh.uv_layers) == 1:
mesh.uv_layers[0].name = "UVMap"
continue
# if many chans, to avoid naming issue we have to use a tmp name first
for uv_chan in range(len(mesh.uv_layers)):
mesh.uv_layers[uv_chan].name = "tempName"
# now we can use a clean naming
for uv_chan in range(len(mesh.uv_layers)):
if uv_chan == 0:
mesh.uv_layers[0].name = "UVMap"
Expand Down

0 comments on commit a80c593

Please sign in to comment.