From 8ac1330b74e24af828f94b24e46f8c1caac844c2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 20 Apr 2008 19:27:48 +0000 Subject: [PATCH] Patch from Mario Lapin, fixes [#7394] 3ds File Import is broken --- release/scripts/3ds_import.py | 47 +++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/release/scripts/3ds_import.py b/release/scripts/3ds_import.py index 07da4df1603..8c7c93018db 100644 --- a/release/scripts/3ds_import.py +++ b/release/scripts/3ds_import.py @@ -6,9 +6,9 @@ Group: 'Import' Tooltip: 'Import from 3DS file format (.3ds)' """ -__author__= ['Bob Holcomb', 'Richard L?rk?ng', 'Damien McGinnes', 'Campbell Barton'] +__author__= ['Bob Holcomb', 'Richard L?rk?ng', 'Damien McGinnes', 'Campbell Barton', 'Mario Lapin'] __url__ = ("blenderartists.org", "www.blender.org", "www.gametutorials.com", "lib3ds.sourceforge.net/") -__version__= '0.995' +__version__= '0.996' __bpydoc__= '''\ 3ds Importer @@ -17,6 +17,15 @@ This script imports a 3ds file and the materials into Blender for editing. Loader is based on 3ds loader from www.gametutorials.com (Thanks DigiBen). +0.996 by Mario Lapin (mario.lapin@gmail.com) 13/04/200
+ - Implemented workaround to correct association between name, geometry and materials of + imported meshes. + + Without this patch, version 0.995 of this importer would associate to each mesh object the + geometry and the materials of the previously parsed mesh object. By so, the name of the + first mesh object would be thrown away, and the name of the last mesh object would be + automatically merged with a '.001' at the end. No object would desappear, however object's + names and materials would be completely jumbled. 0.995 by Campbell Barton
- workaround for buggy mesh vert delete @@ -319,6 +328,7 @@ def process_next_chunk(file, previous_chunk, importedObjects, IMAGE_SEARCH): contextMesh_vertls= None contextMesh_facels= None contextMeshMaterials= {} # matname:[face_idxs] + contextMeshUV= None TEXTURE_DICT={} MATDICT={} @@ -422,6 +432,8 @@ def process_next_chunk(file, previous_chunk, importedObjects, IMAGE_SEARCH): #a spare chunk new_chunk= chunk() temp_chunk= chunk() + + CreateBlenderObject = False #loop through all the data for this chunk (previous chunk) and see what it is while (previous_chunk.bytes_read