You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
print("The second UV layer "+str(obj_uv_layers[1].name) +" of object "+str(obj.name) +" should be named "+LIGHTMAP_LAYER_NAME+" for Hubs and is reserved for the lightmap, all the layers >1 are ignored.")
711
+
# The new layer is the last in the list and a full copy of the active one.
712
+
# The changed order is no problem in Blender where UV layers are mostly indexed by name
713
+
# Only when exporting to game engines the order matters, but most game engines have the lightmap on UV layer 1
714
+
# Blender is creating the names of duplicated layers with a suffix .001
715
+
# This needs to be avoided because otherwise existing setups cannot access it anymore
716
+
second_layer_name=obj_uv_layers[1].name
717
+
obj_uv_layers[1].name=LIGHTMAP_LAYER_NAME
718
+
obj_uv_layers.active=obj_uv_layers[1]
719
+
obj_uv_layers.new(name=second_layer_name)
720
+
715
721
# The layer for the lightmap needs to be the active one before lightmap packing
0 commit comments