Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

Using batch processing, the Resource Compiler (RC) is able to batch process all of the asset files for a specific platform in one go only.

...

Table of Contents
maxLevel4
minLevel2
excludeOverview

Job XML Format

The Job XML format is specified using an XML file, which you can edit using any Text Editor of your choosing.

...

Code Block
languagexml
<RCJobs>
	<!-- contents of the file -->
</RCJobs>

Properties

It is important to understand that a Job XML is a template for a build, which is specialized using parameters passed on the command line. Generally speaking the most important is the 'p' parameter (platform).

...

Property values can be accessed inside the Job XML script using the '${propertyname}' construct, which can be used to set other properties, or to conditionally execute parts of the batch.

Default Properties

Depending on the complexity of a batch script, the number of properties used may become significant and typing values on the command line may become a nuisance.

...

Info
Command-line parameters override properties specified in a DefaultProperties block.

Computed Properties 

You may wish to dynamically compute properties depending on the values of other properties.

...

Unlike default properties, properties defined through a <Properties> block are not conditional, the property value will be updated regardless of any command-line parameters with the same name.

Conditionals (if & ifnot)

Sometimes, it makes sense to only execute a certain processing step for a specific platform, or alternate processing of specific assets depending on some property.

...

Code Block
languagexml
<if propertyname='compare'>
	<!-- only evaluated if the value of property 'propertyname' is equal to 'compare' -->
</if>
 
<ifnot propertyname='compare'>
	<!-- only evaluated if the value of property 'propertyname' is not equal to 'compare' -->
</ifnot>
 
<!-- it's also possible to compare to another property value -->
<if propertyname='${anotherproperty}' />

Scope

Properties in an RC script have a certain scope. In general the XML is evaluated sequentially and property values are persistent.

...

  • DefaultProperties blocks
  • Properties blocks
  • Job blocks
  • Run blocks

Asset Conversion Jobs

Asset conversion is defined through <Job> XML blocks, and that execute serially (although the sub-parts of some jobs can be executed in parallel - see the RC property threads).

...

Note

Please note that any job that is run with SourceRoot==TargetRoot will not match any files (and thus will do nothing) regardless of actual files.
The RC has several transformations that do not change the filename of the source or the target (as this would cause problems), and even though there are several transformations that could work, for simplicity this is treated as an error.

Pass-through (copy)

Sometimes it makes sense to not do any processing for a given set of files.

...

Code Block
languagexml
<CopyJob>
	<Job sourceroot="${source_folder}" input="*.xml" targetroot="${target_folder}" copyonly="1" />
</CopyJob>

Input Set

The input set can be further controlled by the following special properties:

  • recursive: (default is 1).
    When set to 0 the search will only consider files in the 'sourceroot ' folder, but not in subfolders.
  • input: (default is '*').
    Matches the relative path to the specified expression(s) and only passes files that match one or more of the expression(s).
    Use '*' to indicate zero or that more characters are accepted in that location.
    Split multiple expressions using semicolons, '*.a;*.b' will pass all filenames ending with '.a' or '.b'
  • exclude: (default is none).
    Like "input", except any file matching the expression(s) is not passed.
    Exclude overrides "input", so a file matching both expressions will NOT be in the input set.
  • listfile (default is none).
    Opens the specified expression as a text file and restricts the input set to any file in the list.
    The list file is a a text file, with each file on a separate line.
  • exclude_listfile (default is none).
    Like 'listfile' exception, any file matching the list is not passed.
    Exclude overrides 'listfile', so a file in both lists will NOT be in the input set.

File Type Override

Sometimes, you might want to interpret a specific file with a specific type, even though it doesn't have a matching extension.

...

Code Block
languagexml
<Job input="*.mtl" overwriteextension="xml" ...rest of the job... />

Packing Jobs

Once you have converted and/or copied all the files that should be provided on the end user file system you can pack them into *.pak files.

...

When set to 0 the *.pak file will not be compressed, this might be suitable for certain files that frequently require file seeking at runtime. 

Running Jobs

Once you have specified all the job groups that you need, you can run them using a <Run> block:

...