[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30789] trunk/blender/release/scripts/io/ import_scene_3ds.py: bugfix [#21407] 3DS Import do not show import options (resizing\transform fix)

Campbell Barton ideasman42 at gmail.com
Tue Jul 27 04:41:34 CEST 2010


Revision: 30789
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30789
Author:   campbellbarton
Date:     2010-07-27 04:41:30 +0200 (Tue, 27 Jul 2010)

Log Message:
-----------
bugfix [#21407] 3DS Import do not show import options (resizing\transform fix)

Modified Paths:
--------------
    trunk/blender/release/scripts/io/import_scene_3ds.py

Modified: trunk/blender/release/scripts/io/import_scene_3ds.py
===================================================================
--- trunk/blender/release/scripts/io/import_scene_3ds.py	2010-07-27 01:35:39 UTC (rev 30788)
+++ trunk/blender/release/scripts/io/import_scene_3ds.py	2010-07-27 02:41:30 UTC (rev 30789)
@@ -883,15 +883,13 @@
 
     # REMOVE DUMMYVERT, - remove this in the next release when blenders internal are fixed.
 
+    for ob in importedObjects:
+        if ob.type == 'MESH':
+            me = ob.data
+#           me.verts.delete([me.verts[0],]) # XXX, todo
+            if not APPLY_MATRIX:
+                me.transform(ob.matrix_world.copy().invert())
 
-# 	for ob in importedObjects:
-# 		if ob.type == 'MESH':
-# # 		if ob.type=='Mesh':
-# 			me = ob.getData(mesh=1)
-# 			me.verts.delete([me.verts[0],])
-# 			if not APPLY_MATRIX:
-# 				me.transform(ob.matrix_world.copy().invert())
-
     # Done DUMMYVERT
     """
     if IMPORT_AS_INSTANCE:
@@ -1009,15 +1007,19 @@
 
     # List of operator properties, the attributes will be assigned
     # to the class instance from the operator settings before calling.
-
     filepath = StringProperty(name="File Path", description="Filepath used for importing the 3DS file", maxlen= 1024, default= "")
 
-# 	size_constraint = FloatProperty(name="Size Constraint", description="Scale the model by 10 until it reacehs the size constraint. Zero Disables.", min=0.0, max=1000.0, soft_min=0.0, soft_max=1000.0, default=10.0),
-# 	search_images = BoolProperty(name="Image Search", description="Search subdirectories for any assosiated images (Warning, may be slow)", default=True),
-# 	apply_matrix = BoolProperty(name="Transform Fix", description="Workaround for object transformations importing incorrectly", default=False),
+    constrain_size = FloatProperty(name="Size Constraint", description="Scale the model by 10 until it reacehs the size constraint. Zero Disables.", min=0.0, max=1000.0, soft_min=0.0, soft_max=1000.0, default=10.0)
+    search_images = BoolProperty(name="Image Search", description="Search subdirectories for any assosiated images (Warning, may be slow)", default=True)
+    apply_transform = BoolProperty(name="Apply Transform", description="Workaround for object transformations importing incorrectly", default=False)
 
     def execute(self, context):
-        load_3ds(self.properties.filepath, context, 0.0, False, False)
+        load_3ds(self.properties.filepath,
+                 context,
+                 IMPORT_CONSTRAIN_BOUNDS=self.properties.constrain_size,
+                 IMAGE_SEARCH=self.properties.search_images,
+                 APPLY_MATRIX=self.properties.apply_transform)
+
         return {'FINISHED'}
 
     def invoke(self, context, event):





More information about the Bf-blender-cvs mailing list