Transmogrifier icon indicating copy to clipboard operation
Transmogrifier copied to clipboard

A Blender addon for batch converting 3D files and associated textures into other formats.

Transmogrifier

A Blender addon for batch converting 3D files and associated textures into other formats - with an emphasis on visualization for the web and AR. Supports conversions between FBX, OBJ, glTF/GLB, STL, PLY, X3D, DAE, ABC, and USD/USDA/USDC/USDZ.

Installation ๐Ÿ“ฅ ยท Usage ๐Ÿญ ยท Demo ๐Ÿงช ยท How it Works โš™ ยท Benefits ๐ŸŽ ยท Features โœจ ยท Credits ๐Ÿ™

INSTALLATION ๐Ÿ“ฅ

  1. Prerequisites: Blender 3.6 and Windows or GNU/Linux (tested on Ubuntu 22.04 LTS). (Transmogrifier may work on MacOS, but this has not been tested.)
  2. Download the latest version. Select the .zip file with the version number at the end (e.g. "Transmogrifier-v1.x.x.zip"), not the ones named "Source Code".
  1. Install the addon, like this.
  2. Choose where to display the addon menu in Blender.
  1. (Optional) Copy example workflow/import/export presets to local Blender preferences directory.

USAGE ๐Ÿญ

  1. Select a directory containing 3D files of the chosen import format, or a parent directory of arbitrary organization and/or depth as long as there exists at least one 3D file of the specified import format somewhere inside. Try out the Demo ๐Ÿงช below to get started.
  1. Select an output directory to which 3D files of the chosen export format(s) should be exported. "Adjacents" means that converted models will be saved to the same directories from which they were imported. "Custom" means that converted models will be saved to a chosen custom directory.
  1. Set additional export settings as described in the Features section below. (Optional: to save current settings for later use, save the current .blend file)
  1. Click "Batch Convert". This will spawn another instance of Blender. The new Blender window will remain grey while the conversion process gets output to the console window. The original Blender window will remain frozen/unresponsive until the batch conversion is complete. This is normal operation. After the conversion finishes, the greyed-out Blender window will disappear and the original Blender instance will report how many files were converted. If you wish to see the conversion process get logged in real-time, you must start Blender from your terminal/Command Line first before Transmogrifying.
  • (Ubuntu Example)
  • (Windows Example)

DEMO ๐Ÿงช

  1. Download "PolyHaven_Demo_Files.zip" from the latest release page.
  2. Unzip the directory.
  3. Select the unzipped "PolyHaven_Demo_Files" as the "Import Directory".
  1. Click "Batch Convert".

HOW IT WORKS โš™

Transmogrifier works by searching through a given directory for files ending with the extension of the format selected. When it finds a file, it clears out all the current data blocks in the scene, imports the file, imports the associated textures, creates material(s), assigns that/those material(s) to the object(s) in the scene, and exports the model in the new format specified. If Auto File Resizing is turned on, Transmogrifier will then check the exported file's size and attempt to resize the file. The process then repeats until it has converted all files of the specified import format in the given directory.

The diagram below shows the general process and the variety of ways in which Transmogrifier can convert models with respect to available textures and the chosen import and export formats. Each gray box with rounded corners indicates a directory/folder.

Models from Polyhaven (CC0).

BENEFITS ๐ŸŽ

  • โณ Saves Time. Automates the boring stuff so you can focus on creating instead of converting.
  • ๐Ÿ›ก๏ธ Private and Secure. Runs offline/locally. No account needed.
  • โš“ Non-Destructive. Original files are preserved (unless converting between the same formats).
  • ๐Ÿ”“ Open Source/Licensed-Free. View, modify, and share the code freely.
  • ๐Ÿ†“ Free. No paywall, no trial, no strings attached.

FEATURES โœจ

Transmogrifier includes a robust set of tools for non-destructively converting 3D files and associated textures into other formats.

User Interface

Toggle between a simple and advanced Transmogrifier user interface.

Workflow

