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:
authorBastien Montagne <montagne29@wanadoo.fr>2017-01-17 14:31:58 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2017-01-17 14:31:58 +0300
commita746a84f8aaf3a4843eb3f4ce3f5a0464872077a (patch)
tree598f6784f6d692cf954a21f2f2e4bef07853da7c /io_scene_obj
parent18099be5f837a3141f7150fdc6c068e297b7da47 (diff)
Fix T50453: Add option to OBJ export to apply render or preview modifiers.
Diffstat (limited to 'io_scene_obj')
-rw-r--r--io_scene_obj/__init__.py9
-rw-r--r--io_scene_obj/export_obj.py8
2 files changed, 14 insertions, 3 deletions
diff --git a/io_scene_obj/__init__.py b/io_scene_obj/__init__.py
index daeed232..b0ff12c3 100644
--- a/io_scene_obj/__init__.py
+++ b/io_scene_obj/__init__.py
@@ -21,7 +21,7 @@
bl_info = {
"name": "Wavefront OBJ format",
"author": "Campbell Barton, Bastien Montagne",
- "version": (2, 3, 1),
+ "version": (2, 3, 2),
"blender": (2, 77, 0),
"location": "File > Import-Export",
"description": "Import-Export OBJ, Import OBJ mesh, UV's, materials and textures",
@@ -201,9 +201,14 @@ class ExportOBJ(bpy.types.Operator, ExportHelper, IOOBJOrientationHelper):
# object group
use_mesh_modifiers = BoolProperty(
name="Apply Modifiers",
- description="Apply modifiers (preview resolution)",
+ description="Apply modifiers",
default=True,
)
+ use_mesh_modifiers_render = BoolProperty(
+ name="Use Modifiers Render Settings",
+ description="Use render settings when applying modifiers to mesh objects",
+ default=False,
+ )
# extra data group
use_edges = BoolProperty(
diff --git a/io_scene_obj/export_obj.py b/io_scene_obj/export_obj.py
index 803191f3..a94080c7 100644
--- a/io_scene_obj/export_obj.py
+++ b/io_scene_obj/export_obj.py
@@ -280,6 +280,7 @@ def write_file(filepath, objects, scene,
EXPORT_UV=True,
EXPORT_MTL=True,
EXPORT_APPLY_MODIFIERS=True,
+ EXPORT_APPLY_MODIFIERS_RENDER=False,
EXPORT_BLEN_OBS=True,
EXPORT_GROUP_BY_OB=False,
EXPORT_GROUP_BY_MAT=False,
@@ -387,7 +388,8 @@ def write_file(filepath, objects, scene,
# END NURBS
try:
- me = ob.to_mesh(scene, EXPORT_APPLY_MODIFIERS, 'PREVIEW', calc_tessface=False)
+ me = ob.to_mesh(scene, EXPORT_APPLY_MODIFIERS, calc_tessface=False,
+ settings='RENDER' if EXPORT_APPLY_MODIFIERS_RENDER else 'PREVIEW')
except RuntimeError:
me = None
@@ -720,6 +722,7 @@ def _write(context, filepath,
EXPORT_UV, # ok
EXPORT_MTL,
EXPORT_APPLY_MODIFIERS, # ok
+ EXPORT_APPLY_MODIFIERS_RENDER, # ok
EXPORT_BLEN_OBS,
EXPORT_GROUP_BY_OB,
EXPORT_GROUP_BY_MAT,
@@ -776,6 +779,7 @@ def _write(context, filepath,
EXPORT_UV,
EXPORT_MTL,
EXPORT_APPLY_MODIFIERS,
+ EXPORT_APPLY_MODIFIERS_RENDER,
EXPORT_BLEN_OBS,
EXPORT_GROUP_BY_OB,
EXPORT_GROUP_BY_MAT,
@@ -810,6 +814,7 @@ def save(context,
use_uvs=True,
use_materials=True,
use_mesh_modifiers=True,
+ use_mesh_modifiers_render=False,
use_blen_objects=True,
group_by_object=False,
group_by_material=False,
@@ -831,6 +836,7 @@ def save(context,
EXPORT_UV=use_uvs,
EXPORT_MTL=use_materials,
EXPORT_APPLY_MODIFIERS=use_mesh_modifiers,
+ EXPORT_APPLY_MODIFIERS_RENDER=use_mesh_modifiers_render,
EXPORT_BLEN_OBS=use_blen_objects,
EXPORT_GROUP_BY_OB=group_by_object,
EXPORT_GROUP_BY_MAT=group_by_material,