diff options
Diffstat (limited to 'release/scripts/io/export_fbx.py')
-rw-r--r-- | release/scripts/io/export_fbx.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/release/scripts/io/export_fbx.py b/release/scripts/io/export_fbx.py index 9468cadec83..bb846b0335a 100644 --- a/release/scripts/io/export_fbx.py +++ b/release/scripts/io/export_fbx.py @@ -83,7 +83,7 @@ def copy_images(dest_dir, textures): if Blender.sys.exists(image_path): # Make a name for the target path. dest_image_path = dest_dir + image_path.split('\\')[-1].split('/')[-1] - if not Blender.sys.exists(dest_image_path): # Image isnt alredy there + if not Blender.sys.exists(dest_image_path): # Image isnt already there print('\tCopying "%s" > "%s"' % (image_path, dest_image_path)) try: copy_file(image_path, dest_image_path) @@ -359,7 +359,7 @@ def write(filename, batch_objects = None, \ if BATCH_OWN_DIR: new_fbxpath = fbxpath + newname + os.sep - # path may alredy exist + # path may already exist # TODO - might exist but be a file. unlikely but should probably account for it. if bpy.utils.exists(new_fbxpath) == 0: @@ -391,7 +391,7 @@ def write(filename, batch_objects = None, \ # Call self with modified args - # Dont pass batch options since we alredy usedt them + # Dont pass batch options since we already usedt them write(filename, data.objects, context, False, @@ -2763,7 +2763,7 @@ Takes: {''') act_end = end else: # use existing name - if blenAction == blenActionDefault: # have we alredy got the name + if blenAction == blenActionDefault: # have we already got the name file.write('\n\tTake: "%s" {' % sane_name_mapping_take[blenAction.name]) else: file.write('\n\tTake: "%s" {' % sane_takename(blenAction)) @@ -2782,7 +2782,7 @@ Takes: {''') # Set the action active for my_bone in ob_arms: - if blenAction in my_bone.blenActionList: + if ob.animation_data and blenAction in my_bone.blenActionList: ob.animation_data.action = blenAction # print '\t\tSetting Action!', blenAction # scene.update(1) @@ -2918,7 +2918,7 @@ Takes: {''') for val, frame in context_bone_anim_keys: if frame != context_bone_anim_keys[0][1]: # not the first file.write(',') - # frame is alredy one less then blenders frame + # frame is already one less then blenders frame file.write('\n\t\t\t\t\t\t\t%i,%.15f,L' % (fbx_time(frame), val )) if i==0: file.write('\n\t\t\t\t\t\tColor: 1,0,0') @@ -2940,7 +2940,8 @@ Takes: {''') # end action loop. set original actions # do this after every loop incase actions effect eachother. for my_bone in ob_arms: - my_bone.blenObject.animation_data.action = my_bone.blenAction + if my_bone.blenObject.animation_data: + my_bone.blenObject.animation_data.action = my_bone.blenAction file.write('\n}') @@ -3037,7 +3038,7 @@ Takes: {''') # -------------------------------------------- # UI Function - not a part of the exporter. -# this is to seperate the user interface from the rest of the exporter. +# this is to separate the user interface from the rest of the exporter. # from Blender import Draw, Window EVENT_NONE = 0 EVENT_EXIT = 1 @@ -3437,7 +3438,7 @@ class ExportFBX(bpy.types.Operator): def menu_func(self, context): - default_path = bpy.data.filepath.replace(".blend", ".fbx") + default_path = os.path.splitext(bpy.data.filepath)[0] + ".fbx" self.layout.operator(ExportFBX.bl_idname, text="Autodesk FBX (.fbx)").filepath = default_path |