diff options
author | Kalle-Samuli Riihikoski <haikalle@gmail.com> | 2010-12-10 23:55:45 +0300 |
---|---|---|
committer | Kalle-Samuli Riihikoski <haikalle@gmail.com> | 2010-12-10 23:55:45 +0300 |
commit | 170f717a127b6aefc13781a4b61652c4581acb90 (patch) | |
tree | 0efb567fb8a4d53dd9d6b4e88020fef03a7605b7 /io_coat3D | |
parent | e3deb2efa13f3f030fab6a3830eb688ecf6bcf38 (diff) |
Fixed position change bug.
Diffstat (limited to 'io_coat3D')
-rw-r--r-- | io_coat3D/__init__.py | 1 | ||||
-rw-r--r-- | io_coat3D/coat.py | 44 |
2 files changed, 22 insertions, 23 deletions
diff --git a/io_coat3D/__init__.py b/io_coat3D/__init__.py index df8d5579..53694a1e 100644 --- a/io_coat3D/__init__.py +++ b/io_coat3D/__init__.py @@ -50,6 +50,7 @@ def register(): bpy.coat3D['status'] = 0 bpy.coat3D['was'] = '' bpy.coat3D['exchange'] = '' + bpy.coat3D['export_off'] = 0 class coat3D(bpy.types.IDPropertyGroup): pass diff --git a/io_coat3D/coat.py b/io_coat3D/coat.py index 3ba1a46f..6e9cad3d 100644 --- a/io_coat3D/coat.py +++ b/io_coat3D/coat.py @@ -190,6 +190,7 @@ class SCENE_OT_export(bpy.types.Operator): def invoke(self, context, event): checkname = '' coat3D = bpy.context.scene.coat3D + coat = bpy.coat3D scene = context.scene coat3D.export_on = False activeobj = bpy.context.active_object.name @@ -208,30 +209,21 @@ class SCENE_OT_export(bpy.types.Operator): checkname += ('%s.obj'%(activeobj)) if(not(os.path.isfile(checkname)) or coat3D.exportover): - if(coat3D.export_pos): - - bpy.ops.export_scene.obj(filepath=checkname,use_selection=True, - use_modifiers=coat3D.exportmod,use_blen_objects=False, group_by_material= True, - use_materials = False,keep_vertex_order = True) + - coat3D.export_on = True - else: - coat3D.loca = obj.location - coat3D.rota = obj.rotation_euler - coat3D.scal = obj.scale - obj.location = (0,0,0) - obj.rotation_euler = (0,0,0) - obj.scale = (1,1,1) - - bpy.ops.export_scene.obj(filepath=checkname,use_selection=True, - use_modifiers=coat3D.exportmod,use_blen_objects=False, group_by_material= True, - use_materials = False,keep_vertex_order = True) - - obj.location = coat3D.loca - obj.rotation_euler = coat3D.rota - obj.scale = coat3D.scal - coat3D.export_on = True - + bpy.ops.export_scene.obj(filepath=checkname,use_selection=True, + use_modifiers=coat3D.exportmod,use_blen_objects=False, group_by_material= True, + use_materials = False,keep_vertex_order = True) + coat3D.export_on = True + + if(not(coat3D.exportover)): + coat3D.loca = obj.location + coat3D.rota = obj.rotation_euler + coat3D.scal = obj.scale + coat['export_off'] = 1 + else: + coat['export_off'] = 0 + if(coat3D.exportfile == False): @@ -377,6 +369,12 @@ class SCENE_OT_import(bpy.types.Operator): if(coat3D.importtextures): export = '' tex.gettex(mat_list,objekti,scene,export) + + if(coat['export_off']): + objekti.location = coat3D.loca + objekti.rotation_euler = coat3D.rota + objekti.scale = coat3D.scal + coat['export_off'] = 0 return('FINISHED') |