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:
authorCampbell Barton <ideasman42@gmail.com>2009-04-15 11:00:11 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-04-15 11:00:11 +0400
commit34a617e3084708f938e9b41489405c3ca30421f8 (patch)
tree7db42d7e70c6fe5701d799d410de0813bc02d364 /release/scripts
parentefb7dd86ff001efe26fba1caef70a87806d138f6 (diff)
[#7789] 3DS Import , Mesh not correct since Blender 2.44
There is a problem importing 3ds files where I cant find a way to check if the transforms are applied to the vertex locations or not. Since 2.44 I made the importer assume they were not since you can manually remove transformations, but not reverse. Nevertheless most 3ds files have the matrix applied, better not give a bad import by default. Did some research and other 3ds importers (lib3ds for eg), have the same problem and just assume the transformations applied. 3dsMax imports both correctly so there must be a way to tell but I could not link it to the 3ds version or other mesh options. Added an option to workaround this problem in rare cases where its needed. - KX_GameObject.cpp & KX_Scene.cpp, clear the dict before removing the reference in case there is a circular reference.
Diffstat (limited to 'release/scripts')
-rw-r--r--release/scripts/3ds_import.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/release/scripts/3ds_import.py b/release/scripts/3ds_import.py
index 028b9633606..1963d2e7433 100644
--- a/release/scripts/3ds_import.py
+++ b/release/scripts/3ds_import.py
@@ -844,11 +844,13 @@ def load_3ds(filename, PREF_UI= True):
# IMPORT_AS_INSTANCE= Blender.Draw.Create(0)
IMPORT_CONSTRAIN_BOUNDS= Blender.Draw.Create(10.0)
IMAGE_SEARCH= Blender.Draw.Create(1)
+ APPLY_MATRIX= Blender.Draw.Create(0)
# Get USER Options
pup_block= [\
('Size Constraint:', IMPORT_CONSTRAIN_BOUNDS, 0.0, 1000.0, 'Scale the model by 10 until it reacehs the size constraint. Zero Disables.'),\
('Image Search', IMAGE_SEARCH, 'Search subdirs for any assosiated images (Warning, may be slow)'),\
+ ('Transform Fix', APPLY_MATRIX, 'Workaround for object transformations importing incorrectly'),\
#('Group Instance', IMPORT_AS_INSTANCE, 'Import objects into a new scene and group, creating an instance in the current scene.'),\
]
@@ -861,6 +863,7 @@ def load_3ds(filename, PREF_UI= True):
IMPORT_CONSTRAIN_BOUNDS= IMPORT_CONSTRAIN_BOUNDS.val
# IMPORT_AS_INSTANCE= IMPORT_AS_INSTANCE.val
IMAGE_SEARCH = IMAGE_SEARCH.val
+ APPLY_MATRIX = APPLY_MATRIX.val
if IMPORT_CONSTRAIN_BOUNDS:
BOUNDS_3DS[:]= [1<<30, 1<<30, 1<<30, -1<<30, -1<<30, -1<<30]
@@ -887,6 +890,8 @@ def load_3ds(filename, PREF_UI= True):
if ob.type=='Mesh':
me= ob.getData(mesh=1)
me.verts.delete([me.verts[0],])
+ if not APPLY_MATRIX:
+ me.transform(ob.matrixWorld.copy().invert())
# Done DUMMYVERT
"""