Create custom Transmogrifier presets (aka "Workflows) for quickly switching between different conversion scenarios. Click the plus button "+" to create a Workflow from all of the current Transmogrifier settings, giving it a custom name. Workflows are stored as "operator presets" in Blender preferences directory. To remove a workflow, select it from the menu, then click the minus button "-".

3D Formats

  • FBX
  • OBJ
  • glTF/GLB
  • STL
  • PLY
  • X3D
  • DAE
  • ABC
  • USD/USDA/USDC/USDZ
  • BLEND

Import/Export Presets

Set user-defined import and export presets.

Import Location

Select a directory containing 3D files of the chosen import format, or a parent directory of arbitrary organization and/or depth as long as there exists at least one 3D file of the specified import format somewhere inside.

Export Location

Set the export location to either "Adjacent" or "Custom". "Adjacents" means that converted models will be saved to the same directories from which they were imported. "Custom" means that converted models will be saved to a chosen custom directory. Choose whether to place converted models in subdirectories of their same names. If so, choose whether to copy original files from import directories to respective subdirectories.

Name

Set a custom prefix and/or suffix for every exported file. Synchronize object names and object data names according to the former.

Textures

Transmogrifier can detect the presence of multiple image texture sets and non-destructively modify them during the conversion process. Select whether to use textures, regex the PBR tags in the textures' names, and keep the otherwise temporary textures folders with their modifications.

Source:

  • External: image textures nearby the imported model.
    • in a "textures" subfolder
    • in "[texture set]" subfolders inside a "textures" subfolder
    • in the same directory as the imported 3D file
  • Packed: image textures packed into the imported file (e.g. GLB or USDZ)
  • Custom: image textures from a custom directory, which will be applied to all models converted.

Models from Polyhaven (CC0). The scenarios shown depend on whether the selected import or export formats support textures. Each gray box with rounded corners indicates a directory/folder.

3 Texturing Rules

There are three naming conventions that must be followed in order for textures to be properly imported, materials created, and materials assigned to the right objects.

  1. Transparent pieces have "transparent" in name and are separate objects. Objects that should appear transparent must have the word "transparent" present somewhere in their names. This indicates to Transmogrifier that it should duplicate the material as "[material]_transparent" and turn on "Alpha Blend" blending mode, then assign "[material]" to the opaque objects and "[material]_transparent" to the transparent objects. This convention works for multiple texture sets as well.
  1. Per item, if only 1 texture set is present, object names don't matter except for Rule 1. For "External" and "Custom" texture sources and for models with only one texture set present, the first rule doesn't matter because it is assumed that that texture set should be applied to all the objects in the scene.
  1. Per item, if >1 texture set is present and textures source is either "External" or "Custom", object and textures set names do matter: an object's name must include its corresponding texture set name somewhere in the object's name. For models with more than one texture set present, a texture set naming convention must also be followed for Transmogrifier to correctly import and assign multiple texture sets to the proper objects. Simply ensure that the the first word before an underscore or another separator in the textures' names is 1) distinct between texture sets and 2) consistent between i.) each PBR image in each texture set and ii.) between the texture sets and the objects to which those textures should be applied (See image below). As such, having multiple materials assigned to different meshes within an object is not possible. For "Packed" textures source, Transmogrifier automatically keeps associated materials, textures, and objects synchronized.

Resolution:

Resize textures and filter what to include by PBR type. Images will not be upscaled.

  • 8192
  • 4096
  • 2048
  • 1024
  • 512
  • 256
  • 128

Format:

Reformat textures and filter what to include by PBR type.

  • PNG
  • JPEG (.jpg)
  • TARGA
  • TIFF
  • WEBP
  • BMP
  • OPEN_EXR

UVs

Rename UV Maps

Rename all UV maps for all objects converted with a custom name. This is important for USD, where objects sharing the same material evidently need to share the same UV map name as well. If an object has more than one UV map, a numerical incrementer suffix will be applied to each UV map (e.g. "UVMap_1", "UVMap_2", etc.).

Export UV Maps

Export UVs with the same options available via the UV Editor and more.

Set a location for UV's to be exported into:

Set how UVs should be combined for export:

Transformations

Perform custom transformations and/or apply transformations to every model before export. Filter what transformations to set/apply.

Animations

Delete animations of every imported object before export.

Scene

Set a custom unit system and length unit for export.

Optimize

Perform automatic file-optmization methods to every model in order reduce the exported file size below a custom target maximum. Filter which methods are used. If all methods are exhausted and the file size is still above the target maximum, Transmogrifier will report this in the log and move on.

File Included:

  • All (Always export despite any pre-existing file that is already below the target file size.)
  • Only Above Max (Only export and resize files that are above the target file sizes. Pre-existing files already below the target are ignored.)
  • None (Don't auto-resize at all.)

Methods:

  • Draco compression (Only works for GLB/glTF.)
  • Resize textures (Set a minimum resolution limit.)
  • Reformat textures (Convert all textures to JPG except normal maps.)
  • Decimate mesh objects (Uses edge collapse at 50% ratio each time. Set a maximum decimate iteration.)

Archive

Mark assets, add metadata, store asset Blend files in a library and catalog, and extract asset previews as PNGs. Save a log of the conversion process to troubleshoot errors or simply to get a list of the output files and their file sizes.

Archive Assets

  • Mark Assets

    • Actions
    • Collections
    • Materials
    • Node Trees
    • Objects
    • Worlds
  • Ignore Duplicate Assets. Transmogrifier will avoid marking assets that already exist in the selected asset library per asset-type.

  • Save Previews to Disk. Extract generated asset previews as PNGs beside the Blend containing assets. Cannot save previews for asset types that have not been marked.

  • Asset Library. Select an asset library to 1) get catalogs and 2) move/copy the Blend containing assets to that library.

    • Asset Libraries must first be created/set up via Blender Preferences and Blender must be restarted before Transmogrifying.
  • Catalog. Select from the available catalogs in a given asset library.

    • Asset Catalogs must first be created/set up in the usual manner (e.g. From a current Blender session - marking assets, creating categories in the current file, saving the Blend with inside the asset library directory. If the Blend is deleted, asset categories will still be preserved).
  • Blend Location

    • Move to Library
    • Copy to Library
    • Don't Move/Copy. Useful when Transmogrifying inside of an asset library.
  • Pack Resources. Pack textures and other linked data into asset Blend. If unchecked, the asset Blend will reference textures from an adjacent textures folder.

  • Add Metadata. The input metadata will be applied to all items converted.

    • Description
    • License
    • Copyright
    • Author
    • Tags. Separate multiple tags with a space. (e.g. "grunge worn ancient")

CREDITS ๐Ÿ™

Many thanks to the people who develop Blender, without whom this addon would have no foundation to exist!

Transmogrifier used code from the following repositories in the following ways. If you give a star to this repository, please also do the same for theirs!