BLAN: the BLender Archive Network

Hello !

I am currently working on a application for Blender called ‘BLAN’.

A Python script called ‘blan.py’ allows Blender to connect directly to a web server and to download and upload some items (such as Object, Material, Scene, Image and Text, for the moment).

My own BLAN server is here :

http://www.poufpoufproduction.fr/blan/

There, you could find the Python client script (which needs a Python installation) and some of my poor and ugly testing items (except the cornell scene that i stole somewhere…). I created an account that allows downloads only (login: anonymous, empty password). By the way, a little tutorial video is available here:

http://poufpoufproduction.free.fr/video/blan001.avi

The stuff is working quite well (and i will be glad if some people try it) (The script was not tested on linux for the moment, I will do it very soon).

Now I have a lot of questions !

  1. My main issue: is there anybody who knows why an API method scene.save() which would save only one scene of the current blend file DOESN’T exist ? It is really annoying for the upload process (I have to delete all the others scenes and to reload the blend file after…)

  2. Another issue: with the API function, is it possible to delete an object properly ? Indeed, the unlink method deletes an object from a scene, BUT the object is still here in the response of the Object.Get() function. The delete function in the classical GUI (XKEY shotcut) deletes the object in the right way. What it did that i don’t do ?

  3. Subsidiary question: I looked in the API documentation (a lot) and I didn’t find it but, with the Blender API, is there a way to set the compression file on ? (I’d like to send the smallest files through the web).

Thanks (and sorry for my english)

If I’m understanding correctly, you want to use it to only send scenes/objects/materials etc, not complete blendfiles.

if that is the case, I’d suggest using your own file format.
export to a simple text-file only the needed data (i.e. just an object, material etc… without all the linked data).

then you could probably find a python .tar.gz library that would allow you to compress/decompress from your script.

Actually, your issue is not really my point (I am talking about your XML thread too).

Currently, my script sends to the BLAN server a small blend file (at least, a not too big !). It works as follow:

  1. For a material for example, my script builds a new scene with one cube, one sphere with the material to send, some lamps and a camera. It is not a big scene.
  2. I use this scene for making a preview and then, I send a blend file with this scene only to my server. The blend file is not too big (even if, i’d like to use the blender compression mode)

My problem is: for sending only one scene, I have to delete all the others (the current one too) ! So after sending my little file to the server, I have to reload the complete blend file and then, blender closes my script. I need to relaunch it after each upload. That’s boring.

Hi every one,

I’ve just finished the version 0.0.3 of my BLAN script. BLAN (BLender Archive Network) has been built for allowing people to store their Blender items (like the ‘Blender Library script’) on a local (you can use LAMP) or distant server.

This new version includes a simple versionning tool that will allow blender artists to work together on the same project !

http://img294.imageshack.us/img294/6990/blan001nl6.th.jpg http://img516.imageshack.us/img516/4194/blan002bo1.th.jpg

The two snapshots show the GUI of the BLAN python client.
The second one shows the integration of an item new version (a material, in this case). The version 1 of the material had been locked and then replaced by the greener new one.

The server is then updated.

http://img300.imageshack.us/img300/3562/blan003uu3.th.jpg

( By the way, the items in the server have been, more or less, “stole” by myself. I am really sorry but I needed some quick examples. They will be removed very quickly. )

Server and Client can be found here :
http://www.poufpoufproduction.fr/blan/

If people want to try the download process, the parameters are given in the first message of the thread (for upload, contact me by MP).

looks interesting, might give it a try

This sounds very interesting, perhaps it could be an item for BlenderNation? (Just suggesting).

I will give it a try ASAP :slight_smile:

Thanks in advance, for making this possible.

looks good but don’t like the way it prints out the db password in plaintext in the browser if the connection doesn’t work. You’ll need to fix that!

Maybe in blender 2.5, such sharing could be standard!

One problem is that is someone uploads a file from another website that they have ‘borrowed’ & it is redistributed by you, you become liable for the legalities, even if your intentions are good. So you will need to set up proper passwords, ask uploaders for e-mail addresses for password verification, even for your own protection.
Generally the Blender Community is a very Sharing Place, but as a new poster, you will be met with some hostility, people will be very cautious about your ideals & you may even be largely ignored.
If on the other hand, you had been a longstanding member of blender, or had a proven track history in web file management/hosting or had several, many, lots of models &
textures/materials created by you on the site, you would certainly have more credibility.

Anyway,
Good luck with your venture, it has, on many times before been attempted, many times failed.
It may well be that you do have good intentions. But I think you have gone about things the wrong way.
m.a.

Thanks for your comments.

@blackcougar: are you talking about the python script ? (because there is also a login/password on the server too). Indeed, the password stays clear in the GUI (I had to make some blur on my screenshots). I made a quick correction you could find on the web page.

@Meta-Androcto: Well, you’re right too. Items are removed and i will make another examples by uploading some of mine very soon.

Anyway, about my three questions:

  1. I know that scene.save() does NOT exist. But my question is “why ?”. Because this point is really really annoying for my script (as it was for the blender library one).
  2. The point is not an API issue. I know how to unlink an object from a scene, but I don’t understand very well why it is not removed from the Object.Get() response ?
  3. That is an API issue. I looked for it a lot, and I didn’t find it. I guess the option doesn’t exist, but may be, I just missed it. That’s why, I asked.

