diff options
author | Campbell Barton <ideasman42@gmail.com> | 2006-01-11 13:12:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2006-01-11 13:12:03 +0300 |
commit | 8c205be66fc9b1a077f1eb65ab5d68c4b43d3a95 (patch) | |
tree | 32c7ea8de10072123ec08dfa6fa63f56ae6d17c1 /release | |
parent | 664f6026d57b6854b7865ee2d9c1129aff0beecd (diff) |
Fixed a silly bug when copying images.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/obj_export.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/release/scripts/obj_export.py b/release/scripts/obj_export.py index d0a993509f9..7a648dc7d78 100644 --- a/release/scripts/obj_export.py +++ b/release/scripts/obj_export.py @@ -21,7 +21,7 @@ Run this script from "File->Export" menu to export all meshes. # -------------------------------------------------------------------------- -# OBJ Export v0.9b by Campbell Barton (AKA Ideasman) +# OBJ Export v1.0 by Campbell Barton (AKA Ideasman) # -------------------------------------------------------------------------- # ***** BEGIN GPL LICENSE BLOCK ***** # @@ -197,6 +197,7 @@ def copy_file(source, dest): file.write(data) file.close() + def copy_images(dest_dir): if dest_dir[-1] != sys.sep: dest_dir += sys.sep @@ -204,12 +205,14 @@ def copy_images(dest_dir): # Get unique image names uniqueImages = {} for matname, imagename in MTL_DICT.iterkeys(): # Only use image name - uniqueImages[imagename] = None # Should use sets here. wait until Python 2.4 is default. + if imagename != None: + uniqueImages[imagename] = None # Should use sets here. wait until Python 2.4 is default. # Now copy images copyCount = 0 for imageName in uniqueImages.iterkeys(): + print imageName bImage = Image.Get(imageName) image_path = sys.expandpath(bImage.filename) if sys.exists(image_path): @@ -543,13 +546,13 @@ def save_obj_ui(filename): orig_frame = Blender.Get('curframe') if EXPORT_ALL_SCENES: # Add scene name into the context_name - context_name[1] = '_%s' % saneFilechars(scn.name) + context_name[1] = '_%s' % saneFilechars(scn.name) # WARNING, its possible that this could cause a collision. we could fix if were feeling parranoied. # Export an animation? if EXPORT_ANIMATION: scene_frames = range(context.startFrame(), context.endFrame()+1) # up to and including the end frame. else: - scene_frames = [orig_frame] + scene_frames = [orig_frame] # Dont export an animation. # Loop through all frames in the scene and export. for frame in scene_frames: |