Take the 2-minute tour ×
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It's 100% free, no registration required.

Is it possible to associate Blender (in Windows 7 and later) to open files as it would be done via Import. I often import files in .dae or .fbx format to Blender and I would like to import them simply by opening the file in Windows explorer. Is that possible?

If I simply associate that file with Blender, it opens Blender in a default state with the cube.

share|improve this question
add comment

1 Answer 1

How about making a .bat file which will open blender and load a python script, which will load your object? I've made a little proof of concept.

First, the python script. Save it somewhere. It could be next to the .bat file.

import sys
import bpy

pathToImport = sys.argv[-1]

if pathToImport.endswith('fbx'):
    bpy.ops.import_scene.fbx(filepath=pathToImport)
elif pathToImport.endswith('dae'):
    bpy.ops.wm.collada_import(filePath=pathToImport)
elif pathToImport.endswith('obj'):
    bpy.ops.import_scene.obj(filepath=pathToImport)
else:
    print('Add the specific format?')

As the import operators are not all in the same place (as you can see for the fbx and the collada) I've done this if/elif statement where you can add other formats.

Then the .bat file

SET blender="C:\bin\blender-2.70-windows64\blender.exe"
SET pythonOpenScript="R:\flavio\tmp\openAndImport.py"

%blender% -P %pythonOpenScript% -- %1

I set the paths to blender and to the python script here, easier to manage/change. The %1 at the end of the last line will be the fbx or collada file you want to open.

To finish, right click on any fbx file / properties go to the 'open with' and change it targeting the .bat. That will open the default blender scene and import your object. Any other fbx file should do the same thing. Proceed in the same way for .obj and .dae files.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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