diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-01-21 00:59:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-01-21 00:59:12 +0300 |
commit | 04768630761ef536306b831395e354c9d13fa884 (patch) | |
tree | 3b7be984b99b1cb69b35cfe9aa495e6554373ed5 /io_scene_fbx | |
parent | c8aad9e989447b1d1aed41ee6af2232d82ae09e9 (diff) |
bugfix for lamp export, rename operator setting to be in keeping with other exporters.
Diffstat (limited to 'io_scene_fbx')
-rw-r--r-- | io_scene_fbx/__init__.py | 2 | ||||
-rw-r--r-- | io_scene_fbx/export_fbx.py | 22 |
2 files changed, 9 insertions, 15 deletions
diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py index a0544e44..b04289d4 100644 --- a/io_scene_fbx/__init__.py +++ b/io_scene_fbx/__init__.py @@ -54,7 +54,7 @@ class ExportFBX(bpy.types.Operator, ExportHelper): # List of operator properties, the attributes will be assigned # to the class instance from the operator settings before calling. - EXP_OBS_SELECTED = BoolProperty(name="Selected Objects", description="Export selected objects on visible layers", default=True) + use_selection = BoolProperty(name="Selected Objects", description="Export selected objects on visible layers", default=True) # EXP_OBS_SCENE = BoolProperty(name="Scene Objects", description="Export all objects in this scene", default=True) TX_SCALE = FloatProperty(name="Scale", description="Scale all data, (Note! some imports dont support scaled armatures)", min=0.01, max=1000.0, soft_min=0.01, soft_max=1000.0, default=1.0) TX_XROT90 = BoolProperty(name="Rot X90", description="Rotate all objects 90 degrees about the X axis", default=True) diff --git a/io_scene_fbx/export_fbx.py b/io_scene_fbx/export_fbx.py index 40cac6dd..1971d63c 100644 --- a/io_scene_fbx/export_fbx.py +++ b/io_scene_fbx/export_fbx.py @@ -250,7 +250,7 @@ header_comment = \ # This func can be called with just the filepath def save(operator, context, filepath="", GLOBAL_MATRIX=None, - EXP_OBS_SELECTED=True, + use_selection=True, EXP_MESH=True, EXP_MESH_APPLY_MOD=True, EXP_ARMATURE=True, @@ -1041,18 +1041,12 @@ def save(operator, context, filepath="", if light_type > 2: light_type = 1 # hemi and area lights become directional -# mode = light.mode - if light.shadow_method == 'RAY_SHADOW' or light.shadow_method == 'BUFFER_SHADOW': -# if mode & Blender.Lamp.Modes.RayShadow or mode & Blender.Lamp.Modes.Shadows: - do_shadow = 1 + if light.type in ('HEMI', ): + do_light = not (light.use_diffuse or light.use_specular) + do_shadow = False else: - do_shadow = 0 - - if light.use_only_shadow or (not light.use_diffuse and not light.use_specular): -# if mode & Blender.Lamp.Modes.OnlyShadow or (mode & Blender.Lamp.Modes.NoDiffuse and mode & Blender.Lamp.Modes.NoSpecular): - do_light = 0 - else: - do_light = 1 + do_light = not (light.use_only_shadow or (not light.use_diffuse and not light.use_specular)) + do_shadow = (light.shadow_method in ('RAY_SHADOW', 'BUFFER_SHADOW')) scale = abs(GLOBAL_MATRIX.scale_part()[0]) # scale is always uniform in this case @@ -1896,9 +1890,9 @@ def save(operator, context, filepath="", tmp_ob_type = ob_type = None # incase no objects are exported, so as not to raise an error - # if EXP_OBS_SELECTED is false, use sceens objects + # if use_selection is false, use sceens objects if not batch_objects: - if EXP_OBS_SELECTED: + if use_selection: tmp_objects = context.selected_objects else: tmp_objects = scene.objects |