You may find it would be best to wait a while until the api changes are made.
I’ll delete most of my thread. It would be best if you removed the references I was referring to.

It looks awsome. what I want to try the most is the versioning tool. Do I have to set up a server on my site too or can i just place the BLAN.py?

You can do both.

It is possible to install your own server by using the blan.7z archive (it is not really hard except there is not yet any documentation).

Or you may use my test server on http://poufpoufproduction.fr/blan
For testing the upload part and the versionning tool (which is really simple for the moment), you need a submitter profile. I’ll send you a login/password in MP.

By the way, my server is only a test server, items which are stored on it may be removed some times (if my devs need it). So, just use it for testing too.

i was setting it up on the server and got the database details wrong.
It printed out an mysql error message and the server, user and pass info like
server.com|blackcougar|mypassword
in the firefox web browser window

it basically prints out the global variable contents if php can’t connect to the mysql server

Can you drop a few quick lines giving some hints please:o…Im having, …well technical difficulties and i cant get it to work.

Some quick explanations :

  1. @chuzzy06 : congratulations for your uploads. As you may see, there is a trouble with your object Cube.008 that can not be downloaded. It’s a name issue and i am going to work on it. For the moment, just use simple name (without the .008 prefix) (actually, in the uploaded scene, the Cube.008 is copied as Cube.001 ! blan.py don’t recognize it when downloading).

  2. GUI explanation

http://img172.imageshack.us/img172/7564/blan004je9.th.jpghttp://img172.imageshack.us/img172/3986/blan005sj1.th.jpg

– Connection panel –
+ toggle : switch to the parameters panel
The menu list : list of blan depots
N button : Create a new name for your connection (to be improved : do not use it !)
S button : Save the list of blan depot (in the UDATATIR or DATADIR folder)
X button : Delete the current connection

Server / Login / Password : Connection parameters
Connect button : Connect to the depot

Same item menu list : define the behaviour of the script when it import an already existing item ( Get new : the new one will be renamed by Blender, Rename old : the old one will be renamed by blan.py, Replace old : the old one is replaced by blan)
Empty cache button : empty the cache but do not work yet
Proxy : define a proxy manualy if needed

– depot panel –
Type menu list : choose a type of item (object, material, scene, etc…)
Tag menu list : filter the browsing with a tag
Go : get the items
<- and -> buttons : browse the request results
L : lock or unlock an item (allowed if you have ‘submitter’ rights)
Import : import the item

– Workspace panel –
Type menu list : choose a type of item (Warning: if your file is not saved, only Text and Image are available. For object, material and scene, save your blend file first)
Name menu list : name of the item to upload
Ext : build a scene called PreviewScene. Once done, the preview will be made by using this PreviewScene and not by using an internal built scene
M : change the mode of preview (only used for material)
Comment : add a comment to your submit
Tag menu lists : add some tags to your uploads (8 max)
Submit/Integrate : Upload the items (Warning: Except for Text and Image, the current blend file is reloaded after the upload !)

Submit creates a new object in the depot
Integrate replaces an object in the depot by a new version
For integrating, open the old object in the depot panel and lock it. So, if you get the same object in the workspace depot (with the same name), the submit button is replaced by integrate.

  1. Server installation.

    A. Firstly, you need a classical LAMP (MAMP or WAMP) installation. Take care about the PHP version which has to be at least the 5.0 one. Also you need some optional modules: php_gd (or php_gd2) and php_gettext (needed for images manipulation and localization)
    B. Unzip the Blan.7z in the LAMP folder (httdocs, www, or something else)
    C. I am really sorry, but for the moment, the database has to be built manually. So, open a mysql console. Create the database with :
    CREATE DATABASE blan;
    USE blan;
    CREATE TABLE… (copy/past the /conf/depot.sql file)
    The default prefix is ‘blan_’. Take care if you decide to change it.
    D. Update the /conf/global.inc.php
    E. Open an internet browser: it would work.

@blackcougar: indeed, the password is displayed because of an old debug message. It will be corrected in the new version. For the moment, you may change the line 21 of the /model/__db.php file by : die("Connect error on ".$this->host);

:slight_smile:
I have built my own BLAN server at home, and you know what… it’s not bad… I’m really looking at it from the point of view of sharing components of a project with my counterparts.

Installation is a bit clunky, but were still beta right? I had installed before you put your instructions up, which I am sure will help.

I can see why your trying to get the scene / preview issue sorted… It has the potential to hold this back from being a great tool…

For some reason, my pictures don’t show on my main web page screen, but they pop up a light box if you click “preview” and display ok there… ? I have not checked if I have php_gd (or php_gd2) and php_gettext though, so the problem may be here or it may be a directory permission issue… I’m not sure.

Still… a great effort… let me know if there is anything I can do to help :smiley:

J

I just finished a new version of my Blender Archive Network.

This version makes a difference between “Meshes” and meshed “Objects” (in the second case, the modifiers are saved with the object).
Also, the web server allows some administrative operations on the blender items such as deletion and copy.

My own example depot is always here

http://img149.imageshack.us/img149/7912/snapshotit1.th.jpg