]> git.sesse.net Git - casparcg/commitdiff
[scene] #564 Made a crawler example scene.
authorHelge Norberg <helge.norberg@svt.se>
Wed, 8 Mar 2017 16:50:36 +0000 (17:50 +0100)
committerHelge Norberg <helge.norberg@svt.se>
Wed, 8 Mar 2017 16:50:36 +0000 (17:50 +0100)
deploy/general/server/font/Roboto-Regular.ttf [new file with mode: 0644]
deploy/general/server/template/scene/crawler/crawler.scene [new file with mode: 0644]

diff --git a/deploy/general/server/font/Roboto-Regular.ttf b/deploy/general/server/font/Roboto-Regular.ttf
new file mode 100644 (file)
index 0000000..3e6e2e7
Binary files /dev/null and b/deploy/general/server/font/Roboto-Regular.ttf differ
diff --git a/deploy/general/server/template/scene/crawler/crawler.scene b/deploy/general/server/template/scene/crawler/crawler.scene
new file mode 100644 (file)
index 0000000..998e562
--- /dev/null
@@ -0,0 +1,77 @@
+<scene width="1920" height="1080" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/CasparCG/Server/2.1.0/core/producer/scene/scene.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <!--
+    An example crawler scene. Does not support the "tail" on screen at the same
+    time as the "head", but otherwise a good demonstration of combined use of
+    timeline for intro, outro animations and the frame variable for "infinite"
+    animations.
+   -->
+  <variables>
+    <variable type="string" id="text"       public="true">Needs "text", Use "speed" to set pixels per frame, Use "iterations" to specify how many times the crawler should repeat.</variable>
+    <variable type="number" id="speed"      public="true">4</variable>
+    <variable type="number" id="iterations" public="true">2</variable>
+
+    <!-- The scrolling is done without the timeline, only with the use of the global frame counter. -->
+    <variable type="number" id="text_num_pixels_wait">${20 * speed}</variable>
+    <variable type="number" id="scroll_distance">     ${layer.text.width + scene_width + variable.text_num_pixels_wait}</variable>
+    <variable type="number" id="current_text_pos">    ${(-frame * speed) % variable.scroll_distance + scene_width + variable.text_num_pixels_wait}</variable>
+    <variable type="number" id="current_iteration">   ${( frame * speed) / variable.scroll_distance}</variable>
+
+    <!-- Controlled by timeline. -->
+    <variable type="number" id="animation_pos_x">0</variable>
+  </variables>
+
+  <layers>
+    <layer id="plate">
+      <producer>RED</producer>
+      <x>${variable.animation_pos_x}</x>
+      <y>50</y>
+      <width>${scene_width}</width>
+      <height>60</height>
+      <adjustments>
+        <opacity>0.8</opacity>
+      </adjustments>
+    </layer>
+
+    <!-- Mask of text needed on out animation to not make the rest of the text visible -->
+    <layer id="mask">
+      <producer>WHITE</producer>
+      <x>${layer.plate.x}</x>
+      <y>${layer.plate.y}</y>
+      <width>${layer.plate.width}</width>
+      <height>${layer.plate.height}</height>
+      <is_key>true</is_key>
+    </layer>
+
+    <layer id="text">
+      <producer>[TEXT] "" 0 0 size 35 color white font Roboto-Regular</producer>
+      <x>${variable.current_text_pos + variable.animation_pos_x}</x>
+      <y>${layer.plate.y + layer.plate.height - 18}</y>
+      <parameters>
+        <text>${text}</text>
+      </parameters>
+    </layer>
+  </layers>
+
+  <marks>
+    <mark at="0" type="start" label="intro" />
+    <mark at="20" type="stop" />
+    <mark at="20" type="start" label="outro" />
+    <mark at="40" type="remove" />
+  </marks>
+
+  <tasks>
+    <goto_mark when="${variable.current_iteration &gt; iterations}" label="outro" />
+  </tasks>
+
+  <timelines>
+    <timeline variable="variable.animation_pos_x">
+      <keyframe at="0">${scene_width}</keyframe>
+      <keyframe at="20" easing="easeoutsine">0</keyframe>
+      <keyframe at="40" easing="easeoutsine">${-scene_width}</keyframe>
+    </timeline>
+    <timeline variable="layer.mask.adjustment.brightness">
+      <keyframe at="20">1</keyframe>
+      <keyframe at="40" easing="linear">0</keyframe>
+    </timeline>
+  </timelines>
+</scene>