This diff adds Drag&Drop of Collada files to the 3D-Viewport.
really great Idea. Would it be possible to generalize this to associate a path ending (like ".obj") with an importer (defined by user or just look for filtered formats in the importer to automatically make an association table)?
It works well for the collada importer, because it is written in C (c++ actually).
All other importers are written in Python. And it would be necessary to
call a python module from within C in order to get this working in general.
I do not know if this is doable for Blender. But it might be possible after all.
Others (Campbell ?) might answer that in more detail.
@Julian Eisel (Severin): That sounds great. I also had a look at this but i searched for a generic solution based in poll() copy() functions like i added for the Collada exporter. However, i could not see how to do it easily on that level. My main issue was that i would need one pair of poll()/copy() functions for each file extension, then i could add a WM_dropbox_add() to specify which Operator (and which poll/copy functions) have to be called for each file extension. But that does not sound like a good solution.
So maybe for Python it can be done in another more satisfying way. It would be great if that solution would also be working for the Collada exporter. I believe it would be very helpful if your solution allows to preset import options. Anyways it is just so much easier to use drop to place a collada file into the scene :)
Would prefer to have a general operator, WM_OT_import_activate or so, which could open the importer based on the file path.
Having a separate dropbox for every different file format (or only having for collada) seems a bit weak.
Should use BLI_testextensie, which isn't case sensitive.
It's quite strange functionality. If things like this are accepted then they should do actual import instead of showing a file browser open with the file selected. But then you'll be having issues with settings like axis mapping, scaling and so on.
Don't really see improvements comparing to the current master branch, maybe just search in the file selector could become more easy to use.
well the possible improvement are:
- we can use all the benefits of an OS File browser (complex search parameters, preview of all formats, etc...).
- For many people, it also an improvement in consistency as drag and drop is now part of nearly every program and is already present in many parts of Blender.
- You can import several object from different location in one step directly where you release your mouse in the scene.
Opening the full window is a bit overkill, I agree, just showing the options part in the tool panel would be enough. Saving last used parameters and/or defaults/presets would allow for even quicker import.
@Sergey Sharybin (sergey): This patch did not open a file browser. It did exactly what you proposed in your comment (and it has all the issues that you identified as well). In the case of the Collada importer i activated the operator redo panel just to see if this could be a feasible way to provide "posthum" import options. And in my tests it worked nicely, so that you actually even could tweak the imported items right after import if necessary.
We already summarized in T44670 what has been identified as major issues. So we already know that the patch as it stands needs an almost complete rewrite. Whether this feature will ever be implemented and how exactly it will be implemented, all of this is still discussed. This patch can be seen as a concept study if you like.