ProcessorTable

Internal class that stores a context-categorized key-value mapping for transforming third-party package assets. Parsed from raw Dictionary<string, string> data (loaded from a remote catalog), the table organizes entries into typed contexts (VARIABLES, DIRECTORIES, FILES, MATERIALS, etc.) and supports variable expansion — values in DIRECTORIES and FILES contexts can reference VARIABLES entries.

Definition

Namespace: Paragon.Editor.ThirdPartyPackageImporter Assembly: Paragon.Editor.dll

internal class ProcessorTable

Remarks

Data Format

The raw input is a flat Dictionary<string, string> where context headers are keys starting with $ and having empty values. Entries after a context header belong to that context until the next header:

$VARIABLES      → ""          (context header)
{PackagePath}   → "Assets/Third-Party/MyPackage"  (variable)
$DIRECTORIES    → ""          (context header)
Assets/OldPath  → "{PackagePath}/NewPath"           (directory mapping with variable)
$FILES          → ""          (context header)
OldFile.cs      → "NewFile.cs"                      (file mapping)
$MATERIALS      → ""
OldMaterial     → "NewMaterial"
$MESHES         → ""
OldMesh         → "NewMesh"
$ANIMATIONS     → ""
OldClip         → "NewClip"

Variable Expansion

After parsing, the ExpandVariables() method replaces all VARIABLES references in DIRECTORIES and FILES context values. For example, {PackagePath}/Scripts becomes Assets/Third-Party/MyPackage/Scripts.

Lookup Behavior

TryGetValue() iterates through each context flag set in the contexts parameter, checking each context's table in enum order. Returns false for empty string values (treated as "no mapping").

Constructors

Parameter
Type
Description

data

Dictionary<string, string>

Raw key-value data with $CONTEXT headers. Parsed into context tables and variable-expanded

Methods

GetValue

Looks up a key across the specified context(s).

Parameter
Type
Default
Description

key

string

The key to look up

contexts

Context

ALL

Which contexts to search (flags can be combined)

Returns: The mapped value, or null if not found.

TryGetValue

Attempts to look up a key across the specified context(s).

Returns: true if the key was found and has a non-empty value. Iterates contexts in enum order, returns on first match.

ToString

Debug representation showing all contexts and their key-value entries.

Context Enum

Flag
Usage

VARIABLES

Variable definitions for path expansion (e.g., {PackagePath})

DIRECTORIES

Directory path mappings (source → destination)

FILES

Individual file path mappings

MATERIALS

Material name mappings (used by FBXProcessor, MaterialProcessor)

MESHES

Mesh/node name mappings (used by FBXProcessor)

ANIMATIONS

Animation clip name mappings (used by FBXProcessor)

OTHER

Fallback context for entries before any valid context header

ALL

All contexts except OTHER (default for lookups)

circle-info

OTHER is excluded from ALL. The ALL flag combines VARIABLES through ANIMATIONS but does not include OTHER. Entries before the first valid context header are placed in OTHER and require explicit context filtering to access.

Common Pitfalls

circle-exclamation
circle-exclamation
circle-exclamation

Examples

Constructing a Processor Table

Context-Specific Lookups

See Also

Last updated