diff options
author | Kalle-Samuli Riihikoski <haikalle@gmail.com> | 2018-12-16 00:00:46 +0300 |
---|---|---|
committer | Kalle-Samuli Riihikoski <haikalle@gmail.com> | 2018-12-16 00:00:46 +0300 |
commit | 35eabf6bc319dd4447bc114a8d5adff4b6027ea2 (patch) | |
tree | 7fea414ba475dc879243e9b5ef95372d33607380 /io_coat3D | |
parent | 9ba0709f18d55e2b9d5c6c772a9f9d4fcf1b5acc (diff) |
fix double click bug
Diffstat (limited to 'io_coat3D')
-rw-r--r-- | io_coat3D/__init__.py | 23 | ||||
-rw-r--r-- | io_coat3D/tex.py | 3 |
2 files changed, 14 insertions, 12 deletions
diff --git a/io_coat3D/__init__.py b/io_coat3D/__init__.py index 214f3b20..7c16e22a 100644 --- a/io_coat3D/__init__.py +++ b/io_coat3D/__init__.py @@ -618,6 +618,12 @@ class SCENE_OT_import(bpy.types.Operator): obj_proxy.coat3D.delete_proxy_mesh = True found_obj = True + mat_list = [] + if (objekti.material_slots): + act_mat = objekti.active_material + for obj_mat in objekti.material_slots: + mat_list.append(obj_mat.material) + if(found_obj == True): exportfile = coat3D.exchangedir path3b_n = coat3D.exchangedir @@ -638,11 +644,8 @@ class SCENE_OT_import(bpy.types.Operator): export_file.close() coat3D.remove_path = True - mat_list = [] - if(objekti.material_slots): - act_mat = objekti.active_material - for obj_mat in objekti.material_slots: - mat_list.append(obj_mat.material) + + bpy.ops.object.select_all(action='DESELECT') obj_proxy.select_set(True) @@ -699,13 +702,13 @@ class SCENE_OT_import(bpy.types.Operator): coat3D.importmesh = False objekti.select_set(True) - if(coat3D.importtextures): - is_new = False - tex.matlab(objekti,mat_list,texturelist,is_new) - objekti.select_set(False) + if(coat3D.importtextures): + is_new = False + tex.matlab(objekti,mat_list,texturelist,is_new) + objekti.select_set(False) else: + print('JAAKO TAHAN KOHTAAN 2') mat_list = [] - if (objekti.material_slots): for obj_mat in objekti.material_slots: mat_list.append(obj_mat.material) diff --git a/io_coat3D/tex.py b/io_coat3D/tex.py index ffc6c6dc..7af4d68e 100644 --- a/io_coat3D/tex.py +++ b/io_coat3D/tex.py @@ -85,7 +85,6 @@ def readtexturefolder(objekti, mat_list, texturelist, is_new): #read textures fr if texture_info[2].startswith('displacement'): texcoat['displacement'].append(texture_info[3]) create_nodes = True - if(create_nodes): coat3D = bpy.context.scene.coat3D path3b_n = coat3D.exchangedir @@ -137,7 +136,7 @@ def createnodes(active_mat,texcoat): # Cretes new nodes and link textures into t applink_tree = node break - + print('TeXture UPDATE happens') for node in act_material.nodes: if(node.type == 'TEX_IMAGE'): if(node.name == '3DC_color'): |