Blender Library 1.3.1 beta

I thought I saw this question on this thread, but it seems to have disappeared so I thought I would answer it anyway for new-to-Blender folks wanting to use this.

After it’s in your Blender scripts folder, the link to it is accessed from the “Help” menu at the top of blender GUI.

Well finally got it to work. This script is really great. Please keep up the excellent work.
i especially like the fact that it can be accessed via the help button. this should be default for all scripts because it is much faster then the long way cor the other scripts. it feels much more natural and “integrated” that way.

Greets

Hmm, slight problem for me

 Traceback (most recent call last):
  File "/opt/blender/scripts/blender_library.py", line 1681, in ?
    init("material")
  File "/opt/blender/scripts/blender_library.py", line 155, in init
    get_categories()
  File "/opt/blender/scripts/blender_library.py", line 545, in get_categories
    txt = Text.Load(LIB_CATS)
AttributeError: text file not found

I should mention I’m using CVS from the 24th

One quick question… what does “Cenital Camera” mean, exactly? I’m afraid I misread that somehow.

Thank you very much Sanne !,

this was a very prosaic error in python code.
Now the Library script function very well for me.
Now that I can test the script, I can say to Mariano that his idea is very useful and important. Finally with Blender too, we can collect and share ours preferred object.
Thank’s to Mariano for your work, and I hope this script will be integrated in the “official” script list in the next Blender distribution.

bye Alorom

Hi Mariano,

I have used your script for a while, and I have discovered a problem with file name length.
I make an example with a material
The name of an object in the library is composed by the name of the material itself plus the name of the author. For instance my material’s name is Vetro_crown and the author is AloRom.
When I add the material to the library, an error occur:
Traceback (most recent call last):
File “<string>”, line 376, in button_event
File “<string>”, line 775, in save_mat
File “<string>”, line 725, in export_files
AttributeError: filename is too long!

Now if I use a shorter author like AR and I add the material, the error disappear.

For me this is another bug, because the objects names in Blender can be more long, and the Author name can be more long too.

ohhhh, thanks alot etr9j.

-theblenderboy

I’m also having some trouble with this script

  1. I’ve also got the “name to long” error, even after shortening the name to 1 letter. The material was still saved (I thought) with the rendered image though.
  2. I tried to use the material I created but got an error saying “library.blend not found”. The imported samples work fine. Ijust can’t seem to save my own.
  3. I wanted to try to change the directory location, so I deleted the original script and library folder, then added a new copy of the script and tried to run it again and set the new directory, but yet another error saying
    “Using Python version 2.4
    Traceback (most recent call last):
    File “<string>”, line 1681, in ?
    File “<string>”, line 155, in init
    File “<string>”, line 545, in get_categories
    AttributeError: text file not found”

Now the script won’t run.
Help please.

Edit,
I solved problem #3 by deleting the blender library key in the scripts config editor

My problem on windows XP, I got the “file name too long” message and thought that it meant my directory, so I moved it to C:. Then it couldn’t find the file, so I deleted it and planned to redo the script and this time set the directory to C:/Blender Library from the beginning. This time it won’t give me the “first time using” message to try and set up another directory. I remembered that it said something about using other versions in the startup thing, so I tried it on 2.37b, the script ran, but once I chose my directory, it gave me an error.Is there anything I can do to start over?

Hallo Mariano! …all your Python Scripts from your Site are AMAZING and very UseFULL!!!THANKS AGAIN FOR THIS AMAZING SCRIPTS!:smiley:
the zip´s Downloads not works cannot open!!??

SeeYA
Vassilios Boucer

Mariano, a brilliant script if I may say so! You have added an incredible new layer of functionality to Blender, enabling the user community to share content in a way not possible before. We owe you many thanks! I encourage you to keep up the good work.

Read this to learn how to add content to Blender Library:

