提交 c72e0c27 编写于 作者: R Ricardo Cabello

Merge pull request #6535 from tschw/Blender_misc_fixes

Blender misc fixes
......@@ -604,7 +604,7 @@ class ExportThree(bpy.types.Operator, ExportHelper):
name="Type",
description="Geometry type",
items=_geometry_types()[1:],
default=constants.GEOMETRY)
default=constants.EXPORT_OPTIONS[constants.GEOMETRY_TYPE])
option_export_scene = BoolProperty(
name="Scene",
......
......@@ -384,7 +384,10 @@ def _valid_textures(material, strict_use=True):
in_use = texture.use
else:
in_use = True
if texture.texture.type != IMAGE or not in_use:
if not in_use:
continue
if not texture.texture or texture.texture.type != IMAGE:
logger.warning("Unable to export non-image texture %s", texture)
continue
logger.debug("Valid texture found %s", texture)
yield texture
......@@ -330,6 +330,8 @@ def extract_mesh(obj, options, recalculate=False):
"""
logger.debug('object.extract_mesh(%s, %s)', obj, options)
apply_modifiers = options.get(constants.APPLY_MODIFIERS, True)
if apply_modifiers:
bpy.ops.object.mode_set(mode='OBJECT')
mesh_node = obj.to_mesh(context.scene, apply_modifiers, RENDER)
# transfer the geometry type to the extracted mesh
......@@ -350,6 +352,7 @@ def extract_mesh(obj, options, recalculate=False):
original_mesh.name,
mesh_node.name)
bpy.ops.object.mode_set(mode='OBJECT')
obj.select = True
bpy.context.scene.objects.active = obj
logger.info('Applying triangulation to %s', obj.data.name)
......
......@@ -299,7 +299,7 @@ class Geometry(base_classes.BaseNode):
metadata[key] = len(array)/size
def _geometry_metadata(self, metadata):
"""Three.Geometry metadat
"""Three.Geometry metadata
:rtype: dict
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册