[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11888] trunk/blender/release/scripts/ export_fbx.py: sync with stable

Campbell Barton cbarton at metavr.com
Wed Aug 29 21:53:49 CEST 2007


Revision: 11888
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11888
Author:   campbellbarton
Date:     2007-08-29 21:53:49 +0200 (Wed, 29 Aug 2007)

Log Message:
-----------
sync with stable

Modified Paths:
--------------
    trunk/blender/release/scripts/export_fbx.py

Modified: trunk/blender/release/scripts/export_fbx.py
===================================================================
--- trunk/blender/release/scripts/export_fbx.py	2007-08-29 19:47:28 UTC (rev 11887)
+++ trunk/blender/release/scripts/export_fbx.py	2007-08-29 19:53:49 UTC (rev 11888)
@@ -1412,13 +1412,9 @@
 			ReferenceInformationType: "Direct"
 			Normals: ''')
 		
-		# wont handle non uniform scaling properly
-		mtx_rot = my_mesh.matrixWorld.rotationPart()
-		
 		i=-1
-		
-		
 		if do_tx_write: # transform normals on write?
+			mtx_rot = my_mesh.matrixWorld.rotationPart()
 			for v in me.verts:
 				if i==-1:
 					file.write('%.15f,%.15f,%.15f' % tuple(v.no * mtx_rot));	i=0
@@ -1431,6 +1427,7 @@
 			
 		
 		else:	# same as above but has alredy been transformed
+			# wont handle non uniform scaling properly
 			for v in me.verts:
 				if i==-1:
 					file.write('%.15f,%.15f,%.15f' % tuple(v.no));	i=0
@@ -1868,7 +1865,7 @@
 							
 						if armob and armob not in ob_arms:
 							ob_arms.append(armob)
-							
+					
 					else:
 						blenParentBoneName = armob = None
 					
@@ -2151,7 +2148,7 @@
 			Property: "FrontAxisSign", "int", "",1
 			Property: "CoordAxis", "int", "",0
 			Property: "CoordAxisSign", "int", "",1
-			Property: "UnitScaleFactor", "double", "",1
+			Property: "UnitScaleFactor", "double", "",100
 		}
 	}
 ''')	
@@ -2322,7 +2319,10 @@
 	end =	render.eFrame
 	if end < start: start, end = end, start
 	
-	if ANIM_ENABLE and ob_bones: # at the moment can only export bone anim
+	# animations for these object types
+	ob_anim_lists = ob_bones, ob_meshes, ob_null, ob_cameras, ob_lights
+	
+	if ANIM_ENABLE and [tmp for tmp in ob_anim_lists if tmp]:
 		
 		frame_orig = Blender.Get('curframe')
 		
@@ -2402,9 +2402,15 @@
 					file.write('\n\tTake: "%s" {' % sane_takename(blenAction))
 					
 				tmp = blenAction.getFrameNumbers()
-				act_start =	min(tmp)
-				act_end =	max(tmp)
-				del tmp
+				if tmp:
+					act_start =	min(tmp)
+					act_end =	max(tmp)
+					del tmp
+				else:
+					# Fallback on this, theres not much else we can do? :/
+					# when an action has no length
+					act_start =	start
+					act_end =	end
 				
 				# Set the action active
 				for my_bone in ob_arms:
@@ -2432,7 +2438,7 @@
 			i = act_start
 			while i <= act_end:
 				Blender.Set('curframe', i)
-				for ob_generic in (ob_bones, ob_meshes, ob_null, ob_cameras, ob_lights):
+				for ob_generic in ob_anim_lists:
 					for my_ob in ob_generic:
 						#Blender.Window.RedrawAll()
 						if ob_generic == ob_meshes and my_ob.fbxArm:
@@ -2905,7 +2911,7 @@
 		if GLOBALS['EVENT'] == EVENT_FILESEL:
 			if GLOBALS['BATCH_ENABLE'].val:
 				txt = 'Batch FBX Dir'
-				name = ''
+				name = Blender.sys.expandpath('//')
 			else:
 				txt = 'Export FBX'
 				name = Blender.sys.makename(ext='.fbx')





More information about the Bf-blender-cvs mailing list