An Online Material Library Add-on - Beta Version 0.6!

Hi there, all!

After using Blender for almost three years, I’m a huge fan.
Nine months ago, I figured I would donate some of my time to creation of an online material library, a much requested feature.

Since May 2012, I have been working on creating an online material library and an add-on to browse it from within Blender.

You can download the add-on from my website.

Installation Instructions:

  • Download the add-on and bundled library in online_mat_lib.zip. (Direct link)
  • Open up Blender and go to File > User Preferences.
  • A new window should open up; go to “Addons”.
  • At the bottom of the new window, there is a button named “Install addon…”; click it.
  • Blender’s filebrowser will now open; locate the online_mat_lib.zip file you downloaded previously.
  • Select it and hit Enter (Return).
  • Back in the list of add-ons, search for “Material” and you’ll see the Online Material Library add-on. Enable it.
  • Now, if you switch to Cycles and go to the material options, you’ll see a new panel named “Online Material Library”. Go ahead and grab some materials!

If there’s any materials you think should be rated higher (or lower), please post here to let me know. If some should be removed entirely, again, please post your comments in this thread.

Please test the add-on and let me know what ya think of it!
Look for stuff that doesn’t work how you’d expect. Let me know what parts feel clunky and what features you’d like to see in the first version.

Also, if you see a material in the library that you created does not have your name with it, please let me know so I can give you credit.

Planned Features:
(Ordered by priority; from most important to least important.)

  • Add material from library (Done)
  • Material preview image (Done)
  • Apply selected library material’s to active (local) material (Done)
  • Save material to disk (Done)
  • Automatically cache library data for speed (Done)
  • Optionally cache library materials for offline use (Done!)
  • Search library (Possible for first version)
  • Add material from .bcm file (Possible for version 1.0) (Done)
  • Convert material to .bcm file (Possible for version 1.0) (Done)
  • Create custom local library (Won’t make the first version)
  • (Got any other ideas? :eyebrowlift2: )

My Goals for this Material Library:

  • To provide all Blender users with a high-quality repository of materials
  • To help newer users learn Blender through studying the materials
  • To provide the materials for free, with no attribution required

This initiative is working together with Brendon’s (Meta-Androcto’s) Cycles MatLib effort to provide users with access to a high-quality material library from within Blender.

There are currently two online libraries, Release and Testing, both of which are hosted on my website.

Release is updated every one or two months with new materials from the Testing library. The Release library also gets cached by the add-on for speed.

Testing is updated continually, whenever new materials are added to it. Only materials rated high enough (just how high is still to be determined) will be moved to the Release library. This library is cached, but cached data is deleted whenever the library is changed.

To submit a material, simply PM me the .bcm code and a description of the material, or post the same on this thread.
You can convert a material to .bcm code by going to the “Tools” section of the add-on, selecting the text block you wish to write to, and clicking convert. Then just open up a text editor window, copy all the code, and paste it into your reply/message.
I’ll look into getting a submission form up on my website soon, but for now, just use the forum. :slight_smile:

All materials, OSL scripts, images, and node groups are licensed as Creative Commons Zero.
You may modify or redistribute this add-on under the terms of the GNU General Public License 3.0 or any later version.

Here are screenshots of the current interface:

http://peter.cassetta.info/material-library/mat_lib_screenshot_home.png

http://peter.cassetta.info/material-library/mat_lib_screenshot_info.png

http://peter.cassetta.info/material-library/mat_lib_screenshot_tools.png

http://peter.cassetta.info/material-library/mat_lib_screenshot_settings.png

http://peter.cassetta.info/material-library/mat_lib_screenshot_view_materials.png

Thank you so much Peter!
Good initiative!

I will try it and post latter.

Cheers!

Looks pretty good

Another idea would be to have a site with pics of the node setup and it’s result under various lighting and different meshes.

Kind of like a database.