I have also encountered the “filename too long” error. Here is the workaround I have come up with until Mariano is able to debug the script.

  • Add your content using the menu. For example, I added a material named “LavaFlow”.
  • The script should generate a thumbnail for you, then give you an error. “Attribute error: filename is too long!” The script has generated your information and thumbnail, but not the blend. In my case, the files “lavaflow-blendenzo.txt” and “lavaflow-blendenzo.jpg” were generated. However, the actual material is stored in the file “lavaflow-blendenzo.blend” which was not generated due to the error.
  • Once the script has run, it “re-loads” the .blend file from which your content was taken. This is not your original .blend, though. What you are now looking at is “your_new_content.blend”.
  • Using File>>Save As, save the new blend to the appropriate sub-folder in your Blender Library folder. Give it the same filename as your other files, except with the .blend suffix. In my case, I saved the file as “lavaflow-blendenzo.blend” in the folder BlenderLib\materialLib.
  • Ctrl-X or File>>New to create a new file. Open the Blender Library from the Help menu, and apply your new content to the scene. I loaded my “LavaFlow” material onto the default cube and rendered it. Success!!! This should work for the rest of you experiencing the same problem. Let me know!

This script is wonderful, unfortunately the orange’s project’s materials don’t are available that way.

blendenzo, here (Win XP) the thumbnail generated was 40x40 (too small), and the text file haven’t been created.
Well, I manually created the text file, and saved the blend file … It’s works!

But I have a question:
When I load an object, it’s position isn’t the cursor position, but the 0,0,0. Maybe it could be different.

Regards,
Dalai Felinto
Rio de Janeiro - Brasil

I’ve posted my “LavaFlow” material at my new (only minutes old) homepage. Please excuse the very low quality of the page. It’ll be better soon, I promise.

dfelinto: I’m sorry to hear it didn’t work quite as well for you. On Win98SE it generated a 240x240 thumbnail for me. Look at the .txt files in Mariano’s examples and the one with my own “LavaFlow” to see what information should be there. It just holds your title, description and author information.

edit: updated homepage. using my old page (from four years ago) for now until I have time to build new page. Blender Library files in the “downloads” section.

Like my title said, I just want to thank you so much for your script! This is the most helpful thing I just saw til today! I think this will help to build up a very wide community of people exchanging blender materials very soon! Thanks again and keep on your good work!

Some suggestions:

Line 546:
WEBPAGEstr= Draw.String("Site: ", 24, 10, 120, 155, 16, DefaultAuthorWebPage, 30, “The " + LIB.capitalize() + " Author Site”)
I changed to this:
WEBPAGEstr= Draw.String("Site: ", 24, 10, 120, 155, 16, DefaultAuthorWebPage, 40, “The " + LIB.capitalize() + " Author Site”)

Now I can write my web page - http://blendermaniacos.blogspot.com/ - 36 characters.

  • When we load an object, is better if it’s location is the cursor, not 0,0,0. (I still don’t find where to change ;))

And the “filename is too long!” error could be temporary solved if you change the line 831 to materials (I don’t know the line to the others items):
original:
Blender.Save(LIB_FOLDER + mat + “-” + author + “.blend”,1)
changed:
Blender.Save(LIB_FOLDER + “stones-dalai.blend”,1)

:slight_smile:
I hope, when everything to be working, that the Kator Legalz Blender 3D Repository could store the .tar files of a amazing !!! Blender Library

Regards,
Dalai Felinto
Rio de Janeiro - Brasil

PS.: the thumbnails is now working!!

Edit: Ack! wrong thread.

Hello!

I found a solution to the “filename is too long!” in line 831:
original:

Blender.Save(LIB_FOLDER + mat + “-” + author + “.blend”,1)

changed:

Blender.Save(LIB_FOLDER + mat + “.blend”,1)
os.rename(LIB_FOLDER + mat + “.blend”, LIB_FOLDER + mat + “-” + author + “.blend”)

I hope this help Mariano and other peoples. Please test and send a feedback.
Now I should try to change the position of the inserted object.

Regards,

Dalai Felinto
Rio de Janeiro - Brasil

how do you reset everything so the script thinks it was never ran?

how do you reset everything so the script thinks it was never ran?

scabootssca, I did it by opening the python config script. It’s listed in the system catagory. Just delete the library key and restart Blender. (you may not have to restart Blender, but I did and it worked).:smiley:

python confif script? system catagory? explain please.