]> git.sesse.net Git - casparcg/blob - core/producer/scene/scene.xsd
[scene] Continued documentation of the scene producer.
[casparcg] / core / producer / scene / scene.xsd
1 <xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
2   <xs:element name="scene">
3     <xs:complexType>
4       <xs:sequence>
5         <xs:element name="variables">
6           <xs:annotation>
7             <xs:documentation>
8               Variables are the core of the scene producer realtime animation possibilities.
9               In this section the user defined variables are specified.
10               Public variables are accessible as CG parameters and by the parent scene when nested inside another.
11               There are some variables that are always defined like
12               "frame" which stores the number of frames that have gone by since the scene producer started,
13               "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
14               "timeline_frame" which differs from "frame" in that it can rewind and jump, depending on where the timeline is at the moment.
15             </xs:documentation>
16           </xs:annotation>
17           <xs:complexType>
18             <xs:sequence>
19               <xs:element name="variable" maxOccurs="unbounded" minOccurs="0">
20                 <xs:annotation>
21                   <xs:documentation>
22                     A scene variable can be referenced in expressions.
23                     It is defined under variable.[id] unless it is public because then it is in the global namespace [id].
24                   </xs:documentation>
25                 </xs:annotation>
26                 <xs:complexType>
27                   <xs:simpleContent>
28                     <xs:annotation>
29                       <xs:documentation>
30                         Could be a constant or an expression.
31                         An expression is written as ${expr}.
32                         Must be parseable/resolved as the type specified.
33                       </xs:documentation>
34                     </xs:annotation>
35                     <xs:extension base="expression">
36                       <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>
37                       <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>
38                       <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>
39                     </xs:extension>
40                   </xs:simpleContent>
41                 </xs:complexType>
42               </xs:element>
43             </xs:sequence>
44           </xs:complexType>
45           <xs:unique name="uniqueVariableNames">
46             <xs:selector xpath="variable" />
47             <xs:field xpath="@id" />
48           </xs:unique>
49         </xs:element>
50         <xs:element name="layers">
51           <xs:annotation>
52             <xs:documentation>
53               The layers of the scene.
54               The layers defined first will be above the ones defined after.
55               All properties of each layer are addressable from expressions as layer.[id].[property].
56             </xs:documentation>
57           </xs:annotation>
58           <xs:complexType>
59             <xs:sequence>
60               <xs:element name="layer" minOccurs="0" maxOccurs="unbounded">
61                 <xs:complexType>
62                   <xs:all>
63                     <xs:element type="xs:string" name="producer">                                                   <xs:annotation><xs:documentation>The same syntax as in AMCP after for example PLAY 1-10. Cannot be an expression.</xs:documentation></xs:annotation></xs:element>
64                     <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>
65                     <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>
66                     <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>
67                     <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>
68                     <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>
69                     <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>
70                     <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>
71                     <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>
72                     <xs:element type="number_expression" name="crop_upper_left_x" minOccurs="0" default="0">        <xs:annotation><xs:documentation>The X position within the layer coordinate system to crop the upper left corner. Can be an expression.</xs:documentation></xs:annotation></xs:element>
73                     <xs:element type="number_expression" name="crop_upper_left_y" minOccurs="0" default="0">        <xs:annotation><xs:documentation>The Y position within the layer coordinate system to crop the upper left corner. Can be an expression.</xs:documentation></xs:annotation></xs:element>
74                     <xs:element type="number_expression" name="crop_lower_right_x" minOccurs="0">                   <xs:annotation><xs:documentation>The X position within the layer coordinate system to crop the lower right corner. Can be an expression.</xs:documentation></xs:annotation></xs:element>
75                     <xs:element type="number_expression" name="crop_lower_right_y" minOccurs="0">                   <xs:annotation><xs:documentation>The Y position within the layer coordinate system to crop the lower right corner. Can be an expression.</xs:documentation></xs:annotation></xs:element>
76                     <xs:element type="number_expression" name="perspective_upper_left_x" minOccurs="0" default="0"> <xs:annotation><xs:documentation>The X position within the layer coordinate system to corner pin the upper left corner. Can be an expression.</xs:documentation></xs:annotation></xs:element>
77                     <xs:element type="number_expression" name="perspective_upper_left_y" minOccurs="0" default="0"> <xs:annotation><xs:documentation>The Y position within the layer coordinate system to corner pin the upper left corner. Can be an expression.</xs:documentation></xs:annotation></xs:element>
78                     <xs:element type="number_expression" name="perspective_upper_right_x" minOccurs="0">            <xs:annotation><xs:documentation>The X position within the layer coordinate system to corner pin the upper right corner. Can be an expression.</xs:documentation></xs:annotation></xs:element>
79                     <xs:element type="number_expression" name="perspective_upper_right_y" minOccurs="0" default="0"><xs:annotation><xs:documentation>The Y position within the layer coordinate system to corner pin the upper right corner. Can be an expression.</xs:documentation></xs:annotation></xs:element>
80                     <xs:element type="number_expression" name="perspective_lower_right_x" minOccurs="0">            <xs:annotation><xs:documentation>The X position within the layer coordinate system to corner pin the lower right corner. Can be an expression.</xs:documentation></xs:annotation></xs:element>
81                     <xs:element type="number_expression" name="perspective_lower_right_y" minOccurs="0">            <xs:annotation><xs:documentation>The Y position within the layer coordinate system to corner pin the lower right corner. Can be an expression.</xs:documentation></xs:annotation></xs:element>
82                     <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>
83                     <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>
84                     <xs:element name="adjustment" minOccurs="0">
85                       <xs:annotation>
86                         <xs:documentation>
87                           Properties regarding image adjustments. They are addressable from expressions as layer.[id].adjustment.[property].
88                         </xs:documentation>
89                       </xs:annotation>
90                       <xs:complexType>
91                         <xs:all>
92                           <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>
93                         </xs:all>
94                       </xs:complexType>
95                     </xs:element>
96                     <xs:element type="bool_expression" name="is_key" minOccurs="0" default="false">                 <xs:annotation><xs:documentation>If true causes the layer to key the layer above. Can be an expression.</xs:documentation></xs:annotation></xs:element>
97                     <xs:element type="bool_expression" name="use_mipmap" minOccurs="0" default="false">             <xs:annotation><xs:documentation>Whether to enable mipmapping on the layer or not. Can be an expression.</xs:documentation></xs:annotation></xs:element>
98                     <xs:element type="string_expression" name="blend_mode" minOccurs="0" default="normal">          <xs:annotation><xs:documentation>The blend mode to use. Can be an expression.</xs:documentation></xs:annotation></xs:element>
99                     <xs:element name="chroma_key" minOccurs="0">
100                       <xs:complexType>
101                         <xs:all>
102                           <xs:element type="bool_expression" name="enable" minOccurs="0" default="false">           <xs:annotation><xs:documentation>Whether to enable chroma keying on the layer or not. Can be an expression.</xs:documentation></xs:annotation></xs:element>
103                           <xs:element type="number_expression" name="target_hue" minOccurs="0" default="120.0">     <xs:annotation><xs:documentation>The degrees within 0-360 of the hue window centrum of the color to key. Can be an expression.</xs:documentation></xs:annotation></xs:element>
104                           <xs:element type="number_expression" name="hue_width" minOccurs="0" default="0.1">        <xs:annotation><xs:documentation>How wide within 0.0-1.0 the hue window of the color to key should be. Can be an expression.</xs:documentation></xs:annotation></xs:element>
105                           <xs:element type="number_expression" name="min_saturation" minOccurs="0" default="0.0">   <xs:annotation><xs:documentation>The minimum saturation within 0.0-1.0 of the color to key. Can be an expression.</xs:documentation></xs:annotation></xs:element>
106                           <xs:element type="number_expression" name="min_brightness" minOccurs="0" default="0.0">   <xs:annotation><xs:documentation>The minimum brightness within 0.0-1.0 of the color to key. Can be an expression.</xs:documentation></xs:annotation></xs:element>
107                           <xs:element type="number_expression" name="softness" minOccurs="0" default="0.0">         <xs:annotation><xs:documentation>How soft the chroma key window should be within 0.0-1.0. Can be an expression.</xs:documentation></xs:annotation></xs:element>
108                           <xs:element type="number_expression" name="spill" minOccurs="0" default="1.0">            <xs:annotation><xs:documentation>How much of the chroma fringing should be left within 0.0-1.0. Values below 1.0 gradually replaces the fringe with a gray scale and more transparent equivalent. Can be an expression.</xs:documentation></xs:annotation></xs:element>
109                           <xs:element type="number_expression" name="spill_darken" minOccurs="0" default="2.0">     <xs:annotation><xs:documentation>Defined how dark the spill replacement gray scale should be. The default is 2.0 but can be anywhere between 0.0 and up. Can be an expression.</xs:documentation></xs:annotation></xs:element>
110                         </xs:all>
111                       </xs:complexType>
112                     </xs:element>
113                     <xs:element name="parameters" minOccurs="0">
114                       <xs:annotation>
115                         <xs:documentation>
116                           A producer can expose variables that can be referenced from the scene.
117                           The element names used here should reflect the name of the parameter that should be set.
118                           Even if a parameter is not defined here they can still be accessed by other expressions under layer.[id].parameter.[variable].
119                           If a scene producer is nested inside a scene producer its variables marked public will be available.
120                           If a text producer exposes "text", "tracking", "current_bearing_y" and "current_protrude_under_y"
121                         </xs:documentation>
122                       </xs:annotation>
123                       <xs:complexType>
124                         <xs:sequence>
125                           <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip" />
126                         </xs:sequence>
127                       </xs:complexType>
128                     </xs:element>
129                   </xs:all>
130                   <xs:attribute type="identifier" name="id" use="required" />
131                 </xs:complexType>
132               </xs:element>
133             </xs:sequence>
134           </xs:complexType>
135           <xs:unique name="uniqueLayerNames">
136             <xs:selector xpath="layer" />
137             <xs:field xpath="@id" />
138           </xs:unique>
139         </xs:element>
140         <xs:element name="marks" minOccurs="0">
141           <xs:annotation>
142             <xs:documentation>
143               Marks are placed on specific timeline frames and marks start of animation sequences, stop of animation sequence and removal of the entire scene.
144               They affect what happens when CG PLAY, CG STOP, CG INVOKE and CG NEXT are sent via AMCP.
145             </xs:documentation>
146           </xs:annotation>
147           <xs:complexType>
148             <xs:sequence>
149               <xs:element name="mark" minOccurs="0" maxOccurs="unbounded">
150                 <xs:annotation>
151                   <xs:documentation>
152                     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.
153                     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.
154                     The "jump_to" mark type tells the timeline to jump to another "start" whenever reached, enabling the possibility of creating animation loops.
155                     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.
156                     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.
157                   </xs:documentation>
158                 </xs:annotation>
159                 <xs:complexType>
160                   <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>
161                   <xs:attribute type="mark_action" name="type" use="required">
162                     <xs:annotation>
163                       <xs:documentation>
164                         The type of mark.
165                         "start" marks the start of an animation sequence.
166                         "stop" means that any animation should stop at the marked frame.
167                         "jump_to" means that the entire timeline should jump to the mentioned start label whenever the frame is encountered.
168                         "remove" is usually the end of the "outro" animation and causes the scene to stop rendering completely.
169                       </xs:documentation>
170                     </xs:annotation>
171                   </xs:attribute>
172                   <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>
173                 </xs:complexType>
174               </xs:element>
175             </xs:sequence>
176           </xs:complexType>
177         </xs:element>
178         <xs:element name="timelines" minOccurs="0">
179           <xs:complexType>
180             <xs:sequence>
181               <xs:element name="timeline" minOccurs="0" maxOccurs="unbounded">
182
183               </xs:element>
184             </xs:sequence>
185           </xs:complexType>
186         </xs:element>
187       </xs:sequence>
188       <xs:attribute type="xs:positiveInteger" name="width" />
189       <xs:attribute type="xs:positiveInteger" name="height" />
190     </xs:complexType>
191   </xs:element>
192   <xs:simpleType name="type">
193     <xs:restriction base="xs:string">
194       <xs:whiteSpace value="collapse" />
195       <xs:enumeration value="string" />
196       <xs:enumeration value="number" />
197       <xs:enumeration value="bool" />
198     </xs:restriction>
199   </xs:simpleType>
200   <xs:simpleType name="identifier">
201     <xs:restriction base="xs:string">
202       <xs:whiteSpace value="collapse" />
203       <xs:pattern value="[a-zA-Z_][a-zA-Z0-9_]*" />
204     </xs:restriction>
205   </xs:simpleType>
206   <xs:simpleType name="boolean">
207     <xs:restriction base="xs:string">
208       <xs:whiteSpace value="collapse" />
209       <xs:enumeration value="true" />
210       <xs:enumeration value="false" />
211     </xs:restriction>
212   </xs:simpleType>
213   <xs:simpleType name="expression">
214     <xs:restriction base="xs:string">
215       <xs:annotation>
216         <xs:documentation>
217         </xs:documentation>
218       </xs:annotation>
219     </xs:restriction>
220   </xs:simpleType>
221   <xs:simpleType name="string_expression">
222     <xs:restriction base="expression">
223       <xs:annotation>
224         <xs:documentation>
225         </xs:documentation>
226       </xs:annotation>
227     </xs:restriction>
228   </xs:simpleType>
229   <xs:simpleType name="number_expression">
230     <xs:restriction base="expression">
231       <xs:annotation>
232         <xs:documentation>
233         </xs:documentation>
234       </xs:annotation>
235       <xs:whiteSpace value="collapse" />
236       <xs:pattern value="[+-]?\d+(\.\d+)?|\$\{.+\}" />
237     </xs:restriction>
238   </xs:simpleType>
239   <xs:simpleType name="bool_expression">
240     <xs:restriction base="expression">
241       <xs:annotation>
242         <xs:documentation>
243         </xs:documentation>
244       </xs:annotation>
245       <xs:whiteSpace value="collapse" />
246       <xs:pattern value="true|false|\$\{.+\}" />
247     </xs:restriction>
248   </xs:simpleType>
249   <xs:simpleType name="mark_action">
250     <xs:restriction base="xs:string">
251       <xs:whiteSpace value="collapse" />
252       <xs:enumeration value="start" />
253       <xs:enumeration value="stop" />
254       <xs:enumeration value="jump_to" />
255       <xs:enumeration value="remove" />
256     </xs:restriction>
257   </xs:simpleType>
258 </xs:schema>