[Bf-extensions-cvs] [827b992e] blender2.8: added support for multi-uv sets.

Kalle-Samuli Riihikoski noreply at git.blender.org
Tue Sep 4 10:02:18 CEST 2018


Commit: 827b992e55b5cf3ebea1124cbfd84fe2fa0ce5f5
Author: Kalle-Samuli Riihikoski
Date:   Tue Sep 4 11:00:36 2018 +0300
Branches: blender2.8
https://developer.blender.org/rBA827b992e55b5cf3ebea1124cbfd84fe2fa0ce5f5

added support for multi-uv sets.

===================================================================

M	io_coat3D/__init__.py

===================================================================

diff --git a/io_coat3D/__init__.py b/io_coat3D/__init__.py
index 083367f2..c494e79c 100644
--- a/io_coat3D/__init__.py
+++ b/io_coat3D/__init__.py
@@ -195,7 +195,26 @@ def updatemesh(objekti, proxy):
         bpy.ops.object.vertex_group_copy_to_selected()
         bpy.ops.object.select_all(action='DESELECT')
 
+
     '''
+    # UV Copy gives an error at this point
+    proxy.select_set('SELECT')
+    objekti.select_set('SELECT')
+
+    if len(objekti.data.uv_layers) > 1:
+        index = 0
+        for uv_layer in objekti.data.uv_layers:
+            if (uv_layer != objekti.data.uv_layers[0]):
+                proxy.data.uv_layers.new(uv_layer.name)
+                proxy.data.uv_layers.active_index = index
+                objekti.data.uv_layers.active_index = index
+                bpy.ops.object.join_uvs()
+            index += 1
+
+    bpy.ops.object.select_all(action='DESELECT')
+
+    #Mesh Copy
+
     proxy.select_set('SELECT')
     obj_data = objekti.data.id_data
     objekti.data = proxy.data.id_data
@@ -203,6 +222,8 @@ def updatemesh(objekti, proxy):
     if (bpy.data.meshes[obj_data.name].users == 0):
         bpy.data.meshes.remove(obj_data)
 
+
+
 class SCENE_PT_Main(bpy.types.Panel):
     bl_label = "3D-Coat Applink"
     bl_space_type = "VIEW_3D"
@@ -308,9 +329,9 @@ class SCENE_OT_opencoat(bpy.types.Operator):
                 file.write("\n[3B]")
                 file.close()
 
-        ''' 
-        If not Windows Os it will only write import.txt. Auto run 3d-coat.exe is disabled. 
-        '''
+                ''' 
+                If not Windows Os it will only write import.txt. Auto run 3d-coat.exe is disabled. 
+                '''
 
         else:
             importfile = bpy.context.scene.coat3D.exchangedir



More information about the Bf-extensions-cvs mailing list