]> git.sesse.net Git - casparcg/commitdiff
[scene] Continued documentation of the scene producer.
authorHelge Norberg <helge.norberg@svt.se>
Wed, 8 Feb 2017 19:35:06 +0000 (20:35 +0100)
committerHelge Norberg <helge.norberg@svt.se>
Wed, 8 Feb 2017 19:35:06 +0000 (20:35 +0100)
core/producer/scene/scene.xsd

index a8d81407c563cb50e079e97b4821336c5cffb820..7e9a2297466a55c5bb0f87c44da0f9a7d04d67db 100644 (file)
@@ -3,6 +3,17 @@
     <xs:complexType>
       <xs:sequence>
         <xs:element name="variables">
+          <xs:annotation>
+            <xs:documentation>
+              Variables are the core of the scene producer realtime animation possibilities.
+              In this section the user defined variables are specified.
+              Public variables are accessible as CG parameters and by the parent scene when nested inside another.
+              There are some variables that are always defined like
+              "frame" which stores the number of frames that have gone by since the scene producer started,
+              "mouse_x" and "mouse_y" which reflect the X and Y position of the mouse at all times relative to the scene coordinate system (requires interaction aware consumer like screen_consumer) and
+              "timeline_frame" which differs from "frame" in that it can rewind and jump, depending on where the timeline is at the moment.
+            </xs:documentation>
+          </xs:annotation>
           <xs:complexType>
             <xs:sequence>
               <xs:element name="variable" maxOccurs="unbounded" minOccurs="0">
@@ -22,9 +33,9 @@
                       </xs:documentation>
                     </xs:annotation>
                     <xs:extension base="expression">
-                      <xs:attribute type="type" name="type" use="required" />
-                      <xs:attribute type="identifier" name="id" use="required" />
-                      <xs:attribute type="boolean" name="public" use="required" />
+                      <xs:attribute type="type" name="type" use="required"><xs:annotation><xs:documentation>The variable type. The value/expression of the variable must be parseable/resolvable as/to this type.</xs:documentation></xs:annotation></xs:attribute>
+                      <xs:attribute type="identifier" name="id" use="required"><xs:annotation><xs:documentation>The unique variable name. Will be exposed as [id] if the variable is public or variable.[id] otherwise.</xs:documentation></xs:annotation></xs:attribute>
+                      <xs:attribute type="boolean" name="public" use="required"><xs:annotation><xs:documentation>Whether the variable should be accessible from outside the scene or not. Public variables can be accessed via CG UPDATE, CG ADD and as layer.[layerid].parameter.[id] when nested inside another scene.</xs:documentation></xs:annotation></xs:attribute>
                     </xs:extension>
                   </xs:simpleContent>
                 </xs:complexType>
@@ -39,7 +50,9 @@
         <xs:element name="layers">
           <xs:annotation>
             <xs:documentation>
-              The layers of the scene. The layers defined first will be above the ones defined after. All properties of each layer are addressable from expressions as layer.[id].[property]. layer.[id].width and layer.[id].height are always calculated based on the producer on the layer.
+              The layers of the scene.
+              The layers defined first will be above the ones defined after.
+              All properties of each layer are addressable from expressions as layer.[id].[property].
             </xs:documentation>
           </xs:annotation>
           <xs:complexType>
@@ -51,6 +64,8 @@
                     <xs:element type="bool_expression" name="hidden" minOccurs="0" default="false">                 <xs:annotation><xs:documentation>Hides the layer if true. Can be an expression.</xs:documentation></xs:annotation></xs:element>
                     <xs:element type="number_expression" name="x">                                                  <xs:annotation><xs:documentation>The X coordinate of the layer in the scene coordinate system. Can be an expression.</xs:documentation></xs:annotation></xs:element>
                     <xs:element type="number_expression" name="y">                                                  <xs:annotation><xs:documentation>The Y coordinate of the layer in the scene coordinate system. Can be an expression.</xs:documentation></xs:annotation></xs:element>
+                    <xs:element type="number_expression" name="width" minOccurs="0">                                <xs:annotation><xs:documentation>The width of the layer. Is by default calculated by the producer itself but can be overridden. Can be an expression.</xs:documentation></xs:annotation></xs:element>
+                    <xs:element type="number_expression" name="height" minOccurs="0">                               <xs:annotation><xs:documentation>The height of the layer. Is by default calculated by the producer itself but can be overridden. Can be an expression.</xs:documentation></xs:annotation></xs:element>
                     <xs:element type="number_expression" name="anchor_x" minOccurs="0" default="0">                 <xs:annotation><xs:documentation>The X anchor within the layer coordinate system where position and rotation are done relative to/around. Can be an expression.</xs:documentation></xs:annotation></xs:element>
                     <xs:element type="number_expression" name="anchor_y" minOccurs="0" default="0">                 <xs:annotation><xs:documentation>The Y anchor within the layer coordinate system where position and rotation are done relative to/around. Can be an expression.</xs:documentation></xs:annotation></xs:element>
                     <xs:element type="number_expression" name="rotation" minOccurs="0" default="0.0">               <xs:annotation><xs:documentation>The rotation of the layer around anchor_x/anchor_y expressed in degrees. Can be an expression.</xs:documentation></xs:annotation></xs:element>
                     <xs:element type="number_expression" name="perspective_lower_left_x" minOccurs="0" default="0"> <xs:annotation><xs:documentation>The X position within the layer coordinate system to corner pin the lower left corner. Can be an expression.</xs:documentation></xs:annotation></xs:element>
                     <xs:element type="number_expression" name="perspective_lower_left_y" minOccurs="0">             <xs:annotation><xs:documentation>The Y position within the layer coordinate system to corner pin the lower left corner. Can be an expression.</xs:documentation></xs:annotation></xs:element>
                     <xs:element name="adjustment" minOccurs="0">
