diff options
author | Kalle-Samuli Riihikoski <haikalle@gmail.com> | 2019-03-08 18:17:24 +0300 |
---|---|---|
committer | Kalle-Samuli Riihikoski <haikalle@gmail.com> | 2019-03-08 18:17:47 +0300 |
commit | 3d12701f3fbcdd339476fab60560acfab1366e42 (patch) | |
tree | 5e37d060cd01e057dd45266831880eb28afd3a47 | |
parent | e5e678198854d3ba62744120d10babf2592a5565 (diff) |
fix error if there is no uv-map in mesh.
-rw-r--r-- | io_coat3D/__init__.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/io_coat3D/__init__.py b/io_coat3D/__init__.py index 6b0e402b..8d3ded05 100644 --- a/io_coat3D/__init__.py +++ b/io_coat3D/__init__.py @@ -551,11 +551,9 @@ class SCENE_OT_export(bpy.types.Operator): for objec in bpy.context.selected_objects: delete_uvmaps = [] if objec.type == 'MESH': - for uv_layer in objec.data.uv_layers: - if(uv_layer.name.startswith('3DC_')): - delete_uvmaps.append(uv_layer.name) - for uv_name in delete_uvmaps: - objec.data.uv_layers.remove(objec.data.uv_layers[uv_name]) + if(len(objec.data.uv_layers) == 0): + objec.data.uv_layers.new(name='UVMap', do_init = False) + export_ok = True if (export_ok == False): return {'FINISHED'} @@ -952,7 +950,6 @@ class SCENE_OT_import(bpy.types.Operator): print('ONAME:',oname) if(objekti.coat3D.type): for proxy_objects in diff_objects: - print('tryis to found: ',proxy_objects) if (proxy_objects.startswith(objekti.coat3D.applink_name + '.')): obj_proxy = bpy.data.objects[proxy_objects] obj_proxy.coat3D.delete_proxy_mesh = True |