Materials Library

Ok here we go, matlib v4 is out.
Ive rewritten all the code to support any external render materials.
Sort list, and search menu are some of the new features.
Im sorry but materials written with matlibv3 are not compatible with matlibv4.
The next versions of matlib will be compatible with matlibv4.

external render materials ? you mean materials used by external render engines ?

Yep, yafray, vray, povray, luxrender, any of those material structures are saved into the xml file.
At this stage the script fails if it tries to apply an external material structure into a regular material. That means that if im using Yafray instead Blender Render i can save materials and apply them without problems. But if i try to apply the same material into a new file that doesnt have the yafray addon enabled, the script raises an error. But i can fix that later.

WOW I am impressed!!!

matlib v4.2 fixed some bugs when applying diffuse, specular and texture ramps.

The download link does not appear to be working at the moment.

Ok its fixed.

Interesting stuff!

Does it support textures yet? what about image based textures and paths? That’s a thorny one!

Does it support material nodes at all?

It should, but image textures are still a bit buggy, check this out in a couple of days and ill fix images handling.
Nodes are a bit more complex so they are not included yet. When i fix all the current bugs i could work on include them into the library.
If you try to include a node based material or texture into the library raises errors, right now.
Be patience, ill fix all those errors soon.

With this addon, would we theoretically be able to share xml files as material databases as long as we only use procedural textures?

Yes of course, thats one of the keys of the script, you can also share materials.xml across a local network just by changing the ‘path’ variable at the begining of the script (about line 48).
meta - androcto gave me a file with nearly 100 materials.

I must say that the script its a bit bugy when deals with images, im working on it.
Node Materials or node textures raises errors. Dont try to include them yet. They could store but could crash blender if you try to apply them.

Ive released a new patch that should take care of image file problems.
If you still have errors please let me know.

i cant download…, is something wrong?

Skydrive says, 'this item appears to be missing"(could use mediafire that works well)

Sry skydrive sucks lately, i guess ive fixed it, try again pls.

using blender 2.58 the script shows up in the Menu fine
But, when you click to enable it nothing happens. it wont put a check in the box…

I’m using 64bit Blender and 64bit Windows it that makes a difference.

Try downloading the script again it has some new fixes.
You can also erase the cache file to force blender to recompile the script. It might be corrupt.

To erase cache files:
Quit Blender
Go to "D:\Blender258\2.58\scripts\addons_pycache_ "
delete the file “matlibv4258.cpython-32.pyc”
Start Blender and try again.

I dont think that 64bits should be a problem at all, if the script crashed blender the cache could be corrupt. Try those instructions and let me know if it doesnt work. Ive just tried the script and seems to work.

To identify the error start blender from a command prompt (so you have a console) and try to enable the addon. If theres any error, the console will show whats happening.

Good news:
Im rewriting the script again, it will support everything, node materials, node textures and external renders., hopefully without any bug.

try numbering the file of new releases even if you make a little change give it a new number,
for instance 4258, 4259…etc…

i downloaded it again and same results…(it wont enable in the addons menu)

OK, it works now…

Only I tried linking a material that i downloaded from the Blender material library…
and it gives a huge crash to the whole script… !!!
this is the material i tried.

waiting for new revision :slight_smile:

yes, there are some things to be addressed, i tried that clay material and i havent problems but there are many reasons that could cause a crash.

Some of them that i know are:
-If you “saved” the material while any external render its enabled, you must have that addon enabled to apply the material.

-If the material has some node related properties (for example if you enable use nodes and disable it again, the script could save some node properties that could make it crash, even if ‘use nodes’ its disabled when you save it) or any node texture.

-Changing from one render engine to another, should work but its not tested yet.
-Ive fixed environment textures errors but i could miss some others errors related.
-Bad xml structure, you can edit the xml file without problems (Useful to change materials names or remove problematic properties) but if you missed to close a tag or wrote a material name or other string property without quotes, it fails. for example:
Correct: name = “‘Green’” (double and simple quotes)
Wrong: name=“Green” (Just double quotes will raise errors)

I use XML Marker its simple and complete for xml editing. for example if you saved a node material you can delete the node tags and the material will still work.

In general the script works ok with procedural and regular material settings.
If it crash:
Use the debug button and execute the 'commands ’ text that the script creates to check whats wrong.
To display the console, go to Help -> Toggle system console.

Thanks for the feedback, that helps me improve the script.

Cya.

Plus 9000 cool points ;D thanks for this, I have so many textures, and I normally need about a thousand different blend files to contain them. Now I just need one ;D…or just set it to default…not sure which