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 : Processor

Inherits: 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)

Always visible — these are new assets being imported from the package.

For Project Assets (projectAsset)

Visibility depends on whether the asset's destination path conflicts with another item:

  1. GUID match found — searches all items for a matching GUID. If found, the project asset is visible only if its destinationAssetPath differs from the matching item's path (indicating a move/rename).

  2. 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

Goal
How

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 = true

  • Project assets → visibility determined by GUID matching and path comparison

Common Pitfalls

circle-exclamation
circle-exclamation
circle-exclamation

See Also

Last updated