CBR Preview

What I’m going to cover on this page is how to insert a preview image into a cbr file. This procedure should work with any version of Carrara- at least until they decide to start compressing cbrs by default.

CBR files are pretty much just like CAR files- a hierarchical text based representation of your information. Here is some of a cbr file:

 

brow {

kind atmo

prvw 0

comm ""

}

<----- (paste point)

atmo {

RfSK {

WfSt 0

VERS 1

RES1 0

RES2 0

RES3 0

RES4 0

TIME 0

SKYH 0

SUNC 0.999954,0.999954,0.999954

 

A couple of guesses that I’m too weak to verify. (and that don’t really bear on adding a preview ;-)

brow probably means that this file wants to be loaded into the browser- it is a preset.

kind is telling Carrara where in the UI it is legal to drop this puppy.

When you get down to VERS and RES1 and that stuff- those are the actual values that get stuffed into the UI. If you look carefully you can probably figure most of them out.

I’ll explain paste point below.

You’ve just saved a useful new preset in the browser. If it is a shader you get a nice automatic preview. But if it is a Save Component- nope.

If you save a complete scene in the browser, you also get a nice preview.

But if you save a scene (.car) outside the browser and if you have the Options box checked, you get another popup with a checkbox for Save Scene Preview. Check it. There is also a checkbox for Compress- turn that off, or we won’t be able to read the file with our text editor.  Open up that saved car with a text editor and take a look- do a search for Prev. Hmm-- now we’re getting places! You should find a block of junk that looks kind of like this-

 

Prev {

TVPr {

08@n3X?1kG@o6Xo1XSPn7\_1jG@n4l_0k?@n4dO1mK`n7T?2aW@n8Xo1lK@n5d?1o;`n3\?1lG0o6\o1jS`k9P?2kO

0o6XO1mC003h_0m?`n4dO1mK@o7\?2gW@n:LO2kS`n7`_1kGPo4Lo0mC@o5d_1mO0o8LO2g[0n9\?2kO0o

.....

.....

1nOPo7ho1n?

}

}

 

Prev is telling Carrara that this is a preview image. I’ll hazard a guess that TVPr tells it something about the format, maybe. Then down a ways, you’ll find a couple curly braces }} that “close” the image section. After that, you will start seeing human-readable tokens again.

Carrara uses a somewhat obscure encoding method to turn the binary image into text- if I get ambitious, I’ll ask for the code and see if there is anything fun to be done with it (like allowing preview images to show up as thumbs in windows explorer).

But for today, we are just going to wholesale copy this block from one file to another. You can either find a donor file that has an image that you like, or you can make one- either by saving a .car, or by dragging an object into the browser. Don’t forget to check the preview and un-check the compress boxes. Using the object method will allow you to make an arbitrary image to use as a preview.

Now open up both the preset .cbr and the donor file in your favourite text editor, or something lame like Wordpad. ;-) In the donor, select the line that says Prev, and then everything below it- down to and including the two closing }}. Copy it. The paste it into the preset cbr file- right after the 1st closing curly bracket. If you look at the sample at the top of the page again, you’ll see a note that says paste point. You can probably stick it just about anywhere in the file at the top level of the hierarchy. If you know what that means, feel free to experiment.

Save and close your cbr. Exit Carrara (if it is running) and restart. You should now have a preview!!

[Shoestring Graphics] [Shoestring Shaders] [Shoestring Toolbox] [Gallery] [Links] [Privacy & Contact] [Tutorials] [VM Lathe] [VM Extrude] [CAR format] [Eyeball] [MultiCh Mixer] [CBR Preview] [Heat Waves] [Other Stuff]