+                      <xs:annotation>
+                        <xs:documentation>
+                          Properties regarding image adjustments. They are addressable from expressions as layer.[id].adjustment.[property].
+                        </xs:documentation>
+                      </xs:annotation>
                       <xs:complexType>
                         <xs:all>
                           <xs:element type="number_expression" name="opacity" minOccurs="0" default="1.0">          <xs:annotation><xs:documentation>The opacity of the layer. Can be an expression.</xs:documentation></xs:annotation></xs:element>
                         </xs:all>
                       </xs:complexType>
                     </xs:element>
+                    <xs:element name="parameters" minOccurs="0">
+                      <xs:annotation>
+                        <xs:documentation>
+                          A producer can expose variables that can be referenced from the scene.
+                          The element names used here should reflect the name of the parameter that should be set.
+                          Even if a parameter is not defined here they can still be accessed by other expressions under layer.[id].parameter.[variable].
+                          If a scene producer is nested inside a scene producer its variables marked public will be available.
+                          If a text producer exposes "text", "tracking", "current_bearing_y" and "current_protrude_under_y"
+                        </xs:documentation>
+                      </xs:annotation>
+                      <xs:complexType>
+                        <xs:sequence>
+                          <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip" />
+                        </xs:sequence>
+                      </xs:complexType>
+                    </xs:element>
                   </xs:all>
                   <xs:attribute type="identifier" name="id" use="required" />
                 </xs:complexType>
             <xs:field xpath="@id" />
           </xs:unique>
         </xs:element>
+        <xs:element name="marks" minOccurs="0">
+          <xs:annotation>
+            <xs:documentation>
+              Marks are placed on specific timeline frames and marks start of animation sequences, stop of animation sequence and removal of the entire scene.
+              They affect what happens when CG PLAY, CG STOP, CG INVOKE and CG NEXT are sent via AMCP.
+            </xs:documentation>
+          </xs:annotation>
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="mark" minOccurs="0" maxOccurs="unbounded">
+                <xs:annotation>
+                  <xs:documentation>
+                    One of the mark types is "start" which marks the start of a named animation. There is an implicit start mark at frame 0 called "intro" which is started when CG PLAY is executed. The "intro" animation can be defined at another frame if desired. There is another start mark that should be called "outro" which is coupled to CG STOP. Any other start mark is used with CG INVOKE.
+                    Another mark type is "stop" which makes the timeline stop when reached. The only thing that can make the timeline move again is a CG NEXT, CG STOP or a CG INVOKE.
+                    The "jump_to" mark type tells the timeline to jump to another "start" whenever reached, enabling the possibility of creating animation loops.
+                    The last mark type is "remove" with the only purpose of completely stopping rendering when reached. It is used instead of "stop" to mark the end of the "outro" animation.
+                    Note that a "stop" or "jump_to" can be on the same frame as a "start" for example on end of intro and start of outro. There will be no conflict in this case when outro is started.
+                  </xs:documentation>
+                </xs:annotation>
+                <xs:complexType>
+                  <xs:attribute type="xs:nonNegativeInteger" name="at" use="required"><xs:annotation><xs:documentation>The timeline frame to place the mark at.</xs:documentation></xs:annotation></xs:attribute>
+                  <xs:attribute type="mark_action" name="type" use="required">
+                    <xs:annotation>
+                      <xs:documentation>
+                        The type of mark.
+                        "start" marks the start of an animation sequence.
+                        "stop" means that any animation should stop at the marked frame.
+                        "jump_to" means that the entire timeline should jump to the mentioned start label whenever the frame is encountered.
+                        "remove" is usually the end of the "outro" animation and causes the scene to stop rendering completely.
+                      </xs:documentation>
+                    </xs:annotation>
+                  </xs:attribute>
+                  <xs:attribute type="identifier" name="label" use="optional"><xs:annotation><xs:documentation>Is only used for "start" and "jump_to" marks and defines the name of the animation for "start" and the destination start for "jump_to".</xs:documentation></xs:annotation></xs:attribute>
+                </xs:complexType>
+              </xs:element>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
         <xs:element name="timelines" minOccurs="0">
           <xs:complexType>
             <xs:sequence>
       <xs:pattern value="true|false|\$\{.+\}" />
     </xs:restriction>
   </xs:simpleType>
+  <xs:simpleType name="mark_action">
+    <xs:restriction base="xs:string">
+      <xs:whiteSpace value="collapse" />
+      <xs:enumeration value="start" />
+      <xs:enumeration value="stop" />
+      <xs:enumeration value="jump_to" />
+      <xs:enumeration value="remove" />
+    </xs:restriction>
+  </xs:simpleType>
 </xs:schema>