Threejs obj export

From XuShuwenn/RedAct · View interactive version

Threejs obj export is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Export Three.js scenes to Blender-ready OBJ by baking world transforms, expanding instanced meshes, and applying a -90° X rotation to convert to Z-up.

How to use this skill

Skill file

Three.js to OBJ (Blender Z-up) Export

Reusable workflow to export a Three.js scene/object to Wavefront OBJ that imports cleanly into Blender's Z-up coordinate system. It bakes all world transforms into geometry and expands InstancedMesh objects so the OBJ contains actual mesh data for every visible instance.

When to Use

Use this skill when you need to:

Core Workflow

  1. Inspect how the scene/object is exported.
  1. Load the scene and update transforms.
  1. Expand InstancedMesh objects.
  1. Bake transforms into geometry.
  1. Export with OBJExporter.
  1. Save and verify.

Verification

Common Pitfalls and How to Avoid Them

  1. InstancedMesh not expanded → Missing geometry in OBJ
  1. Not calling updateMatrixWorld(true) → Stale transforms baked into geometry
  1. Relying on scene/group transforms → Incorrect positions in OBJ
  1. Double-applying Z-up rotation → Wrong orientation
  1. Merging all geometries indiscriminately → Lost object names/material groups
  1. Module system mismatch (ESM vs CJS) → Import errors
  1. Ignoring normals after negative scale or complex transforms → Shading artifacts

Success Criteria

Optional Script Usage

This repository provides a generic exporter you can reuse:

Example:

To verify the output quickly:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.