Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Rachinskiy <mikhail.rachinskiy@gmail.com>2019-09-18 16:14:08 +0300
committerMikhail Rachinskiy <mikhail.rachinskiy@gmail.com>2019-09-18 16:14:21 +0300
commit9f7b301a9b0ac97de56854dec81d7be5f8900e12 (patch)
tree0faaa69a6f7b88da300b7ab0664e63ec833ebf09 /object_print3d_utils/export.py
parent11fdc251a15310aae74f7eb981e45d631d11e080 (diff)
Print3D: PEP8 cleanup
Diffstat (limited to 'object_print3d_utils/export.py')
-rw-r--r--object_print3d_utils/export.py69
1 files changed, 35 insertions, 34 deletions
diff --git a/object_print3d_utils/export.py b/object_print3d_utils/export.py
index 9a9afb3a..5e9b71c0 100644
--- a/object_print3d_utils/export.py
+++ b/object_print3d_utils/export.py
@@ -65,7 +65,6 @@ def write_mesh(context, info, report_cb):
path_mode = 'COPY' if print_3d.use_export_texture else 'AUTO'
context_override = context.copy()
-
obj_tmp = None
# PLY can only export single mesh objects!
@@ -90,6 +89,7 @@ def write_mesh(context, info, report_cb):
name = os.path.splitext(name)[0]
else:
name = "untitled"
+
# add object name
name += "-%s" % bpy.path.clean_name(obj.name)
@@ -118,55 +118,55 @@ def write_mesh(context, info, report_cb):
addon_ensure("io_mesh_stl")
filepath = bpy.path.ensure_ext(filepath, ".stl")
ret = bpy.ops.export_mesh.stl(
- context_override,
- filepath=filepath,
- ascii=False,
- use_mesh_modifiers=True,
- use_selection=True,
- global_scale=global_scale,
- )
+ context_override,
+ filepath=filepath,
+ ascii=False,
+ use_mesh_modifiers=True,
+ use_selection=True,
+ global_scale=global_scale,
+ )
elif export_format == 'PLY':
addon_ensure("io_mesh_ply")
filepath = bpy.path.ensure_ext(filepath, ".ply")
ret = bpy.ops.export_mesh.ply(
- context_override,
- filepath=filepath,
- use_mesh_modifiers=True,
- global_scale=global_scale,
- )
+ context_override,
+ filepath=filepath,
+ use_mesh_modifiers=True,
+ global_scale=global_scale,
+ )
elif export_format == 'X3D':
addon_ensure("io_scene_x3d")
filepath = bpy.path.ensure_ext(filepath, ".x3d")
ret = bpy.ops.export_scene.x3d(
- context_override,
- filepath=filepath,
- use_mesh_modifiers=True,
- use_selection=True,
- path_mode=path_mode,
- global_scale=global_scale,
- )
+ context_override,
+ filepath=filepath,
+ use_mesh_modifiers=True,
+ use_selection=True,
+ path_mode=path_mode,
+ global_scale=global_scale,
+ )
elif export_format == 'WRL':
addon_ensure("io_scene_vrml2")
filepath = bpy.path.ensure_ext(filepath, ".wrl")
ret = bpy.ops.export_scene.vrml2(
- context_override,
- filepath=filepath,
- use_mesh_modifiers=True,
- use_selection=True,
- path_mode=path_mode,
- global_scale=global_scale,
- )
+ context_override,
+ filepath=filepath,
+ use_mesh_modifiers=True,
+ use_selection=True,
+ path_mode=path_mode,
+ global_scale=global_scale,
+ )
elif export_format == 'OBJ':
addon_ensure("io_scene_obj")
filepath = bpy.path.ensure_ext(filepath, ".obj")
ret = bpy.ops.export_scene.obj(
- context_override,
- filepath=filepath,
- use_mesh_modifiers=True,
- use_selection=True,
- path_mode=path_mode,
- global_scale=global_scale,
- )
+ context_override,
+ filepath=filepath,
+ use_mesh_modifiers=True,
+ use_selection=True,
+ path_mode=path_mode,
+ global_scale=global_scale,
+ )
else:
assert 0
@@ -186,6 +186,7 @@ def write_mesh(context, info, report_cb):
# restore context
for ob in context_backup["selected_objects"]:
ob.select_set(True)
+
layer.objects.active = context_backup["active_object"]
if 'FINISHED' in ret: