]> git.sesse.net Git - casparcg/blob - core/producer/scene/scene.xsd
[scene] Initial work in progress XML Schema for creating Scene producer XML files...
[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:complexType>
7             <xs:sequence>
8               <xs:element name="variable" maxOccurs="unbounded" minOccurs="0">
9                 <xs:annotation>
10                   <xs:documentation>
11                     A scene variable can be referenced in expressions.
12                     It is defined under variable.[id] unless it is public because then it is in the global namespace [id].
13                   </xs:documentation>
14                 </xs:annotation>
15                 <xs:complexType>
16                   <xs:simpleContent>
17                     <xs:annotation>
18                       <xs:documentation>
19                         Could be a constant or an expression.
20                         An expression is written as ${expr}.
21                         Must be parseable/resolved as the type specified.
22                       </xs:documentation>
23                     </xs:annotation>
24                     <xs:extension base="expression">
25                       <xs:attribute type="type" name="type" use="required" />
26                       <xs:attribute type="identifier" name="id" use="required" />
27                       <xs:attribute type="boolean" name="public" use="required" />
28                     </xs:extension>
29                   </xs:simpleContent>
30                 </xs:complexType>
31               </xs:element>
32             </xs:sequence>
33           </xs:complexType>
34           <xs:unique name="uniqueVariableNames">
35             <xs:selector xpath="variable" />
36             <xs:field xpath="@id" />
37           </xs:unique>
38         </xs:element>
39         <xs:element name="layers">
40           <xs:annotation>
41             <xs:documentation>
42               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.
43             </xs:documentation>
44           </xs:annotation>
45           <xs:complexType>
46             <xs:sequence>
47               <xs:element name="layer" minOccurs="0" maxOccurs="unbounded">
48                 <xs:complexType>
49                   <xs:all>
50                     <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>
51                     <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>
52                     <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>
53                     <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>
54                     <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>
55                     <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>
56                     <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>
57                     <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>
58                     <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>
59                     <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>
60                     <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>
61                     <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>
62                     <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>
63                     <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>
64                     <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>
65                     <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>
66                     <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>
67                     <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>
68                     <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>
69                     <xs:element name="adjustment" minOccurs="0">
70                       <xs:complexType>
71                         <xs:all>
72                           <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>
73                         </xs:all>
74                       </xs:complexType>
75                     </xs:element>
76                     <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>
77                     <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>
78                     <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>
79                     <xs:element name="chroma_key" minOccurs="0">
80                       <xs:complexType>
81                         <xs:all>
82                           <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>
83                           <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>
84                           <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>
85                           <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>
86                           <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>
87                           <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>
88                           <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>
89                           <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>
90                         </xs:all>
91                       </xs:complexType>
92                     </xs:element>
93                   </xs:all>
94                   <xs:attribute type="identifier" name="id" use="required" />
95                 </xs:complexType>
96               </xs:element>
97             </xs:sequence>
98           </xs:complexType>
99           <xs:unique name="uniqueLayerNames">
100             <xs:selector xpath="layer" />
101             <xs:field xpath="@id" />
102           </xs:unique>
103         </xs:element>
104         <xs:element name="timelines" minOccurs="0">
105           <xs:complexType>
106             <xs:sequence>
107               <xs:element name="timeline" minOccurs="0" maxOccurs="unbounded">
108
109               </xs:element>
110             </xs:sequence>
111           </xs:complexType>
112         </xs:element>
113       </xs:sequence>
114       <xs:attribute type="xs:positiveInteger" name="width" />
115       <xs:attribute type="xs:positiveInteger" name="height" />
116     </xs:complexType>
117   </xs:element>
118   <xs:simpleType name="type">
119     <xs:restriction base="xs:string">
120       <xs:whiteSpace value="collapse" />
121       <xs:enumeration value="string" />
122       <xs:enumeration value="number" />
123       <xs:enumeration value="bool" />
124     </xs:restriction>
125   </xs:simpleType>
126   <xs:simpleType name="identifier">
127     <xs:restriction base="xs:string">
128       <xs:whiteSpace value="collapse" />
129       <xs:pattern value="[a-zA-Z_][a-zA-Z0-9_]*" />
130     </xs:restriction>
131   </xs:simpleType>
132   <xs:simpleType name="boolean">
133     <xs:restriction base="xs:string">
134       <xs:whiteSpace value="collapse" />
135       <xs:enumeration value="true" />
136       <xs:enumeration value="false" />
137     </xs:restriction>
138   </xs:simpleType>
139   <xs:simpleType name="expression">
140     <xs:restriction base="xs:string">
141       <xs:annotation>
142         <xs:documentation>
143         </xs:documentation>
144       </xs:annotation>
145     </xs:restriction>
146   </xs:simpleType>
147   <xs:simpleType name="string_expression">
148     <xs:restriction base="expression">
149       <xs:annotation>
150         <xs:documentation>
151         </xs:documentation>
152       </xs:annotation>
153     </xs:restriction>
154   </xs:simpleType>
155   <xs:simpleType name="number_expression">
156     <xs:restriction base="expression">
157       <xs:annotation>
158         <xs:documentation>
159         </xs:documentation>
160       </xs:annotation>
161       <xs:whiteSpace value="collapse" />
162       <xs:pattern value="[+-]?\d+(\.\d+)?|\$\{.+\}" />
163     </xs:restriction>
164   </xs:simpleType>
165   <xs:simpleType name="bool_expression">
166     <xs:restriction base="expression">
167       <xs:annotation>
168         <xs:documentation>
169         </xs:documentation>
170       </xs:annotation>
171       <xs:whiteSpace value="collapse" />
172       <xs:pattern value="true|false|\$\{.+\}" />
173     </xs:restriction>
174   </xs:simpleType>
175 </xs:schema>