Class ContentProcessorContext
Provides access to custom processor parameters, methods for converting member data, and triggering nested builds.
public abstract class ContentProcessorContext
- Inheritance
-
ContentProcessorContext
- Derived
- Inherited Members
Constructors
ContentProcessorContext()
Initializes a new instance of ContentProcessorContext.
public ContentProcessorContext()
Properties
BuildConfiguration
Gets the name of the current content build configuration.
public abstract string BuildConfiguration { get; }
Property Value
IntermediateDirectory
Gets the path of the directory that will contain any intermediate files generated by the content processor.
public abstract string IntermediateDirectory { get; }
Property Value
Logger
Gets the logger interface used for status messages or warnings.
public abstract ContentBuildLogger Logger { get; }
Property Value
OutputDirectory
Gets the output path of the content processor.
public abstract string OutputDirectory { get; }
Property Value
OutputFilename
Gets the output file name of the content processor.
public abstract string OutputFilename { get; }
Property Value
Parameters
Gets the collection of parameters used by the content processor.
public abstract OpaqueDataDictionary Parameters { get; }
Property Value
SourceIdentity
Gets the ContentIdentity representing the source asset imported.
public abstract ContentIdentity SourceIdentity { get; }
Property Value
TargetPlatform
Gets the current content build target platform.
public abstract TargetPlatform TargetPlatform { get; }
Property Value
TargetProfile
Gets the current content build target profile.
public abstract GraphicsProfile TargetProfile { get; }
Property Value
Methods
AddDependency(string)
Adds a dependency to the specified file. This causes a rebuild of the file, when modified, on subsequent incremental builds.
public abstract void AddDependency(string filename)
Parameters
filename
stringName of an asset file.
AddOutputFile(string)
Add a file name to the list of related output files maintained by the build item. This allows tracking build items that build multiple output files.
public abstract void AddOutputFile(string filename)
Parameters
filename
stringThe name of the file.
BuildAndLoadAsset<TInput, TOutput>(ExternalReference<TInput>, string)
Initiates a nested build of the specified asset and then loads the result into memory.
public TOutput BuildAndLoadAsset<TInput, TOutput>(ExternalReference<TInput> sourceAsset, string processorName)
Parameters
sourceAsset
ExternalReference<TInput>Reference to the source asset.
processorName
stringOptional processor for this content.
Returns
- TOutput
Copy of the final converted content.
Type Parameters
TInput
Type of the input.
TOutput
Type of the converted output.
Remarks
An example of usage would be a mesh processor calling BuildAndLoadAsset to build any associated textures and replace the original .tga file references with an embedded copy of the converted texture.
BuildAndLoadAsset<TInput, TOutput>(ExternalReference<TInput>, string, OpaqueDataDictionary, string)
Initiates a nested build of the specified asset and then loads the result into memory.
public abstract TOutput BuildAndLoadAsset<TInput, TOutput>(ExternalReference<TInput> sourceAsset, string processorName, OpaqueDataDictionary processorParameters, string importerName)
Parameters
sourceAsset
ExternalReference<TInput>Reference to the source asset.
processorName
stringOptional processor for this content.
processorParameters
OpaqueDataDictionaryOptional collection of named values available as input to the content processor.
importerName
stringOptional importer for this content.
Returns
- TOutput
Copy of the final converted content.
Type Parameters
TInput
Type of the input.
TOutput
Type of the converted output.
Remarks
An example of usage would be a mesh processor calling BuildAndLoadAsset to build any associated textures and replace the original .tga file references with an embedded copy of the converted texture.
BuildAsset<TInput, TOutput>(ExternalReference<TInput>, string)
Initiates a nested build of an additional asset.
public ExternalReference<TOutput> BuildAsset<TInput, TOutput>(ExternalReference<TInput> sourceAsset, string processorName)
Parameters
sourceAsset
ExternalReference<TInput>Reference to the source asset.
processorName
stringOptional processor for this content.
Returns
- ExternalReference<TOutput>
Reference to the final compiled content. The build work is not required to complete before returning. Therefore, this file may not be up to date when BuildAsset returns but it will be available for loading by the game at runtime.
Type Parameters
TInput
Type of the input.
TOutput
Type of the output.
Remarks
An example of usage for BuildAsset is being called by a mesh processor to request that any related textures used are also built, replacing the original TGA file references with new references to the converted texture files.
BuildAsset<TInput, TOutput>(ExternalReference<TInput>, string, OpaqueDataDictionary, string, string)
Initiates a nested build of an additional asset.
public abstract ExternalReference<TOutput> BuildAsset<TInput, TOutput>(ExternalReference<TInput> sourceAsset, string processorName, OpaqueDataDictionary processorParameters, string importerName, string assetName)
Parameters
sourceAsset
ExternalReference<TInput>Reference to the source asset.
processorName
stringOptional processor for this content.
processorParameters
OpaqueDataDictionaryOptional collection of named values available as input to the content processor.
importerName
stringOptional importer for this content.
assetName
stringOptional name of the final compiled content.
Returns
- ExternalReference<TOutput>
Reference to the final compiled content. The build work is not required to complete before returning. Therefore, this file may not be up to date when BuildAsset returns but it will be available for loading by the game at runtime.
Type Parameters
TInput
Type of the input.
TOutput
Type of the output.
Remarks
An example of usage for BuildAsset is being called by a mesh processor to request that any related textures used are also built, replacing the original TGA file references with new references to the converted texture files.
Convert<TInput, TOutput>(TInput, string)
Converts a content item object using the specified content processor.
public TOutput Convert<TInput, TOutput>(TInput input, string processorName)
Parameters
input
TInputSource content to be converted.
processorName
stringOptional processor for this content.
Returns
- TOutput
Reference of the final converted content.
Type Parameters
TInput
Type of the input content.
TOutput
Type of the converted output.
Convert<TInput, TOutput>(TInput, string, OpaqueDataDictionary)
Converts a content item object using the specified content processor.
public abstract TOutput Convert<TInput, TOutput>(TInput input, string processorName, OpaqueDataDictionary processorParameters)
Parameters
input
TInputSource content to be converted.
processorName
stringOptional processor for this content.
processorParameters
OpaqueDataDictionaryOptional parameters for the processor.
Returns
- TOutput
Reference of the final converted content.
Type Parameters
TInput
Type of the input content.
TOutput
Type of the converted output.