Dynamic content

Normally the texts and pictures in BluffTitler are static: they never change when playing the animation. However, by using special formatting you can make them dynamic. With dynamic content you can automate tedious editing work, turn BluffTitler into an RSS news feed reader, a photo browser or even create internet controlled digital signage players and interactive apps.

For coders only

This page is only meant for software engineers. You do not have to understand anything on this page in order to change the texts and pictures of a BluffTitler template. Click here to learn how to use templates

To explain how it all works, a practical example works best. Imagine an animation where you would like to introduce the members of a music group, one musician at a time. Creating the animation for the first musician is fun, but for all the others it is very boring: for each musician you have to create a new layer with the same keyframes, only at different positions and with different texts.

A better solution is to store all the texts in an XML file, like this:

<?xml version="1.0" ?>
<band>
  <musician>
      <name>Django</name>
      <instrument>Timbales</instrument>
  </musician>
  <musician>
      <name>Aristide</name>
      <instrument>Congas</instrument>
  </musician>
  <musician>
      <name>Oscar</name>
      <instrument>Bongos</instrument>
  </musician>
  <musician>
    <name>Eelco</name>
    <instrument>Piano</instrument>
  </musician>
  <musician>
    <name>Liane</name>
    <instrument>Bass</instrument>
  </musician>
  <musician>
    <name>Elaine</name>
    <instrument>Violin</instrument>
  </musician>
  <musician>
    <name>Simon</name>
    <instrument>Trumpet</instrument>
  </musician>
  <musician>
    <name>Laurens</name>
    <instrument>Sax</instrument>
  </musician>
  <musician>
    <name>Magda</name>
    <instrument>Vocals</instrument>
  </musician>
  <musician>
    <name>Daniela</name>
    <instrument>Vocals</instrument>
  </musician>
</band>

Save this file as:

X:\temp\salsa.xml

Now when you create a text layer and choose MEDIA > Change text... and enter the following text:

xml:X:\temp\salsa.xml?band/musician/name

BluffTitler will load and parse this file to collect all the names. When playing the animation, BluffTitler will use a new name for every new loop.

You can also instruct BluffTitler to download the XML file from a server:

xml:http://www.myurl.com/salsa.xml?band/musician/name

Adding parameters to your URL is no problem because BluffTitler uses the last questionmark as the separator:

xml:http://www.myurl.com/salsa.xml?x=1&y=2?band/musician/name

Dynamic pictures

If you want, you can add a tag containing the path of a corresponding picture:

  <musician>
    <name>Daniela</name>
    <instrument>Vocals</instrument>
    <picture>X:\temp\Daniela.jpg</picture>
  </musician>

You can instruct a picture layer to use this path by choosing MEDIA > Change Texture... and entering the following string:

xml:X:\temp\salsa.xml?band/musician/picture

Global XML path

If you do not provide an XML path, BluffTitler uses the XML path of the Content field of the FILE > Show properties... dialog:

xml:?band/musician/name

Attributes

This is an example of an XML attribute:

<picture url="X:\temp\Daniela.jpg" />

Attributes can be read with the following syntax:

xml:X:\temp\salsa.xml?band/musician/picture.url

Photo browser

You can instruct BluffTitler to loop through all pictures of a specific folder by placing dir: in front of the path:

dir:X:\temp\salsa.jpg

BluffTitler will now loop through all pictures in the X:\temp folder.

RSS news feed reader

RSS files are XML files so we can use the same technology to display its content. The most important tags in an RSS file are the title and description tags. If the URL of your favorite RSS feed is:

http://www.X.com/rss/topstories.rss

You can make BluffTitler extract the titles with this string:

xml:http://www.X.com/rss/topstories.rss?rss/channel/item/title

And you can extract the descriptions with this string:

xml:http://www.X.com/rss/topstories.rss?rss/channel/item/description

Flickr image browser

Many sites offer content in the XML format. This is the URL of an XML file produced by Flickr.com:

http://api.flickr.com/services/feeds/groups_pool.gne?
id=81705672@N00&format=rss_200

Flickr.com stores the URL of its pictures in the url property of the rss/channel/item/media:content node. To instruct the picture layer to display those pictures you can use the following path:

xml:http://api.flickr.com/services/feeds/groups_pool.gne?
id=81705672@N00&format=rss_200?rss/channel/item/media:content.url

Indices and offsets

You can instruct BluffTitler to display a specific index with the following syntax:

dir:X:\temp\salsa.jpg[3]

