What ai2tex does
ai2tex transfers the visible color and, optionally, geometric normal detail from an original Source model - for example a model generated by Hunyuan or Tripo-— to a lower-poly Target model with a usable UV layout. It can also create that Target automatically using the built-in 3ds Max Retopology modifier.
The optional Retopology button copies the Source, applies Autodesk's Retopology modifier to the copy, collapses the result to Editable Poly, and sets the new object as Target. The original Source is not changed. You then create the Target UVs and run the bake.
For baking, ai2tex automates the built-in 3ds Max Projection modifier and Render To Texture workflow. Rays are sent from the Target surface along its normals to find the Source geometry and sample its color.
The workflow is not limited to AI-generated models: the tool can retopologize and transfer maps between compatible models in general.
What is transferred?
| Item | Transferred? | Details |
|---|---|---|
| Diffuse / Base Color | Yes | Can be baked from the Source color texture |
| Physical Material Base Color | Yes | Reads Base Color and its bitmap |
| Standard Material Diffuse | Yes | The Standard Material is used as the source |
| Multi/Sub-Object | Yes | Each supported Standard / Physical sub-material is processed |
| Normal map | Yes | Can be baked from Source geometry |
| Roughness / Metallic / Opacity / Emission / AO | No | Not supported |
| Target UV unwrap | No | The existing Target UV layout is used; no unwrap is created |
| Geometry | Optional | The Retopology button creates a new retopologized Target copy; the original Source is not changed |
| Target material | Optional | A new Standard Material named <Target>_BakedMat can be assigned |
Before you start
- 3ds Max 2023 or 2025. These versions were tested. The Retopology button requires Autodesk's Retopology modifier / Retopology Tools.
- Windows. The script uses Windows paths and explorer.exe.
- Any renderer. Corona, V-Ray and other renderers can be present; ai2tex temporarily switches to Default Scanline Renderer for the bake and restores the previous renderer.
- Target UVs. The Target needs an existing UV unwrap without overlapping clusters in the channel you choose. If you use the Retopology button, create the UVs after retopology.
- Matching placement. Source and Target should occupy the same position, scale and rotation.
Two ways to install or run it
The distribution contains two MAXScript files. They can be used directly by dragging them into an open 3ds Max window.
| File | Purpose |
|---|---|
| ai2tex_Install.ms | Installs silently when dragged into an open 3ds Max window. The macro can then be added to a toolbar or assigned to a hotkey. |
| ai2tex.ms | Runs ai2tex immediately when dragged into an open 3ds Max window. |
Install a toolbar button
How to open ai2tex
- From the installed macro: click the toolbar button or use its hotkey. A floating ai2tex window opens.
- From the script file: use Scripting → Run Script… and select ai2tex.ms, or drag it into Max.
The actual bake starts with Bake. While the bake is running, 3ds Max is busy; do not work in the scene until it finishes.
Step-by-step
- Import the original generated model into 3ds Max.
- Optional - create the Target inside ai2tex: click Pick Source, then click Retopology. ai2tex creates a copy named <Source>_retopo, applies the Retopology modifier, collapses the result to Editable Poly, and sets the copy as Target. The original Source is not changed.
- Or use your own retopology workflow: for example Quad Remesher or another method, then click Pick Target and select your retopologized model.
- Create the UV unwrap for the Target. The Retopology button does not create UVs.
- Align Source and Target: same position, rotation and scale.
- Open ai2tex and confirm the Source and Target.
- Check the parameters. The defaults are normally sufficient, but UV channel must point to the Target channel containing the unwrap.
- Choose the maps to bake: Diffuse, Normal, or Diffuse + Normal.
- Click Bake.
- After a successful bake, Explorer opens with the generated file(s) selected. If Assign new material to Target is enabled, the Target receives a new Standard Material with the baked maps.
Built-in 3ds Max Retopology
ai2tex can optionally create a lower-poly Target using Autodesk's built-in Retopology modifier. This means you do not need a third-party retopology plugin just to use the basic ai2tex workflow.
- Pick the original textured Source
- Set Target faces and Quad tolerance % if needed
- Click Retopology.
- ai2tex copies the Source as <Source>_retopo, applies Retopology to the copy, collapses the result to Editable Poly, and sets it as Target
- Unwrap the new Target yourself
- Continue with the normal baking workflow
The original Source object is not modified
Window parameters
| Parameter | Values | Default | What it does |
|---|---|---|---|
| Pick Source | Any geometry | None | Selects the original model with the source texture. |
| Pick Target | Any geometry | None | Selects the retopologized model receiving the bake. |
| Retopology | Button | — | Copies the Source as <Source>_retopo, applies the 3ds Max Retopology modifier, collapses the result to Editable Poly, and sets it as Target. |
| Target faces | Modifier value | — | Controls the target face count used by the Retopology modifier. |
| Quad tolerance % | Modifier value | — | Controls the quad preference/tolerance used by Retopology. |
| Collapse to Editable Poly | Automatic | On | Applies the Retopology result so the generated Target becomes editable geometry. |
| Clear | Button | — | Clears Source and Target. |
| Bake maps | diffuse / normal / diffuse + normal | diffuse map | Selects which maps are baked. |
| UV channel | 1–99 | 1 | Target UV channel used for the bake. If the channel has no unwrap, the script reports where an unwrap exists. |
| Padding px | 0–64 | 16 | Extends color beyond UV cluster edges to reduce seams and gaps. |
| Ray offset | ≥ 0 | Auto | Distance used when looking from the Target toward the Source. Depends on object size. |
| Auto | Button | — | Sets a starting Ray offset from object size. |
| Map size | 512 / 1024 / 2048 / 4096 / 8192 | 2048 | Square output texture size. |
| Format | png / jpg / tga | png | Output file format. |
| Assign new material to Target | On / Off | On | Creates and assigns a new Standard Material with the baked diffuse map and, when a normal map is baked, places it in the Bump slot. |
| Normal map: flip green (DirectX / Unreal) | On / Off | Off | Flips the green channel of the normal map for engines that expect the opposite Y direction. |
| Export package after bake | On / Off | Off | Exports the Target as FBX and copies the baked textures into a new <target>_package folder. Requires Assign new material to Target. |
| Source maps: Blur 0.01 + Summed Area | On / Off | On | Temporarily reduces source-map filtering blur during baking. |
| Debug: ray misses = magenta | On / Off | Off | Colors ray misses magenta for diagnosis. |
Why Blur 0.01 + Summed Area?
Standard Bitmap settings commonly use Blur 1.0 and Pyramidal filtering. During a bake this can cause the source texture to be blurred and then blurred again in the resulting map. With this option enabled, ai2tex temporarily uses Blur 0.01 and Summed Area on source maps, then restores the original filtering settings after the bake.
What the script automates
- Source and Target selection and clearing.
- Optional Target creation with the built-in 3ds Max Retopology modifier.
- Automatic Retopology setup and collapse to Editable Poly.
- Automatic Ray offset calculation based on object size.
- Target UV-channel validation.
- Temporary source-map filtering changes, restored afterwards.
- Temporary conversion of supported Physical / Multi/Sub source materials to Standard for baking, restored afterwards.
- Temporary switch to Default Scanline Renderer, restored afterwards.
- Automatic Projection modifier setup on Target and removal after the bake.
- Render To Texture setup with the selected map size, padding and UV channel.
- Diffuse and normal map baking, including optional green-channel flip for the normal map.
- Output naming and saving with the _TexBake suffix.
- Optional creation and assignment of <Target>_BakedMat.
- Optional FBX + texture package export after baking.
- Debug mode for ray misses.
- Explorer opening, MAXScript Listener path output and success/error messages.
- Temporary changes are rolled back after a normal completion or handled error.
Where the baked file is saved
- Beside the first Source texture found, if its folder exists.
- If Source has no file texture: the current scene folder.
- If the scene has not been saved: the 3ds Max Images folder returned by getDir #image.
Diffuse and normal bake files use the _TexBake naming pattern. If the Source has no texture file, the Target name is used instead. The normal map is always saved as PNG.
Export package
When Export package after bake is enabled, ai2tex creates a new folder named <target>_package next to the output and exports the Target as FBX together with copies of the baked textures. If the folder already exists, a number is added to its name.
Supported source materials
| Source material | Support |
|---|---|
| Standard Material | Supported. |
| Physical Material | Supported for Base Color and its map. |
| Multi/Sub-Object from Standard / Physical | Supported; each supported sub-material is processed. |
| Corona / V-Ray / Arnold / Standard Surface and other renderer-specific materials | Not guaranteed. ai2tex does not convert these materials, and Scanline may not read them correctly. The result may be black or gray. |
Source map filtering: only the standard 3ds Max BitmapTexture is handled. CoronaBitmap is not modified.
Normal map: the normal map transfers geometric detail from the Source through the projection bake. If the detail exists only in the Source's painted color texture and not in its geometry, the resulting normal map will be nearly flat.
Output formats
PNG is the default and lossless. JPG is baked at quality 100 for the operation. TGA is also supported. For texture accuracy, PNG or TGA is preferable to JPG.
Common baking artifacts
| Symptom | What to try |
|---|---|
| Holes / black spots | Ray offset is too small. Increase it and bake again. |
| Color from the back side or neighboring areas | Ray offset is too large. Reduce it. |
| Not sure whether black is a ray miss or black material | Enable Debug: ray misses = magenta. Magenta indicates a ray miss; black without magenta points toward a Source material problem. |
| No UV / “no unwrap in channel N” | Use the UV channel where the Target unwrap actually exists. |
| Texture is empty or gray | Check the Source material type and supported map type. |
Known limitations
- Diffuse / Base Color and Normal can be baked. Roughness, Metallic, Opacity, Emission and AO are not supported.
- One Source + one Target at a time. There is no batch processing.
- Output textures are square.
- Unsupported renderer-specific Source materials are not converted.
- Ray offset may need manual adjustment.
- Result quality depends on Source / Target alignment. Gaps or neighboring colors can appear when the models do not match closely.
- If Assign new material to Target is enabled, the new material replaces the Target's previous material. Save the previous material or disable this option if it is needed.
- If 3ds Max crashes during the bake, temporary scene changes may remain: Projection on Target, the temporary Source material and Scanline renderer. They can be restored manually.
- JPG introduces compression; PNG or TGA is preferable for accurate texture work.
- A Target without an existing UV unwrap cannot be baked. The Retopology button creates geometry but does not unwrap it.
- The built-in Retopology workflow requires Autodesk's Retopology modifier / Retopology Tools. If you do not have it, use your own retopology method and pick the resulting Target.
- MAXScript files should preferably be stored as UTF-8 with BOM if they contain Russian text, otherwise text in Max dialogs may display incorrectly.
- The script was tested with Physical Material and Corona, and with 3ds Max 2023 and 2025.
What happens during a bake
- Selection and Target UV channel are checked.
- If Retopology was requested, the Source is copied, the Retopology modifier is applied, and the copy is collapsed to Editable Poly and assigned as Target.
- Source-map filtering, Source material and renderer are temporarily adjusted.
- Projection is added to the Target and connected to the Source with the chosen Ray offset.
- Render To Texture is configured with the selected maps, UV channel, padding, map size and output path.
- The bake is started.
- The created file(s) are checked; the new Target material is created and assigned when enabled.
- If package export is enabled, the Target is exported as FBX and the baked textures are copied to the package folder.
- Projection is removed and the Source material, renderer, source-map filtering and selection are restored.