[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [1458] trunk/py/scripts/addons/ io_scene_fbx: bugfix for lamp export, rename operator setting to be in keeping with other exporters.

Campbell Barton ideasman42 at gmail.com
Thu Jan 20 22:59:13 CET 2011


Revision: 1458
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=1458
Author:   campbellbarton
Date:     2011-01-20 21:59:12 +0000 (Thu, 20 Jan 2011)
Log Message:
-----------
bugfix for lamp export, rename operator setting to be in keeping with other exporters.

Modified Paths:
--------------
    trunk/py/scripts/addons/io_scene_fbx/__init__.py
    trunk/py/scripts/addons/io_scene_fbx/export_fbx.py

Modified: trunk/py/scripts/addons/io_scene_fbx/__init__.py
===================================================================
--- trunk/py/scripts/addons/io_scene_fbx/__init__.py	2011-01-20 21:45:55 UTC (rev 1457)
+++ trunk/py/scripts/addons/io_scene_fbx/__init__.py	2011-01-20 21:59:12 UTC (rev 1458)
@@ -54,7 +54,7 @@
     # 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)

Modified: trunk/py/scripts/addons/io_scene_fbx/export_fbx.py
===================================================================
--- trunk/py/scripts/addons/io_scene_fbx/export_fbx.py	2011-01-20 21:45:55 UTC (rev 1457)
+++ trunk/py/scripts/addons/io_scene_fbx/export_fbx.py	2011-01-20 21:59:12 UTC (rev 1458)
@@ -250,7 +250,7 @@
 # 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,19 +1041,13 @@
         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
+            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'))
 
-        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
-
         scale = abs(GLOBAL_MATRIX.scale_part()[0])  # scale is always uniform in this case
 
         file.write('\n\t\t\tProperty: "LightType", "enum", "",%i' % light_type)
@@ -1896,9 +1890,9 @@
 
     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



More information about the Bf-extensions-cvs mailing list