You can add an offset with the following syntax:

dir:X:\temp\salsa.jpg[-1]

Offsets are zero-based: 0 means the first item.

Ranges

You can instruct BluffTitler to display a specific range with the following syntax:

dir:X:\temp\salsa.jpg[2:5]

This selects item numbers 2,3,4 and 5. Indices are zero-based: 0 means the first item.

Character sets

BluffTitler ignores all encoding and character set information in the XML files.

Use the font dialog (menu item MEDIA > Change Font...) to set the character set. Most XML files use UTF-8, but Unicode (UTF-16, LITTLE-ENDIAN) is the best option when you are making the XML files yourself.

Clean URLs

A URL without a filename must end with a slash:

http://www.blufftitler.com/

Examples

You can find some dynamic content examples in the Media\Shows\DynamicContent folder.

Generate show files

BluffTitler show files are simple text files. This makes it easy to generate them. With this method you can make any aspect of the show dynamic. Choose the Version tab of the <Ctrl><F1> dialog for a description of the file format codes.

Below you can find an example of a PHP script that generates a BluffTitler show file. You can set the rotation speed with a HTML form.

<?php
$Speed=0;
if(!isset($_REQUEST['SPEED'])){
?>
<html>
 <body>
  <h1>BluffTitler Show Generator</h1>
  <form method='get'>
   Rotation Speed <input type='text' name='SPEED' id='SPEED' value='1' />
   <input type='submit' value='Generate Show' />
  </form>
 </body>
</html>
<?php
return;
}

$Speed=(int)$_REQUEST['SPEED'];

header('content-type:application/bt');
header('Content-Disposition:attachment; filename=example.bt');

echo "BluffTitler Show 4\n";
echo "LEN	3000\n";
echo "SIZ	640	360\n";
echo "PAR	1\n";
echo "BGC	-1	-1	-1\n";
echo "\n";
echo "LAY	Camera\n";
echo "TP1	0\n";
echo "TP2	0\n";
echo "TP3	0\n";
echo "PHY	0\n";
echo "VIS	Y\n";
echo "KEY	0\n";
echo "POS	0	0	0\n";
echo "ROT	0	0	0\n";
echo "FOV	0.785398\n";
echo "SIZ	300\n";
echo "DRC	0	0	0\n";
echo "\n";
echo "LAY	Light\n";
echo "TP1	2\n";
echo "TP2	0\n";
echo "PHY	0\n";
echo "VIS	Y\n";
echo "KEY	0\n";
echo "POS	0	0	-200\n";
echo "COL	1	1	1\n";
echo "INT	1\n";
echo "BEA	0\n";
echo "BEC	1	1	1\n";
echo "SHA	0\n";
echo "SHC	0	0	0\n";
echo "SOF	0\n";
echo "FLS	100\n";
echo "FLC	1	1	1\n";
echo "PAL	0\n";
echo "\n";
echo "LAY	Text\n";
echo "TXT	\"Bluff<br />Titler\"\n";
echo "TP1	2\n";
echo "TP3	0\n";
echo "TP2	0\n";
echo "PHY	0\n";
echo "VIS	Y\n";
echo "FNA	\"Arial Black\"	19	0	0	N\n";
echo "KEY	0\n";
echo "POS	0	0	400\n";
echo "ROT	0	0	0\n";
echo "CRO	0	0	0\n";
echo "FSI	1\n";
echo "SCA	1	1	1\n";
echo "CSC	1	1	1\n";
echo "COL	1	1	1\n";
echo "ALP	0\n";
echo "SPE	0\n";
echo "SPA	10	10	10\n";
echo "SPW	1\n";
echo "KER	1\n";
echo "SHE	0	0	0\n";
echo "TWI	0	0	0\n";
echo "BEV	1	1	0\n";
echo "WRI	1	0\n";
echo "CDL	0	0	0\n";
echo "ENC	0\n";
echo "TEP	0	0\n";
echo "TES	80	80\n";
echo "SLP	5	5	0\n";
echo "SLR	0\n";
echo "PIX	0.5	0.8	0\n";
echo "HAD	5\n";
echo "HAI	1	1	1\n";
echo "REV	6.28319	0	0\n";
echo "JUM	0	0	0\n";
echo "XPL	0	0\n";
echo "MAX	0	0\n";
echo "BIA	0\n";
echo "PAL	0\n";
echo "KEY	3000\n";
echo "ROT	".$Speed*6.28319." 0 0\n";
?>