Gist 890a9efc19689b5b755e9d5c26315c73
✓ Published0🌍 Public
Aandybak
Last edited Mar 11, 2025
Created on Mar 11, 2025
This example shows a Godot editor plugin that automatically swaps materials on imported GLTF and GLB scenes. It uses the `EditorScenePostImport` API to intercept post-import processing, checks import metadata to avoid re-processing, and recursively traverses the scene graph to replace materials on `MeshInstance3D` nodes. The code defines replacement `StandardMaterial3D` instances with albedo colors, textures, and metallic properties, loading texture files from a local addon directory. The plugin registers itself through `EditorPlugin` and skips non-GLTF files.
AI-generated description