PrepareProcessor
Pre-processor that determines the visibility of import items in the package import dialog. Handles duplicate detection for project assets and filters out items that would overwrite identical paths.
Definition
Namespace: Paragon.Editor.ThirdPartyPackageImporter Assembly: Paragon.Editor.dll
internal class PrepareProcessor : ProcessorInherits: Processor
Remarks
This processor runs after PathProcessor and determines which items should be visible in the import dialog. It distinguishes between project assets (assets that already exist in the project) and new assets (assets being imported for the first time).
Visibility Rules
For Non-Project Assets (!projectAsset)
!projectAsset)Always visible — these are new assets being imported from the package.
For Project Assets (projectAsset)
projectAsset)Visibility depends on whether the asset's destination path conflicts with another item:
GUID match found — searches all items for a matching GUID. If found, the project asset is visible only if its
destinationAssetPathdiffers from the matching item's path (indicating a move/rename).No GUID match — the project asset is visible only if no other item has the same
destinationAssetPath(prevents duplicate entries at the same location).
Processing Scope
Unlike other processors that filter to specific file types, PrepareProcessor processes all items in the package (via return package, which iterates the full internal collection including invisible items).
Quick Lookup
Item type
Check packageItem.projectAsset
New assets
Always Visible = true
Project assets with same GUID, different path
Visible = true (indicates relocation)
Project assets with same GUID, same path
Visible = false (no change)
Project assets with no GUID match, unique path
Visible = true
Project assets with no GUID match, duplicate path
Visible = false
Methods
OnProcess (protected override)
Returns all items in the package (including project assets and previously invisible items). Uses the IEnumerable<ImportPackageItem> implementation of ThirdPartyPackage.
OnProcessItem (protected override)
Sets the Visible property on each item based on the duplicate detection rules:
Non-project assets →
Visible = trueProject assets → visibility determined by GUID matching and path comparison
Common Pitfalls
Iterates the full package collection OnProcess returns package directly (the IEnumerable implementation), which includes ALL items — not just visible ones from GetImportItems(). This is intentional since this processor sets visibility.
Depends on PathProcessor running first PrepareProcessor reads destinationAssetPath which is set by PathProcessor. If PathProcessor hasn't run, the paths will be in their original (untranslated) state and duplicate detection may produce incorrect results.
GUID-first matching The processor checks for GUID matches before path matches. If a GUID match is found, the path-based All() check is skipped entirely. This means a project asset with a matching GUID but different path will always be visible, even if another item has the same destination path.
See Also
PreProcessors Overview — pre-processor subsystem
PathProcessor — path translation (runs before PrepareProcessor)
PostProcessors — post-import asset processing
Last updated