Proposal: Extra File Extensions

I’m sure to get flamed for this one. It is a fairly simple idea but it is difficult to explain the advantages simply. In a nutshell I’d like to associate the Blender executable with new file extensions that represent different types of resources.

Right now you can launch a “.blend” file and your operating system will launch a new Blender executable with that file as a parameter. “Blend” files can obviously contain every type of resource that we ever use, but it is a “generic” file format in that we don’t know what it contains until a human opens it up and takes a look inside. The file does not communicate its intention.

I’m proposing we use “.blend” files as a container for SPECIFIC resource types, but save them with a different file extension when we do so. The following idea works with almost any type of resource inside a blend file, including objects, materials, UI preferences, etc. Let’s just use materials as an example. In this case lets assume we save materials with an extension of “.bmat”.

So you could literally take an existing file, “test.blend” for example, and rename it so that it is “test.bmat”. Nothing will have changed except that the “intention” of the file is now communicated. Instead of a generic file it now exists with a very specific purpose: as a container to hold the first material in the file. There might be other types of resources in it, but it is only the material that we need it for.

So how does this change anything?

You can now have an “open” icon right inside the materials editor panel. With one click it brings up the file browser set to filter for files with that extension. Select one and it assigns the material - you are done with one click. Internally it would be no different than appending from an existing file, browsing to the first material, then linking to that data block for the selected material. But it does so without you having to know about all those internal details. Material “save” would be a similar one-click operation.

File Execution

Right now if you launch a “blend” file your operating system will launch the Blender executable with that file as a parameter. If you have a copy of Blender already running, then you will get a second copy in memory, which is the expected behavior.

But for these proposed single-resource files, I would give them a different behavior. Launch a “bmat” file and your operating system will again launch a new copy of Blender with that file as a parameter. However, before showing you its UI the new copy of Blender will send a signal to the other running copies (using shared memory, named pipes, etc). If there are no others running then it continues to launch as usual and displays the UI. But if there ARE other running copies of Blender it sends a signal to them with the path to the bmat file and then the new copy EXITS. The running copies of Blender load the material instead, without you getting a new Blender instance.

Results

We would have a way to easily share blender materials between users that requires very little experience.

If you have a folder containing all of your materials you can now just double-click on any and they are instantly imported into your currently open project.

This would allow you to click on a “bmat” file on a web page and have that material instantly added to your running project without any additional work.

Since the “intention” of the file is known there is no reason why you can’t drag a “bmat” file from your file system directly onto a mesh as well.

Right now if you launch a “blend” file your operating system will launch the Blender executable with that file as a parameter. If you have a copy of Blender already running, then you will get a second copy in memory, which is the expected behavior.
This does not happen for all operating systems. In OSX if I double click on a blend file it opens the file in blender, if I double click on another blend file it opens that file in the same instance of blender. To run a second version of blender you need to use an additional blender.app

But then what happens to the project you had already opened? It is replaced by the new one?

Yep. If you haven’t saved the file you get a warning asking do you want it saved first

I’m assuming (but I welcome your thoughts) that this doesn’t change the central idea, which can be restated more simply like this:

There many times when it would be nice to have a separate file type for materials, so we can do things like loading one from a web page. Rather than create some new format we can just use our regular “blend” format but just give it a unique extension to indicate its function.

you can do this now…
for example store your materials in my_mats.blend and link into your scene blend…
you can store everything in separated blends, no need extra extensions…

All I’m trying to say is that any additional functionality should be independent of operating system. How something is achieved may just have to be adjusted to take into account how different OS’s work. I’ve no idea how it works in Linux.

For sure Endi, and I wouldn’t dream of taking that functionality away.

But I would love to be able to have the file manager show only materials in a folder, for example. And I would love to click on a web page link to load a material directly into my project without any further knowledge required.

Sure we can, right now, put a blend file on a web page that contains a material. But think about the steps that you need to go through to get it into your project. You need to save the file first, then from within Blender you need to link or append, select the file you downloaded, then browse into the resources looking for the name of the material that you remembered from the web page. Do you need textures too? We do these things all the time without thinking what they are like for new users.

We can remove all of this complication without taking anything away from experienced users. You could click on a link to a material on a web page and have it inside your open project without any time, work, or thought. If is just a time saver for new users to be able to add a material with one click and no prior knowledge? No, I think it helps all of us even you.

All I’m trying to say is that any additional functionality should be independent of operating system. How something is achieved may just have to be adjusted to take into account how different OS’s work. I’ve no idea how it works in Linux.

For sure it would need to be identical between operating systems. But I’m still assuming that many things could be simplified if we had a separate file type for materials. File system filtering. Their own icons. We could even choose to show a material preview rendering as the file system icon so you could see what it looks like without even loading it.

I believe there is someone looking at asset management in blender which may potentially go someway towards this.
http://wiki.blender.org/index.php/User:Elubie/AssetBrowser

Yes, I’ve been following that and this doesn’t take away from it but would simplify it.

Once you create an Asset Library you still need to add assets to it. This would help in that materials in this file type would be instantly recognized by it as a material, so no need for the user to databrowse to it. In fact you could add a whole directory of materials this way without further user intervention. This because it is a certainty that the file contains a wanted material and it assumed that it only the first one that is wanted.

i think this would be more helpful for cycles(the nodes than things) than just blender internal,
where appending is pretty easy…(though it would be be helpful for BI as well i suppose)
You can do it(append in materials) with Cycles too… just seems like a file material extension would be better/easier.

Similar to what Maxwell Render has.(Look at the library of free mats they have)

I’d say the current link/append process is only straight-forward if the file contains only one material and that material doesn’t use any textures.

I remember downloading a few material blends from the Open Material Repository where the file name and the material names inside did not have any relation to the material name I thought I was downloading. There were some where there more than one material inside and the obvious one was not the one I needed. And new users would not know to link in textures too, and it is not always obvious which ones to include if there is lots of things in the file.

These problems just go away if there is one material per file. And if the file extension means “this is a material” then blender can just load everything required without having to ask you for help.

Imagine posting a pic on BlenderArtists and someone says “I love the water! Can you send me the material?”

With my idea you can click “save” next to the material itself, send the resulting file, and the recipient can just click “open”.

Without that what do you now? Send him the entire file? It could have external textures so you’d have to pack everything first. But then the file could be huge. You’d have to tell him to link in the material “Material.023” and textures “water1.jpg” and “foam12.png”. Or you could link the material to a monkey, delete the rest of the contents, save a version of the file just for him. And wonder if it is worth the trouble…