提交 e0d9e360 编写于 作者: R rkusa

Blender: add option to disable modifier application

上级 25ffb41e
...@@ -301,6 +301,10 @@ def restore_export_settings(properties, settings): ...@@ -301,6 +301,10 @@ def restore_export_settings(properties, settings):
constants.INFLUENCES_PER_VERTEX, constants.INFLUENCES_PER_VERTEX,
constants.EXPORT_OPTIONS[constants.INFLUENCES_PER_VERTEX]) constants.EXPORT_OPTIONS[constants.INFLUENCES_PER_VERTEX])
properties.option_apply_modifiers = settings.get(
constants.APPLY_MODIFIERS,
constants.EXPORT_OPTIONS[constants.APPLY_MODIFIERS])
properties.option_geometry_type = settings.get( properties.option_geometry_type = settings.get(
constants.GEOMETRY_TYPE, constants.GEOMETRY_TYPE,
constants.EXPORT_OPTIONS[constants.GEOMETRY_TYPE]) constants.EXPORT_OPTIONS[constants.GEOMETRY_TYPE])
...@@ -424,6 +428,7 @@ def set_settings(properties): ...@@ -424,6 +428,7 @@ def set_settings(properties):
constants.NORMALS: properties.option_normals, constants.NORMALS: properties.option_normals,
constants.SKINNING: properties.option_skinning, constants.SKINNING: properties.option_skinning,
constants.BONES: properties.option_bones, constants.BONES: properties.option_bones,
constants.APPLY_MODIFIERS: properties.option_apply_modifiers,
constants.GEOMETRY_TYPE: properties.option_geometry_type, constants.GEOMETRY_TYPE: properties.option_geometry_type,
constants.MATERIALS: properties.option_materials, constants.MATERIALS: properties.option_materials,
...@@ -555,6 +560,12 @@ class ExportThree(bpy.types.Operator, ExportHelper): ...@@ -555,6 +560,12 @@ class ExportThree(bpy.types.Operator, ExportHelper):
description="Export bones", description="Export bones",
default=constants.EXPORT_OPTIONS[constants.BONES]) default=constants.EXPORT_OPTIONS[constants.BONES])
option_apply_modifiers = BoolProperty(
name="Apply Modifiers",
description="Apply Modifiers to mesh objects",
default=constants.EXPORT_OPTIONS[constants.APPLY_MODIFIERS]
)
option_scale = FloatProperty( option_scale = FloatProperty(
name="Scale", name="Scale",
description="Scale vertices", description="Scale vertices",
...@@ -751,6 +762,9 @@ class ExportThree(bpy.types.Operator, ExportHelper): ...@@ -751,6 +762,9 @@ class ExportThree(bpy.types.Operator, ExportHelper):
row.prop(self.properties, 'option_bones') row.prop(self.properties, 'option_bones')
row.prop(self.properties, 'option_skinning') row.prop(self.properties, 'option_skinning')
row = layout.row()
row.prop(self.properties, 'option_apply_modifiers')
row = layout.row() row = layout.row()
row.prop(self.properties, 'option_geometry_type') row.prop(self.properties, 'option_geometry_type')
......
...@@ -44,6 +44,7 @@ FACES = 'faces' ...@@ -44,6 +44,7 @@ FACES = 'faces'
NORMALS = 'normals' NORMALS = 'normals'
BONES = 'bones' BONES = 'bones'
UVS = 'uvs' UVS = 'uvs'
APPLY_MODIFIERS = 'applyModifiers'
COLORS = 'colors' COLORS = 'colors'
MIX_COLORS = 'mixColors' MIX_COLORS = 'mixColors'
SCALE = 'scale' SCALE = 'scale'
...@@ -95,6 +96,7 @@ EXPORT_OPTIONS = { ...@@ -95,6 +96,7 @@ EXPORT_OPTIONS = {
VERTICES: True, VERTICES: True,
NORMALS: True, NORMALS: True,
UVS: True, UVS: True,
APPLY_MODIFIERS: True,
COLORS: False, COLORS: False,
MATERIALS: False, MATERIALS: False,
FACE_MATERIALS: False, FACE_MATERIALS: False,
......
...@@ -329,7 +329,8 @@ def extract_mesh(obj, options, recalculate=False): ...@@ -329,7 +329,8 @@ def extract_mesh(obj, options, recalculate=False):
""" """
logger.debug('object.extract_mesh(%s, %s)', obj, options) logger.debug('object.extract_mesh(%s, %s)', obj, options)
mesh_node = obj.to_mesh(context.scene, True, RENDER) apply_modifiers = options.get(constants.APPLY_MODIFIERS, True)
mesh_node = obj.to_mesh(context.scene, apply_modifiers, RENDER)
# transfer the geometry type to the extracted mesh # transfer the geometry type to the extracted mesh
mesh_node.THREE_geometry_type = obj.data.THREE_geometry_type mesh_node.THREE_geometry_type = obj.data.THREE_geometry_type
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册