Pre-Publish Scene Validation in 3ds Max Using Maxscript
Catch missing UVs, bad names, and over-budget geometry before assets reach review with a built-in Maxscript pre-flight check.
23 Jul 2025, 01:25 UTC

The problem: a rejected asset after review
An artist marks a character model as ready for review. The reviewer opens it and finds objects named "Box001," a mesh missing its second UVW channel, and a polycount double the agreed budget. The asset gets kicked back, and the team loses a day. This is a common pipeline friction point: final checks happen too late, after the scene has already left the artist's machine.
The thesis: validate before publish with Maxscript
Maxscript is Autodesk 3ds Max's built-in scripting language. It ships with every installation and exposes the scene graph—nodes, modifiers, controllers, and materials—through an interpreted syntax you run in the MAXScript Listener. Because it is read-only by default for most queries, a validation script is safer than a corrective one: it reports problems without silently rewriting geometry or materials.
What a pre-flight validator should check
A practical pre-publish script walks the scene and flags three common issues:
- Asset naming: objects that do not follow the studio prefix convention, such as
chr_for characters orenv_for environment pieces. - Geometry: meshes missing a required UVW channel, usually channel 2 for lightmaps.
- Budget: objects above a triangle or polygon threshold set for the target platform.
These checks are read-only queries. The script reads property values and prints a report; it does not delete or rename anything unless you explicitly add that behavior.
Worked example: a basic validation script
Open the MAXScript Listener by pressing F11. No administrator permissions are required; the script runs in your user session and only reads scene data. Paste the following example, replacing placeholders with your studio's values:
-- Pre-publish validation: naming, UVW, polycount
local polyBudget = 100000
local requiredUVChannel = 2
local namingPattern = "^chr_|^env_|^prp_"
local issues = #()
for obj in geometry do (
-- Name check
local nameOK = matchPattern obj.name pattern:namingPattern
if not nameOK then append issues (obj.name + ": naming convention failed")
-- UVW channel check
local hasUV = false
if superClassOf obj == GeometryClass do (
for i = 1 to (numMaps obj) do (
if i == requiredUVChannel then hasUV = true
)
)
if not hasUV then append issues (obj.name + ": missing UVW channel " + requiredUVChannel as string)
-- Polycount check
local polyCount = polyOp.getNumFaces obj
if polyCount > polyBudget then append issues (obj.name + ": " + polyCount as string + " faces, over budget")
-- Keep UI responsive on large scenes
cooperate()
)
if issues.count == 0 then format "Pre-publish check: all clear\n"
else (
format "Pre-publish check: % issues found\n" issues.count
for issue in issues do format "- %\n" issue
)
Where to run: MAXScript Listener (F11) or a .ms file dragged into 3ds Max. Required permissions: none beyond normal 3ds Max use. Expected check: the Listener prints either "all clear" or a numbered list of offending objects. Risk: on very large scenes the single-threaded interpreter can pause the viewport; the cooperate() call yields to the UI so the window does not appear frozen. If you remove it, long loops may block interaction until the script finishes.
Distributing the check without a code editor
Artists should not have to open the Listener to run validation. Wrap the script in a macroScript definition, save it to the 3ds Max startup scripts folder, and add it to a toolbar through Customize > Customize User Interface. The macroScript appears as a button artists can click before saving. Because the example only reads scene properties, there is no state-changing operation and therefore no rollback procedure; if you later add automatic renaming or deletion, test that corrective logic on a duplicate scene first.
Limitations and how to verify the result
Maxscript is single-threaded and interpreted. Traversing tens of thousands of nodes can make the UI unresponsive even with cooperate(), so scope heavy checks to a selection set or layer filter when possible. Some object properties are read-only in Maxscript and require the C++ SDK or .NET API to modify, which reinforces keeping this tool validation-only. Version differences between 3ds Max releases can change how modifiers or controllers are exposed, so test the script on every studio version in use.
Practical verification: build a small test scene with deliberate errors—one badly named object, one mesh without the required UVW channel, and one mesh over the polycount budget. Run the script and confirm it catches each case and reports nothing on a clean scene. Wrap the loop with disableSceneRedraw() and enableSceneRedraw() to check whether viewport redraws, rather than the logic itself, are the bottleneck.
Closing: start small, stay read-only
Begin with the Listener version above, run it on a test scene, and promote it to a toolbar button once the report matches your expectations. A pre-publish validator does not replace review, but it catches the obvious failures before they reach it.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.