Good idea, I’ll keep that in mind for the second or third version. A preview of the node layout could be useful.

Yep, that’s basically what the preview (UV test image thingy) next to the options is supposed be for; however, like many other things in this script, it doesn’t actually do anything yet. Eventually it will download a preview of the selected material, but that’s not top priority.

Here’s what is top priority: Implementing the system for downloading materials. What good is a material library if you can’t actually download any of the materials? :stuck_out_tongue: (Answer: Not good at all.)

So right now, I am inventing a Blender Cycles Material file type (downloading a whole .blend file consisting of one material is kind of ridiculous). I will make the format’s extension .bcm (for Blender Cycles Material) and the file encoding UTF-8.

Unfortunately, I was looking into ways of just reading the raw data from bpy.data.material[index].node_tree.nodes, but that wasn’t working too great. Okay, I couldn’t do anything with it.

Anyhoo, I figured creating my own file type and getting the script/addon to read it would be the next best thing. One thing, though, is that groups and frames won’t be included for a while – I need to get the essential node types (BSDF shaders, textures, etc.) working before I try to implement the fancy stuff.

I really think this is great. Seemlessly adding a materials library within blender will allow people to get a really good start on materials.

I agree with the non-attribution acquired stance. I’m trying to learn how to do all this stuff without legally exposing myself. If I eventually make a name for myself, I don’t want someone suing me for some material that I unknowingly didn’t give proper attribution. Blender has a great community of people that give their work away without reservation. They just need to know that when they add their materials to the library.

I disagree with the idea for a website with different renders and having it serve as the main database. The key feature of this script is that it works within blender. I haven’t taken a in depth look at this script but here are a few things I wish a script like this would involve.

First, have a preview. Even if you don’t have a real time render of the material, have the script download a pic of the material in a default setting
Second, have a local cache. Having a local cache will ensure that if the server ever goes down, the materials will still be available.

HI,
very good job, thank you. A good idea would be to also work with the luxrender community. Maybe come to the point where materials have equivalent (with naming convention ? like wood1_cycle and wood1_lux), to allow people to switch between render easily. they must not render exactly the same but take as much work away from artist as possible. Would make blendswap’s huge model library available for people using other renderer.
With the node system being soon exposed to the API, it would be great to include compatibility from the beginning.
Again, very good job :slight_smile:

PeterCassetta,
hi, I changed the thread with Attribution to authors because it was requested by authors.
It’s not difficult to do & not neccesary in all cases, but major contributors are welcome to have their name on in an accompanying or built in text file :slight_smile:
So there lies the confusion.
I’ll fix the thread yet again.
I will be attributing the authors, however you will not be required to attribute the authors if you use the materials.
So the actual lib will be CC0.
also there’s an oppertunity to work together on this & site hosting offered on Blender swap for an online lib.
So if you want to join forces, we can make a truly awesome online matlib.
thanks
Brendon.

Cool, thanks a ton for the clarification. In that respect, then, we’re doing things the same way. You were using a text file to give recognition to the authors; my addon does this when you’re viewing a material. (It displays “By AuthorName” in the material viewing window.)

Neither of us were going to require attribution, but we both intended to give recognition to the materials’ authors in one way or another.

Yay! Let’s do it. :yes:
Looking forward to working with you, Brendon!

Edit:
Forgot to do a status update!

I’ve got the Diffuse node type working currently; other BSDF types are close behind.
Once I implement all the shaders, I’ll update the demo .blend with the latest version of the script/addon and post again to let everyone know.
After that, I’ll work on a way for the .bcm file to specify node links (aka noodles, strings, wires; take your pick :wink: ) to connect the different nodes.

I like this. Do you think you will end up with a similar interface to what you are showing here while working together? I really like the look of that one, with the rating system and all.
Good luck with the project anyway, looking forward to using it.

Hello there, everyone!

