Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Bantle <hairbat@yahoo.com>2008-03-19 02:16:47 +0300
committerGeoffrey Bantle <hairbat@yahoo.com>2008-03-19 02:16:47 +0300
commit7015700e99385cb3170d4ff6c8a44fa48615c649 (patch)
tree64137e36d267b5803a117bb96455a660e0b2b0a8 /release
parent34c4ac219caa67d591ae28008676013fd4348ea5 (diff)
-> 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.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/flt_import.py24
1 files changed, 17 insertions, 7 deletions
diff --git a/release/scripts/flt_import.py b/release/scripts/flt_import.py
index 3ba118c0d18..5b1909658b1 100644
--- a/release/scripts/flt_import.py
+++ b/release/scripts/flt_import.py
@@ -6,6 +6,8 @@ Group: 'Import'
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,8 +954,12 @@ class InterNode(Node):
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
@@ -979,8 +985,6 @@ class InterNode(Node):
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,8 +1352,15 @@ class XRef(InterNode):
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()
@@ -1361,8 +1372,7 @@ class XRef(InterNode):
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 @@ def fixscale(root,childhash):
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)