Scripts to create a text description of your build, and rebuild it from text.
Second Life has never provided any way to save backups of the objects you create in-world.
This is a problem, as builders may invest hundreds of hours in building their creations, but then rely solely on the creaking Second Life central database to store them: the reliability of which is contentious to say the least. Should the database lose your work, or should you for any reason lose access to your account, all your work is lost.
Bright Object Backup offers a simple, effective solution. Once you have finished your build, drop in our BACKUP script to read a complete, readable, textual description of every prim into chat. As long as you have enabled chat logging, this description will automatically be saved in your "chat.txt" file, on *your* computer. Everything you need to be able to recreate the object has been saved.
If you wish, you can also cut this text - from your chat window in your viewer, or from chat.txt - and paste it into a separate text file, building up a tidy backup library of your builds: "car.txt" "house.txt", and so on.
If you ever need to recreate a build, it is simple. Create a box prim. Right-click it, and 'take copy'. Then drop into the prim (a) your copy of the prim, (b) the text backup in a notecard, and (c) the RESTORE script, and your object will be recreated for you as you watch. The process can take from a few seconds to a couple of minutes depending on the number of prims in your build, and can be fascinating to watch.
(Note: this will not save mesh objects, or prim contents: but there is no need to do so. You will have the files from which you uploaded your meshes already on your computer. Notecards and scripts you can save yourself simply by cutting and pasting them. Animations, sounds and textures will have been uploaded from files already on your own computer. Bright Object Backup adds the missing piece of the development puzzle: a way to keep a backup of the *prim objects* you make too.)
But it offers more than just the safety of a backup. The text description of your object is easy to read, so you can use it to analyse and check your work. You can search it (in a text editor) to find a particular prim, or the use of a particular texture. You can even use search and replace to globally change (say) a colour setting across 100 prims, and then RESTORE from the modified description.
In short, Bright Object Backup is a serious development tool: allowing both the basic professionalism of keeping backups of your work (as developers in every other environment do), and advanced analysis and modification of your work.
And as a creator and developer myself, be assured that Bright Object Backup respects intellectual property. It will only create backups of objects every single prim of which someone has created themselves. It will grant you, and only you, access to your own work.
Drag the object "Bright Object Backup boxed" from your inventory onto the ground to rez it. Right-click it to show its pop-up menu, select "Open" to display its "Contents" window, and click the "Copy To Inventory" button at the bottom. This will create a new folder in your inventory, also called "Bright Object Backup boxed".
In this folder you will find two scripts: "Bright Object Backup - BACKUP", and "Bright Object Backup - RESTORE".
1. Make sure you have chat logging activated: you'll find this in your Second Life "Preferences", along with the path to the directory where your "chat.txt" file is kept.
2. Rez the object you wish to back up. Remember: you may only back up your own builds. The script will check that you created every prim.
3. Drop in the BACKUP script. A menu will appear...
----------
Please choose your backup settings, and click 'GO!' when ready...
Backup Style: READABLE
Key Table: GENERATE
[READABLE] [COMPRESSED]
[KEY TABLE] [NO KEY TABLE] [GO!]
----------
Click [READABLE] or [COMPRESSED] to set the backup style. The only difference is that a compressed backup uses abbreviations which make the text shorter, though less easy to read. We recommend leaving the setting at the default: READABLE.
Click [KEY TABLE] or [NO KEY TABLE] to determine whether a table of the texture keys used in the object is generated near the top of the backup. If there is a key table, instead of the full texture key being shown against every surface of every prim which uses the texture, a simple reference number will be included, referring back to this table. If it is omitted, the key itself will appear in the backup wherever it is used in the object, which may make the backup larger. Again, we recommend leaving the setting at the default: GENERATE the key table.
Then click [GO!]. You will see something like this in chat (this is a backup of a table which formed part of an early Bright Furniture collection - feel free to "restore" it :) )...
****************************************
~BRIGHT OBJECT BACKUP BEGINS FOR 'Bright Table'
~PRIMS|3
[04:58] Prim defaults:
~DEFAULT NAME|SObject
~DEFAULT DESC|S
~DEFAULT TYPE|I0|I0|V0,1,0|F0|V0,0,0|V1,1,0|V0,0,0
~DEFAULT SLICE|V0,1,0
~DEFAULT PHYSICS_SHAPE_TYPE|I0
~DEFAULT MATERIAL|I3
~DEFAULT PHYSICS|I0
~DEFAULT TEMP_ON_REZ|I0
~DEFAULT PHANTOM|I0
~DEFAULT POSITION|V0,0,0
~DEFAULT ROT_LOCAL|R0,0,0,1
~DEFAULT SIZE|V0.5,0.5,0.5
~DEFAULT TEXT|S|V0,0,0|F1
~DEFAULT FLEXIBLE|I0|I0|F0|F0|F0|F0|V0,0,0
~DEFAULT POINT_LIGHT|I0|V0,0,0|F0|F0|F0
~DEFAULT OMEGA|V0,0,0|F0|F0
[04:48] Philip Linden: Hey Shan!
[04:58] Side defaults:
~DEFAULT TEXTURE|K89556747-24cb-43ed-920b-47caed15465f|V1,1,0|V0,0,0|F0
~DEFAULT COLOR|V1,1,1|F1
~DEFAULT BUMP_SHINY|I0|I0
~DEFAULT FULLBRIGHT|I0
~DEFAULT TEXGEN|I0
~DEFAULT GLOW|F0
[04:58] Key 0:
~KEY_TABLE|0|5748decc-f629-461c-9a36-a35a221fe21f
[04:58] Key 1:
~KEY_TABLE|1|301511f8-5cc0-542a-e65e-7d7444b08995
[04:58] Prim 1:
~PRIM|1
~NAME|SBright Table
~DESC|S(No Description)
~TYPE|I4|I0|V0,1,0|F0.94989|V0,0,0|V1,0.25,0|V0,0,0|V0,0.5,0|V0,0,0|F1|F0|F0
~SLICE|V0,0.5,0
~ROT_LOCAL|R0,0.707107,0,0.707107
~SIZE|V1,1,1
[04:58] Prim 1, side 0:
~SIDE|0
~TEXTURE|#0|V1,1,0|V0,0,0|F0
~BUMP_SHINY|I3|I0
[04:58] Prim 1, side 1:
~SIDE|1
~TEXTURE|#0|V1,1,0|V0,0,0|F0
~BUMP_SHINY|I3|I0
[04:58] Prim 1, side 2:
~SIDE|2
~TEXTURE|#0|V1,1,0|V0,0,0|F0
~BUMP_SHINY|I3|I0
[04:58] Prim 1, side 3:
~SIDE|3
~TEXTURE|#0|V1,1,0|V0,0,0|F0
~BUMP_SHINY|I3|I0
[04:58] Prim 2:
~PRIM|2
~NAME|SEdge
~TYPE|I3|I0|V0,1,0|F0.89999|V0,0,0|V0.34994,0.5,0
~SLICE|V0.34994,0.5,0
~POSITION|V-0.540039,0,0
~ROT_LOCAL|R0.92388,0,0,0.382683
~SIZE|V1,2,2
[04:58] Prim 2, side 0:
~SIDE|0
~TEXTURE|#0|V1,1,0|V0,0,0|F-1.570844
~BUMP_SHINY|I1|I0
[04:58] Prim 2, side 1:
~SIDE|1
~TEXTURE|#0|V1,1,0|V0,0,0|F-1.570844
~BUMP_SHINY|I1|I0
[04:58] Prim 2, side 2:
~SIDE|2
~TEXTURE|#0|V1,1,0|V0,0,0|F-1.570844
~BUMP_SHINY|I1|I0
[04:58] Prim 2, side 3:
~SIDE|3
~TEXTURE|#0|V1,1,0|V0,0,0|F-1.570844
~BUMP_SHINY|I1|I0
[04:58] Prim 3:
~PRIM|3
~NAME|STop
~TYPE|I3|I0|V0,1,0|F0|V0,0,0|V0.34994,0.5,0
~SLICE|V0.34994,0.5,0
~POSITION|V-0.532959,0,0
~ROT_LOCAL|R0.92388,0,0,0.382683
~SIZE|V0.92,1.82,1.82
[04:58] Prim 3, side 0:
~SIDE|0
~TEXTURE|#1|V1,1,0|V0,0,0|F0
[04:58] Prim 3, side 1:
~SIDE|1
~TEXTURE|#1|V1,1,0|V0,0,0|F0
[04:58] Prim 3, side 2:
~SIDE|2
~TEXTURE|#1|V1,1,0|V0,0,0|F0
[04:58] Backup finished: All prims backed up.
~BRIGHT OBJECT BACKUP ENDS
****************************************
This text is now safely in your chat.txt file: you don't need to do anything more to know you have a safe copy to return to should you need it.
However, if you wish, you may wish to keep a tidier version of your backup in a separate file. For this, you will need a text editor on your computer, and ideally one which understands "regular expressions" or "regex". Free editors are available for all operating systems: for Windows, we recommend Notepad++: http://notepad-plus-plus.org/
Use your editor to open your chat.txt file, find the lines making up the backup, select, and copy them. Then paste it into a new document, and save this as (say) "table.txt".
Now, only the lines beginning with "~" are needed: all the other lines are noise - including bits of chat from people around you. They won't do any harm, as the RESTORE script will ignore them, but if you want to get rid of them, it's easy. Click "Search" and "Replace...", tick "Regular expression...", and change...
^[^~].*[\r\n]+
...to nothing, clicking "Replace All". This bit of regex hocus pocus will simply remove all lines which don't begin with a "~".
Or you can just delete them manually. You'll be left with...
~BRIGHT OBJECT BACKUP BEGINS FOR 'Bright Table'
~PRIMS|3
~DEFAULT NAME|SObject
~DEFAULT DESC|S
~DEFAULT TYPE|I0|I0|V0,1,0|F0|V0,0,0|V1,1,0|V0,0,0
~DEFAULT SLICE|V0,1,0
~DEFAULT PHYSICS_SHAPE_TYPE|I0
~DEFAULT MATERIAL|I3
~DEFAULT PHYSICS|I0
~DEFAULT TEMP_ON_REZ|I0
~DEFAULT PHANTOM|I0
~DEFAULT POSITION|V0,0,0
~DEFAULT ROT_LOCAL|R0,0,0,1
~DEFAULT SIZE|V0.5,0.5,0.5
~DEFAULT TEXT|S|V0,0,0|F1
~DEFAULT FLEXIBLE|I0|I0|F0|F0|F0|F0|V0,0,0
~DEFAULT POINT_LIGHT|I0|V0,0,0|F0|F0|F0
~DEFAULT OMEGA|V0,0,0|F0|F0
~DEFAULT TEXTURE|K89556747-24cb-43ed-920b-47caed15465f|V1,1,0|V0,0,0|F0
~DEFAULT COLOR|V1,1,1|F1
~DEFAULT BUMP_SHINY|I0|I0
~DEFAULT FULLBRIGHT|I0
~DEFAULT TEXGEN|I0
~DEFAULT GLOW|F0
~KEY_TABLE|0|5748decc-f629-461c-9a36-a35a221fe21f
~KEY_TABLE|1|301511f8-5cc0-542a-e65e-7d7444b08995
~PRIM|1
~NAME|SBOB Tester: 3 PRIM (Bright Furniture dining table)
~DESC|S(No Description)
~TYPE|I4|I0|V0,1,0|F0.94989|V0,0,0|V1,0.25,0|V0,0,0|V0,0.5,0|V0,0,0|F1|F0|F0
~SLICE|V0,0.5,0
~ROT_LOCAL|R0,0.707107,0,0.707107
~SIZE|V1,1,1
~SIDE|0
~TEXTURE|#0|V1,1,0|V0,0,0|F0
~BUMP_SHINY|I3|I0
~SIDE|1
~TEXTURE|#0|V1,1,0|V0,0,0|F0
~BUMP_SHINY|I3|I0
~SIDE|2
~TEXTURE|#0|V1,1,0|V0,0,0|F0
~BUMP_SHINY|I3|I0
~SIDE|3
~TEXTURE|#0|V1,1,0|V0,0,0|F0
~BUMP_SHINY|I3|I0
~PRIM|2
~NAME|SEdge
~TYPE|I3|I0|V0,1,0|F0.89999|V0,0,0|V0.34994,0.5,0
~SLICE|V0.34994,0.5,0
~POSITION|V-0.540039,0,0
~ROT_LOCAL|R0.92388,0,0,0.382683
~SIZE|V1,2,2
~SIDE|0
~TEXTURE|#0|V1,1,0|V0,0,0|F-1.570844
~BUMP_SHINY|I1|I0
~SIDE|1
~TEXTURE|#0|V1,1,0|V0,0,0|F-1.570844
~BUMP_SHINY|I1|I0
~SIDE|2
~TEXTURE|#0|V1,1,0|V0,0,0|F-1.570844
~BUMP_SHINY|I1|I0
~SIDE|3
~TEXTURE|#0|V1,1,0|V0,0,0|F-1.570844
~BUMP_SHINY|I1|I0
~PRIM|3
~NAME|STop
~TYPE|I3|I0|V0,1,0|F0|V0,0,0|V0.34994,0.5,0
~SLICE|V0.34994,0.5,0
~POSITION|V-0.532959,0,0
~ROT_LOCAL|R0.92388,0,0,0.382683
~SIZE|V0.92,1.82,1.82
~SIDE|0
~TEXTURE|#1|V1,1,0|V0,0,0|F0
~SIDE|1
~TEXTURE|#1|V1,1,0|V0,0,0|F0
~SIDE|2
~TEXTURE|#1|V1,1,0|V0,0,0|F0
~BRIGHT OBJECT BACKUP ENDS
Move your "table.txt" text file into a "backups" folder on your computer, and start your backup library!
To restore from a backup, begin by creating an empty notecard in your inventory, and pasting in a backup, like the one above. It doesn't matter if you've removed the irrelevant lines or not - the RESTORE script will ignore them.
However, notecards can only store 64K of text: if your object is large (roughly, over 100 prims, though the exact limit depends on its complexity), you may find you cannot paste the whole backup into one notecard. This doesn't matter: just paste the rest into a second, and even a third notecard if you need one, numbering them so their names sort in the right order: say "table 1", "table 2" and "table 3".
Next create an ordinary box prim, right-click it and "take copy" into your inventory, and drop the copy into the prim: so you have a box prim with a box prim inside.
Then drop in the notecard (or notecards) containing the backup.
Finally, drop in the "Bright Object Backup - RESTORE" script.
Your box will now jump 2m into the air (so that the object restored isn't left buried in the ground) and you will see a dialog box, asking for permission to "Link and delink from other objects". Click "Yes".
You can now watch your object being rebuilt or "restored", and giving the following progress reports...
[05:37] Object: Rezzing 3 prims...
[05:37] Object: All 3 prims rezzed. Now linking...
[05:37] Object: All 3 prims linked. Reading default parameters...
[05:37] Object: Configuring prim 1 of 3...
[05:37] Bright Table: Configuring prim 2 of 3...
[05:37] Bright Table: Configuring prim 3 of 3...
Once finished, the script will delete itself, and you will be left with a perfect copy of the original.
Enjoy!
Shan Bright
Chief Executive Officer