I’ve been able to get all the shader types (excluding “Background”) working!
It was ridiculously easy once I got started, so I had leftover time, which I spent on getting the node links (noodles, strings, wires; whatever…) working as well! As you can see from all the exclamation points, I’m pretty excited.

Want to try it out? Download this blend: http://peter.cassetta.info/material-library/Online%20Material%20Library%20Demo.blend

Here’s a step-by-step guide to downloading the Tomato Juice material (it’s currently the only one that actually has any data):

  • In the text editor, run the script displayed there by pressing “Run Script”.
  • Now, in the material options, you’ll see a new panel named “Online Material Library”.
  • Hit the refresh button (depending on your internet speed, you may have to wait a few seconds for it to refresh).
  • Browse the “Liquids” category.
  • Select “Tomato Juice” and hit the “Paste” button in the info display that appears.
  • Wait a couple seconds and you’ll see the “Tomato Juice” material has overwritten the current one!

Sorry that the Tomato Juice material is not exactly amazing, it’s only a test after all. :wink:

Maybe tomorrow I’ll get to work on some other node types such as the generated textures.

Awesome! If this continues to be well organized, it will save tons of time! Also a search button would be good if you don’t have one already.

Really looking forward to this!

I figured it’s time to respond to some of ya’ll’s questions and comments now. :slight_smile:

Well, it’s not quite seamless; seamless would be editing Blender’s source code to create a whole new window type, but since I don’t know any C, a Python addon is the next best thing. :slight_smile:

That’s already planned, but since I’m sorta fuzzy on how to implement it, there’s only a placeholder for the moment. It’ll happen, don’t worry!

I don’t know if a cache would be a good idea or not, but I am planning something like “Download full category” or “Download entire library” buttons to let one save them to the local disk.

Yeah, probably so. The final materials and categories will be different from the current ones, though. These current materials are just for testing and will be replaced with high-quality ones by the release of the addon’s first version. The categories will get revamped too.

Good call. I don’t know how hard that would be to implement, but it would certainly be useful.

Also, some have asked about other render engines - don’t worry, I’ll get others like Blender Internal, Freestyle, LuxRender, and Yafaray working eventually too, but version 1 will be focused on Cycles only. Once I get (relatively) complete support for Cycles finished, I’ll work on adding support for other engines. So don’t think that I’ll just be neglecting all other engines in favor of Cycles. In time, they’ll get added too.

Howdy, everyone.

Here’s an update:

All (except for four) node types are working now! Below is a summary of the currently unsupported ones.
Image texture nodes - not fully working yet, the addon will need to be able to download textures for them.
Color Ramp nodes - don’t work at all yet. Support for those will be a pain to implement, but will, however, be necessary: many of the materials from Meta-Androcto’s Cycles Mat Lib utilize this node.
Group nodes/node groups - unsupported currently, unlikely to be added in first version.
Frame nodes - don’t work yet either, and are very low priority right now.

Categories are being reorganized to better encompass all possible materials. Sub-categories are also being worked into the addon; I’m working on a simpler way of viewing categories to accompany them.
In a few days, I’ll see about getting the material preview working. It will download a pre-rendered image of the current material once complete.

There will likely be two different libraries after version one’s release:
A “Stable” one, which will have its categories/sub-categories (but not materials) cached by the addon to improve performance. This will get updated maybe every one or two months.
A “Testing” one, which would hold new/updated versions of materials until the stable library’s next release. Community rating of materials in the testing library would be needed for this so that users could rate materials in the testing library; only materials above a certain rating would be added from the testing library to the stable library.

Note: I will need to make a script to quickly turn a material into a .bcm file - before the first release probably. Right now I have been manually writing the .bcm material files from actual Cycles materials.

Note that I have not updated the demo .blend with the latest version of the script yet, I need to finish implementing sub-categories first.

hi, just a heads up, ported the matlib to mackrakens addon for now.
Now lets get started on yours :slight_smile:

