I am writing a simple script that will export a file in blender


import bpy

bpy.ops.export_scene.fbx(filepath="~/Desktop/updatedhouse.fbx", path_mode='RELATIVE')

I am running into the following error and I am not sure how to decipher it.

 line 291, in write
    with open(fn, 'wb') as f:
FileNotFoundError: [Errno 2] No such file or directory: '~/Desktop/updatedhouse.fbx'

location: /private/var/folders/48/ptx7wqz138x4_shgs5nk6szm0000gn/T/AppTranslocation/DEB386B3-C3FC-4FAB-B7A2-0954C07B91CF/d/blender.app/Contents/MacOS/../Resources/2.78/scripts/modules/bpy/ops.py:189
  • 2
    $\begingroup$ That doesn't look like a valid relative path address. And if it is it probably means the folder you are trying to export to doesn't exist yet $\endgroup$ – Duarte Farrajota Ramos Jun 14 '17 at 23:56
  • $\begingroup$ ~/Desktop? is the defualt desktop path for a Mac. How could it not be valid? $\endgroup$ – luii Jun 15 '17 at 0:00
  • 1
    $\begingroup$ Nevermind you were right. I needed to specify the entire path $\endgroup$ – luii Jun 15 '17 at 0:02

I needed to specify my entire file path in the filepath parameter of the bpy.ops.export_scene.fbx method.

| improve this answer | |

Try this:

bpy.ops.export_scene.fbx(filepath = yourpath, use_selection = True)
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.