FBXProcessor

Post-processor that renames FBX nodes, materials, and animation clips based on ProcessorTable mappings using the Autodesk FBX SDK. Also remaps materials by name after renaming.

Definition

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

internal class FBXProcessor : Processor

Inherits: Processor

Remarks

This processor uses the Autodesk FBX SDK (Autodesk.Fbx) to directly modify FBX file internals. After renaming, it triggers Unity's ModelImporter to remap materials and save/reimport the asset.

Processing Pipeline

For each .fbx file:

  1. FBX SDK pass — opens the file, recursively walks all nodes:

    • Renames nodes via MESHES context lookup

    • For renamed nodes, also renames their attached materials via MATERIALS context lookup

    • Exports the modified FBX back to disk

  2. ModelImporter pass — loads the ModelImporter for the asset:

    • Calls SearchAndRemapMaterials (by material name, search everywhere)

    • Renames animation clips via ANIMATIONS context lookup

    • Saves and reimports

Item Filtering

  • Skips local packages — returns empty for IsLocalPackage

  • Filters to .fbx files — only enabled, non-folder items with .fbx extension (case-insensitive)

FBX SDK Lifecycle

The ProcessFBX helper manages the full Autodesk SDK lifecycle:

  1. Create FbxManager, FbxIOSettings, FbxImporter

  2. Import the FBX file into an FbxScene

  3. Invoke the processing callback on the scene

  4. Export the modified scene via FbxExporter

  5. Destroy all SDK objects in reverse order

Quick Lookup

Goal
How

Rename a mesh node

Add entry in ProcessorTable under MESHES context

Rename a material

Add entry in ProcessorTable under MATERIALS context

Rename an animation clip

Add entry in ProcessorTable under ANIMATIONS context

Methods

OnProcess (protected override)

Returns enabled .fbx items from the package. Returns empty for local packages.

OnProcessItem (protected override)

Processes a single FBX file: renames nodes and materials via FBX SDK, remaps materials, renames animation clips, and reimports.

ProcessFBX (private static)

Opens an FBX file via the Autodesk SDK, invokes a callback on the scene, and saves the modified file.

Parameter
Type
Description

path

string

Path to the .fbx file

process

Action<FbxScene>

Callback to modify the scene

ProcessNode (private static)

Recursively walks the FBX node tree, invoking a callback on each node.

ProcessAnimationClips (private static)

Iterates all ModelImporterClipAnimation entries and invokes a callback on each, then reassigns the array to the importer.

Common Pitfalls

circle-exclamation
circle-exclamation
circle-exclamation

See Also

Last updated