Cool. Probably we’ll need to wait a few days before we can start adding any significant amount of materials to the online library. By then, I hopefully will have started to write up the .bcm format’s specifications and semi-finished my little script for automatically converting Cycles nodes to .bcm files. (Right now, I have been creating the material files by hand. It’s BORING.)

After that, though, we should have a (relatively) easy time converting and uploading them for people to use. Most of the core functions of my addon are now pretty much finished, but I’m waiting until I get a few more categories ready (with at least one material each) on my server before I upload the latest version of the addon for people to look at.

I must say that it’s coming along pretty well, though. Color Ramp nodes are yet to be implemented, but those materials which don’t rely on them should be easy enough to get converted and uploaded once I finish my converter script.

I would guess there would be about two weeks until we get enough materials uploaded and I add enough features to have the addon (and the library materials) start to be ready for (alpha?) testing. We could then get feedback on the addon and materials.

Hey there everyone!

Hope you’re all doing great. After a week of adding features and functions, I’ve gotten the the core functions and the file format relatively stable. Stable enough, in fact, that I’m releasing an installable alpha version of the addon for testing.

The days of running a script in from a demo.blend are over. :wink:

The nice thing is that Blender makes it super easy to install a newer version of an addon over an older one, so in a week or so, when I have image previewing capability added, you’ll be able to easily overwrite the older version.

You may modify this addon under the terms of the GNU General Public License 3.0; you may assume that you may use the GNU GPL 3.0 or any later version.

Installation Instructions:

  • Download the online_mat_lib.py addon. (Direct link)
  • Open up Blender and go to File > User Preferences.
  • A new window should open up; go to “Addons”.
  • At the bottom of the new window, there is a button named “Install addon…”; click it.
  • Blender’s filebrowser will now open; locate the online_mat_lib.py you downloaded previously.
  • Select it and hit Enter (Return).
  • Back in the list of addons, search for “Material” and you’ll see the Online Material Library addon. Enable it (you do want to, don’t you?).
  • Now, if you switch to Cycles and go to the material options, you’ll see a new panel named “Online Material Library”. Go ahead and grab some materials!

If you see that a material you created does not have “By [Your Name]”, please let me know so I can give you credit. Thanks!

If there’s any materials you think should be rated higher (or lower), please post here to let me know. If some should be removed entirely, again, please post your comments in this thread.

Also, let me know about any issues you find or features that you would like added.
I’ll keep adding more materials throughout the week.

Next feature: Preview images for the materials so you’ll be able to see what the material looks like before you download it.

Nice Project. Thank you.
One thing i would change is the behavior of the Category List: One should not need to press the -> button to Update Material List bellow, it should update on Category change. (Just an imo unnecessary step which already bugs me :wink:

As well i’ve noticed if “Paste to Active” the Material Name does not update…

And do you think about a possibility of uploading materials through the addon? Would probably lead to more Materials uploaded. btw, How is your idea on (where) submitting Materials?

PeterCassetta,
Wow, this has huge potential, we would love to hook our material library into this, or have it be an other. If your interested hit me up. Great idea.
matthew/mofx

Wow, thanks for your interest; I was actually considering contacting you once the addon/material format became more stable. I have just finished preview support (the addon downloads prerendered images of the materials now). I haven’t updated the addon on my website yet; that will have to wait until I iron out a small issue (it’ll take me maybe 5 or 10 minutes to finish). I’ll upload the latest version later on and update the screenshots/instructions too. I’ll probably need to work on the underdeveloped wiki page a bit.

Maybe a few months from now stability will be improved enough to get your help in hosting the stable library (the one which would get updated like every other month)? What are your thoughts?

The testing library, at least in the early days, would still need to be hosted on my website for me to have easy access to it, but that could change in the future.

I’m guessing my website will reach its (bandwidth) limits once this becomes powerful enough to be widely used, so I would be happy if you’d like to help with hosting eventually.