MetaProcessor

Post-processor that strips AssetOrigin metadata blocks from .meta files of locally imported packages. This removes Asset Store origin tracking from assets that have been re-imported as local packages.

Definition

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

internal class MetaProcessor : Processor

Inherits: Processor

Remarks

When Unity imports assets from the Asset Store, it adds an AssetOrigin section to each .meta file tracking the package source. For local packages (re-imported from a local .unitypackage), this tracking is incorrect and should be removed to prevent Unity from associating the assets with the wrong source.

Regex Pattern

The processor uses a compiled regex to match and remove AssetOrigin blocks:

AssetOrigin:.*(?:\r?\n {2}.*)*(\r?\n)?

This matches:

  • The AssetOrigin: header line

  • Any continuation lines indented with 2 spaces

  • The trailing newline

Item Filtering

  • Only processes local packages — returns empty for non-local packages (opposite of FBX/Material processors)

  • Filters to non-folder items — all file types, not just specific extensions

  • File-level operation — appends .meta to the destination path

Write Encoding

Modified files are written with UTF-8 without BOM (new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)), matching Unity's .meta file convention.

Quick Lookup

Goal
How

What it strips

AssetOrigin: block and all indented sub-properties

When it runs

Only for local packages (IsLocalPackage == true)

File modified

{destinationAssetPath}.meta

Fields

Field
Type
Access
Description

regex

Regex

private readonly

Compiled regex matching AssetOrigin: blocks with indented continuation lines

Methods

OnProcess (protected override)

Returns all non-folder items for local packages. Returns empty for remote packages.

OnProcessItem (protected override)

Reads the .meta file for the item, strips AssetOrigin blocks via regex, and writes back only if the content changed.

Common Pitfalls

circle-exclamation
circle-exclamation
circle-exclamation

Examples

Before Processing

After Processing

See Also

Last updated