[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14168] trunk/blender/release/scripts/ flt_import.py: -> FLT importer hierarchy transform bugs
Geoffrey Bantle
hairbat at yahoo.com
Wed Mar 19 00:16:47 CET 2008
Revision: 14168
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14168
Author: briggs
Date: 2008-03-19 00:16:47 +0100 (Wed, 19 Mar 2008)
Log Message:
-----------
-> FLT importer hierarchy transform bugs
Several transform bugs in the flt importer have been fixed. This included
parent/child relationships and matrices not importing correctly along with
some problems with the import scale option.
Modified Paths:
--------------
trunk/blender/release/scripts/flt_import.py
Modified: trunk/blender/release/scripts/flt_import.py
===================================================================
--- trunk/blender/release/scripts/flt_import.py 2008-03-18 22:55:40 UTC (rev 14167)
+++ trunk/blender/release/scripts/flt_import.py 2008-03-18 23:16:47 UTC (rev 14168)
@@ -6,6 +6,8 @@
Tip: 'Import OpenFlight (.flt)'
"""
+
+
__author__ = "Greg MacDonald, Campbell Barton, Geoffrey Bantle"
__version__ = "2.0 11/21/07"
__url__ = ("blender", "elysiun", "Author's homepage, http://sourceforge.net/projects/blight/")
@@ -952,9 +954,13 @@
except: #horrible...
pass
+
if self.parent and self.parent.object and (self.header.scene == self.parent.header.scene):
- self.parent.object.makeParent([self.object])
+ self.parent.object.makeParent([self.object],1)
+ if self.matrix:
+ self.object.setMatrix(self.matrix)
+
if self.vis == False:
self.object.restrictDisplay = True
self.object.restrictRender = True
@@ -979,8 +985,6 @@
min= LODmin(min,lodlist[i])
min.vis = True
- if self.matrix:
- self.object.setMatrix(self.matrix)
Node.blender_import(self) # Attach faces to self.faceLs
@@ -1348,9 +1352,16 @@
except:
pass
+
+
+
if self.parent and self.parent.object:
- self.parent.object.makeParent([self.object])
+ self.parent.object.makeParent([self.object],1)
+ if self.matrix:
+ self.object.setMatrix(self.matrix)
+
+
#id props import
self.object.properties['FLT'] = dict()
for key in self.props:
@@ -1361,8 +1372,7 @@
self.object.Layer = current_layer
self.object.sel = 1
- if self.matrix:
- self.object.setMatrix(self.matrix)
+
Node.blender_import(self)
@@ -1902,7 +1912,7 @@
for child in childhash[root]:
fixscale(child,childhash)
location = Blender.Mathutils.Vector(root.getLocation('worldspace'))
- if location[0] != 0.0 and location[1] != 0.0 and location[2] != 0.0:
+ if location[0] != 0.0 or location[1] != 0.0 or location[2] != 0.0:
#direction = Blender.Mathutils.Vector(0-location[0],0-location[1],0-location[2]) #reverse vector
smat = Blender.Mathutils.ScaleMatrix(global_prefs['scale'],4)
root.setLocation(location * smat)
More information about the Bf-blender-cvs
mailing list