local isValid = true;
local _assetID = "";
local _placementType = "";
local _purpose = "";
local _materialType = "";
local needHigh = false;
local needHighPBR = false;
local needLow = false;
local hpMaxFilename = "";
local lpMaxFilename = "";
local hpPBRMaxFilename = "";
local vrayTexDir = "";
local pbrTexDir = "";
local highPbrTexDir = "";
local outputDir = "";
local bundleType = "";
local jsonDll = @"C:\All3D\Newtonsoft.Json.dll";
-- local assetValidataionModule = @"C:\All3D\AssetValidationModule.mse";
local shouldAbort = false;
code
Assistant
fn PickOutputDir =
(
local dir = getSavePath caption:"Pick Output folder" initialDir:@"C:\";
if (dir != undefined AND dir != "") then
(
outputDir = dir;
return true;
)
else
(
shouldAbort = queryBox "Do you want to abort the bundling process?" title:"Abort Bundling" beep:true;
if (shouldAbort) then
(
return false;
)
else
(
PickOutputDir();
)
)
)
fn PickMaxFile =
(
fileType = undefined;
case bundleType of
(
"High": ( fileType = "High")
"HighPBR": ( fileType = "High")
"Low": ( fileType = "Low")
Default: ( fileType = "High")
)
local filename = getOpenFileName caption:("Pick " + fileType + " Poly Max File") types:"Max(*.max)|*.max|";
if (filename != undefined AND filename != "") then
(
case bundleType of
(
"High": ( hpMaxFilename = filename; )
"Low": ( lpMaxFilename = filename; )
"HighPBR": (hpPBRMaxFilename = filename)
)
return true;
)
else
(
shouldAbort = queryBox "Do you want to abort the bundling process?" title:"Abort Bundling" beep:true;
if (shouldAbort) then
(
return false;
)
else
(
PickMaxFile();
)
)
)
fn PickTexDir =
(
local customCaption = "";
local initDir = "";
case bundleType of
(
"High":
(
customCaption = "Pick Vray Textures folder";
initDir = getFilenamePath hpMaxFilename;
)
"Low":
(
customCaption = "Pick PBR Textures folder for Low Poly Mesh";
initDir = getFilenamePath lpMaxFilename;
)
"HighPBR":
(
customCaption = "Pick PBR Textures folder for High Poly Mesh";
initDir = getFilenamePath hpPBRMaxFilename;
)
)
local dir = getSavePath caption:customCaption initialDir:initDir;
if (dir != undefined AND dir != "") then
(
case bundleType of
(
"High": ( vrayTexDir = dir; )
"Low": ( pbrTexDir = dir; )
"HighPBR": ( highPbrTexDir = dir; )
)
return true;
)
else
(
shouldAbort = queryBox "Do you want to abort the bundling process?" title:"Abort Bundling" beep:true;
if (shouldAbort) then
(
return false;
)
else
(
PickTexDir();
)
)
)
fn CheckAndBundle =
(
if (PickMaxFile()) then
(
PickTexDir();
)
)
fn RaiseFlags =
(
if (_purpose == "rendering" OR _purpose == "both") then
(
if (_materialType == "Vray") then
(
needHigh = true;
)
else
(
needHighPBR = true;
)
if (_purpose == "both") then
(
needLow = true;
)
)
else if (_purpose == "realtime") then
(
needLow = true;
)
)
fn StartWizard assetID =
(
if (needHigh) then
(
bundleType = "High";
CheckAndBundle();
)
if (shouldAbort) then ( return 0; )
if (needHighPBR) then
(
bundleType = "HighPBR";
CheckAndBundle();
)
if (shouldAbort) then ( return 0; )
if (needLow) then
(
bundleType = "Low";
CheckAndBundle();
)
if (shouldAbort) then ( return 0; )
PickOutputDir();
if (shouldAbort) then ( return 0; )
::_validator_.assetID = _assetID;
::_validator_.placementType = _placementType;
::_validator_.hpMaxFilename = hpMaxFilename;
::_validator_.lpMaxFilename = lpMaxFilename;
::_validator_.hpPBRMaxFilename = hpPBRMaxFilename;
::_validator_.vrayTexDir = (vrayTexDir + "\\");
::_validator_.pbrTexDir = (pbrTexDir + "\\");
::_validator_.highPbrTexDir = (highPbrTexDir + "\\");
::_validator_.outputDir = outputDir + "\\ValidationResults\\";
::_validator_.jsonDll = jsonDll;
::_validator_.Init();
if (needHigh) then
(
::_validator_.currBundleType = "High";
isValid = ::_validator_.Validate();
::_assetExporter_.g_modellingType = "high_res";
)
if (needHighPBR) then
(
::_validator_.currBundleType = "HighPBR";
isValid = ::_validator_.Validate()
::_assetExporter_.g_modellingType = "high_pbr";
)
if (needLow) then
(
::_validator_.currBundleType = "Low";
isValid = ::_validator_.Validate() AND isValid
::_assetExporter_.g_modellingType = "ar";
)
::_validator_.ExportReport();
if (isValid) do
(
::_assetExporter_.assetID = _assetID;
::_assetExporter_.assetDir = (outputDir + "\\ValidationResults\\" + _assetID + "\\") ;
::_assetExporter_.outputDir = (outputDir + "\\ExportedAssets\\");
::_assetExporter_.useDraco = true;
::_assetExporter_.glbExportMethod = "babylon";
)
return 1
)
fn ConfigureLabel lbl val font size clr =
(
local bkgCol = (colorman.getcolor #background * 255) as color;
lbl.textAlign = (dotNetClass "System.Drawing.ContentAlignment").MiddleLeft;
lbl.text = val;
lbl.foreColor = (dotNetClass "System.Drawing.Color").fromArgb clr.r clr.g clr.b;
lbl.backColor = (dotNetClass "System.Drawing.Color").fromArgb bkgCol.r bkgCol.g bkgCol.b;
lbl.font = dotnetobject "System.Drawing.Font" font size;
)
rollout AssetValidationSummary "Asset Validation Summary" width:350
(
label dummyLbl_0 "";
dotNetControl summaryLbl "Windows.Forms.Label" height:50 align:#left;
dotNetControl validationResultLbl "Windows.Forms.Label" height:30 align:#left;
label dummyLbl_2 "";
label warningLbl "Please review the following details before clicking Bundle!" align:#left;
label dummyLbl_3 "";
dotNetControl summaryDetails "Windows.Forms.TextBox" height:150;
label dummyLbl_4 "";
button bundleButton "Bundle" across:2 height:30;
button exportGLBButton "Export GLB" height:30;
label dummyLbl_5 "";
on AssetValidationSummary open do
(
ConfigureLabel summaryLbl "Summary " "Verdana" 26 (Color 255 255 255);
if(isValid)then
(
validationOuput = "VALIDATION PASSED!\n"
print(validationOuput)
ConfigureLabel validationResultLbl "Passed!" "Verdana" 20 (Color 0 255 0);
)
else
(
validationOuput = "VALIDATION FAILED!\n"
print(validationOuput)
ConfigureLabel validationResultLbl "Failed!" "Verdana" 20 (Color 255 0 0);
bundleButton.visible = false;
exportGLBButton.visible = false;
)
summaryDetails.acceptsTab = true;
summaryDetails.acceptsTab = true;
summaryDetails.multiline = true;
summaryDetails.readOnly = true;
summaryDetails.scrollBars = (dotNetClass "Windows.Forms.ScrollBars").Both;
local logFile = outputDir + "\\ValidationResults\\" + _assetID + "_Log.txt";
local _data = (dotnetClass "System.IO.File").ReadAllText logFile;
print(_data)
summaryDetails.text = _data;
)
on exportGLBButton pressed do
(
exportGLBButton.enabled = false;
bundleButton.enabled = false;
::_assetExporter_.ExportAsset();
messageBox "Done!" title:"Success!" beep:true;
bundleButton.enabled = true;
)
on bundleButton pressed do
(
cmd = "C:\All3D\7za.exe a -tzip \"" + outputDir + "\\ValidationResults\\" + _assetID + ".zip\" \"" + outputDir + "\\ValidationResults\\" + _assetID + "\\*\"";
DOSCommand cmd;
cmd = "rmdir /Q /S \"" + outputDir + "\\ValidationResults\\" + _assetID + "\\\"";
DOSCommand cmd;
DestroyDialog AssetValidationSummary;
messageBox "Done!" title:"Success!" beep:true;
)
)
rollout assetInfoDialog "All3D Asset Validator & Bundler" width:300
(
label dummyLbl0 "" height:20;
label assetIDLbl "All3D Asset ID:" align:#left;
editText assetIDVal "" height:26;
label dummyLbl1 "" height:20;
radioButtons placementType "Placement Type:" labels:#("Floor", "Wall", "Ceiling") columns:3 align:#left;
label dummyLbl2 "" height:20;
radioButtons purposeType "The asset is meant to be used for" labels:#("Photorealistic Rendering ( High Poly )","Real-time / AR ( Low Poly )","Both") offsets:#([0,5],[0,10],[0,15]) columns:1 align:#left;
label dummyLbl3 "" height:20;
radioButtons materialType "Material Type:" labels:#("Vray","PBR") offsets:#([0,5],[0,10]) columns:1 align:#left;
label dummyLbl4 "" height:20;
button okButton "Proceed";
on purposeType changed num do
(
if num == 1 then
(
materialType.caption = "Material Type:";
materialType.state = 1;
materialType.enabled = true;
)
else if num == 2 then
(
materialType.state = 2;
materialType.caption = "Material Type:";
materialType.enabled = false;
)
else
(
materialType.caption = "High Poly Material Type:";
materialType.state = 1;
materialType.enabled = true;
)
)
on okButton pressed do
(
_assetID = assetIDVal.text;
case placementType.state of
(
1: ( _placementType = "Floor"; )
2: ( _placementType = "Wall"; )
3: ( _placementType = "Ceiling"; )
Default: ( _placementType = "Floor"; )
)
case purposeType.state of
(
1: ( _purpose = "rendering"; )
2: ( _purpose = "realtime"; )
3: ( _purpose = "both"; )
Default: ( _purpose = "rendering"; )
)
case materialType.state of
(
1: ( _materialType = "Vray"; )
2: ( _materialType = "PBR"; )
)
if (_assetID != "" AND (_assetID as Integer) != undefined) then
(
destroyDialog assetInfoDialog;
RaiseFlags();
abortProcess = StartWizard _assetID;
if (abortProcess != 0) do
(
CreateDialog AssetValidationSummary;
)
)
else
(
_assetID = undefined;
messageBox "Please enter a valid Asset ID" title:"Asset ID Invalid!" beep:true;
)
)
)
if (assetInfoDialog.isDisplayed) then ( destroyDialog assetInfoDialog; )
createDialog assetInfoDialog;
)
The provided MaxScript is a comprehensive tool designed for Autodesk 3ds Max, specifically tailored to streamline the validation and bundling process of 3D assets for an entity or project named "All3D." Below is a detailed breakdown of the script's functionality, structure, and workflow.
Overview
The script defines a macroscript named AssetValidatorAndBundler, categorized under "All3D." This tool facilitates:
User Input Collection: Gathers essential asset information such as Asset ID, Placement Type, Purpose, and Material Type through a user-friendly dialog.
Asset Validation: Utilizes external modules (_validator_ and _assetExporter_) to validate the asset based on the provided inputs.
Bundling and Exporting: Packages the validated asset into different formats (High Poly, Low Poly, PBR) and exports the final asset in GLB format.
User Feedback: Provides summary feedback on the validation process and offers options to bundle the results or export the asset.
Detailed Breakdown
1. Initialization and Variable Declaration
maxscript
macroscript AssetValidatorAndBundler category:"All3D" tooltip:"All3D Asset Validator & Bundler" buttonText:"AssetValidator"
(
setVRaySilentMode();
local isValid = true;
local _assetID = "";
local _placementType = "";
local _purpose = "";
local _materialType = "";
local needHigh = false;
local needHighPBR = false;
local needLow = false;
local hpMaxFilename = "";
local lpMaxFilename = "";
local hpPBRMaxFilename = "";
local vrayTexDir = "";
local pbrTexDir = "";
local highPbrTexDir = "";
local outputDir = "";
local bundleType = "";
local jsonDll = @"C:\All3D\Newtonsoft.Json.dll";
-- local assetValidataionModule = @"C:\All3D\AssetValidationModule.mse";
local shouldAbort = false;
...
)
Macroscript Definition: Creates a clickable button within 3ds Max UI under the "All3D" category labeled "AssetValidator".
Silent Mode:setVRaySilentMode(); likely configures the V-Ray renderer to operate without displaying pop-up messages or dialogs during processing.
Variables: Multiple local variables are initialized to store user inputs, file paths, directory paths, and processing flags.
2. Helper Functions
a. PickOutputDir
Prompts the user to select an output directory where the bundled assets and validation results will be saved.
maxscript
fn PickOutputDir =
(
local dir = getSavePath caption:"Pick Output folder" initialDir:@"C:\";
if (dir != undefined AND dir != "") then
(
outputDir = dir;
return true;
)
else
(
shouldAbort = queryBox "Do you want to abort the bundling process?" title:"Abort Bundling" beep:true;
if (shouldAbort) then
(
return false;
)
else
(
PickOutputDir();
)
)
)
Process:
Opens a directory selection dialog.
If the user cancels, prompts whether to abort or retry.
b. PickMaxFile
Allows the user to select the appropriate .max file based on the bundleType (High, HighPBR, Low).
maxscript
fn PickMaxFile =
(
fileType = undefined;
case bundleType of
(
"High": ( fileType = "High")
"HighPBR": ( fileType = "High")
"Low": ( fileType = "Low")
Default: ( fileType = "High")
)
local filename = getOpenFileName caption:("Pick " + fileType + " Poly Max File") types:"Max(*.max)|*.max|";
if (filename != undefined AND filename != "") then
(
case bundleType of
(
"High": ( hpMaxFilename = filename; )
"Low": ( lpMaxFilename = filename; )
"HighPBR": (hpPBRMaxFilename = filename)
)
return true;
)
else
(
shouldAbort = queryBox "Do you want to abort the bundling process?" title:"Abort Bundling" beep:true;
if (shouldAbort) then
(
return false;
)
else
(
PickMaxFile();
)
)
)
Process:
Determines the file type based on bundleType.
Opens a file selection dialog for .max files.
Assigns the selected file to the corresponding variable (hpMaxFilename, lpMaxFilename, or hpPBRMaxFilename).
Handles user cancellation similarly to PickOutputDir.
c. PickTexDir
Prompts the user to select the texture directory corresponding to the bundleType.
maxscript
fn PickTexDir =
(
local customCaption = "";
local initDir = "";
case bundleType of
(
"High":
(
customCaption = "Pick Vray Textures folder";
initDir = getFilenamePath hpMaxFilename;
)
"Low":
(
customCaption = "Pick PBR Textures folder for Low Poly Mesh";
initDir = getFilenamePath lpMaxFilename;
)
"HighPBR":
(
customCaption = "Pick PBR Textures folder for High Poly Mesh";
initDir = getFilenamePath hpPBRMaxFilename;
)
)
local dir = getSavePath caption:customCaption initialDir:initDir;
if (dir != undefined AND dir != "") then
(
case bundleType of
(
"High": ( vrayTexDir = dir; )
"Low": ( pbrTexDir = dir; )
"HighPBR": ( highPbrTexDir = dir; )
)
return true;
)
else
(
shouldAbort = queryBox "Do you want to abort the bundling process?" title:"Abort Bundling" beep:true;
if (shouldAbort) then
(
return false;
)
else
(
PickTexDir();
)
)
)
Process:
Sets custom captions and initial directories based on bundleType.
Opens a directory selection dialog.
Assigns the selected directory to the corresponding texture directory variable (vrayTexDir, pbrTexDir, or highPbrTexDir).
Handles user cancellation similarly to previous functions.
d. CheckAndBundle
A utility function that sequentially calls PickMaxFile and PickTexDir if the former succeeds.
maxscript
fn CheckAndBundle =
(
if (PickMaxFile()) then
(
PickTexDir();
)
)
e. RaiseFlags
Determines which asset bundles (High, HighPBR, Low) are needed based on the asset's purpose and material type.
maxscript
fn RaiseFlags =
(
if (_purpose == "rendering" OR _purpose == "both") then
(
if (_materialType == "Vray") then
(
needHigh = true;
)
else
(
needHighPBR = true;
)
if (_purpose == "both") then
(
needLow = true;
)
)
else if (_purpose == "realtime") then
(
needLow = true;
)
)
Logic:
Purpose: "rendering" or "both"
Material Type "Vray": Requires High Poly.
Material Type "PBR": Requires High PBR.
If Purpose is "both": Also requires Low Poly.
Purpose: "realtime"
Requires Low Poly only.
f. StartWizard
Orchestrates the asset validation and bundling process based on the raised flags.
maxscript
fn StartWizard assetID =
(
if (needHigh) then
(
bundleType = "High";
CheckAndBundle();
)
if (shouldAbort) then ( return 0; )
if (needHighPBR) then
(
bundleType = "HighPBR";
CheckAndBundle();
)
if (shouldAbort) then ( return 0; )
if (needLow) then
(
bundleType = "Low";
CheckAndBundle();
)
if (shouldAbort) then ( return 0; )
PickOutputDir();
if (shouldAbort) then ( return 0; )
::_validator_.assetID = _assetID;
::_validator_.placementType = _placementType;
::_validator_.hpMaxFilename = hpMaxFilename;
::_validator_.lpMaxFilename = lpMaxFilename;
::_validator_.hpPBRMaxFilename = hpPBRMaxFilename;
::_validator_.vrayTexDir = (vrayTexDir + "\\");
::_validator_.pbrTexDir = (pbrTexDir + "\\");
::_validator_.highPbrTexDir = (highPbrTexDir + "\\");
::_validator_.outputDir = outputDir + "\\ValidationResults\\";
::_validator_.jsonDll = jsonDll;
::_validator_.Init();
if (needHigh) then
(
::_validator_.currBundleType = "High";
isValid = ::_validator_.Validate();
::_assetExporter_.g_modellingType = "high_res";
)
if (needHighPBR) then
(
::_validator_.currBundleType = "HighPBR";
isValid = ::_validator_.Validate()
::_assetExporter_.g_modellingType = "high_pbr";
)
if (needLow) then
(
::_validator_.currBundleType = "Low";
isValid = ::_validator_.Validate() AND isValid
::_assetExporter_.g_modellingType = "ar";
)
::_validator_.ExportReport();
if (isValid) do
(
::_assetExporter_.assetID = _assetID;
::_assetExporter_.assetDir = (outputDir + "\\ValidationResults\\" + _assetID + "\\") ;
::_assetExporter_.outputDir = (outputDir + "\\ExportedAssets\\");
::_assetExporter_.useDraco = true;
::_assetExporter_.glbExportMethod = "babylon";
)
return 1
)
Process:
Bundle Collection:
For each required bundle (High, HighPBR, Low), sets bundleType and invokes CheckAndBundle.
Checks shouldAbort after each step to ensure the user hasn't canceled the process.
Output Directory:
Prompts the user to select an output directory to store validation results.
Validator Initialization:
Configures the _validator_ module with necessary paths and parameters.
Calls Init() to initialize the validator.
Validation:
For each required bundle, sets the current bundle type and invokes Validate().
Updates the modeling type in the _assetExporter_ accordingly.
Combines validation results to determine overall asset validity.
Exporting:
If the asset is valid, configures the _assetExporter_ with necessary parameters for exporting the asset in GLB format using Draco compression and the Babylon export method.
Return Value:
Returns 1 if the process completes without aborting; 0 otherwise.
g. ConfigureLabel
A utility function to configure the appearance of label controls in the dialog.
maxscript
fn ConfigureLabel lbl val font size clr =
(
local bkgCol = (colorman.getcolor #background * 255) as color;
lbl.textAlign = (dotNetClass "System.Drawing.ContentAlignment").MiddleLeft;
lbl.text = val;
lbl.foreColor = (dotNetClass "System.Drawing.Color").fromArgb clr.r clr.g clr.b;
lbl.backColor = (dotNetClass "System.Drawing.Color").fromArgb bkgCol.r bkgCol.g bkgCol.b;
lbl.font = dotnetobject "System.Drawing.Font" font size;
)
Functionality: Sets text alignment, content, foreground and background colors, and font properties for label controls using .NET classes.
3. User Interface Components
a. AssetValidationSummary Rollout
Provides a summary of the validation process, displays logs, and offers options to bundle the results or export the asset.
Labels: Display summary titles and validation results.
TextBox (summaryDetails): Shows the content of the validation log file.
Buttons:
Bundle: Compresses the validation results into a ZIP file and cleans up temporary folders.
Export GLB: Initiates the export of the asset in GLB format.
Event Handlers:
on open: Configures labels based on the validation status and loads the validation log.
on exportGLBButton pressed: Executes the export process and provides user feedback upon completion.
on bundleButton pressed: Uses the 7za.exe utility to create a ZIP archive of the validation results, removes the original folder, and notifies the user of completion.
b. assetInfoDialog Rollout
The primary dialog where users input asset information required for validation and bundling.
maxscript
rollout assetInfoDialog "All3D Asset Validator & Bundler" width:300
(
label dummyLbl0 "" height:20;
label assetIDLbl "All3D Asset ID:" align:#left;
editText assetIDVal "" height:26;
label dummyLbl1 "" height:20;
radioButtons placementType "Placement Type:" labels:#("Floor", "Wall", "Ceiling") columns:3 align:#left;
label dummyLbl2 "" height:20;
radioButtons purposeType "The asset is meant to be used for" labels:#("Photorealistic Rendering ( High Poly )","Real-time / AR ( Low Poly )","Both") offsets:#([0,5],[0,10],[0,15]) columns:1 align:#left;
label dummyLbl3 "" height:20;
radioButtons materialType "Material Type:" labels:#("Vray","PBR") offsets:#([0,5],[0,10]) columns:1 align:#left;
label dummyLbl4 "" height:20;
button okButton "Proceed";
on purposeType changed num do
(
if num == 1 then
(
materialType.caption = "Material Type:";
materialType.state = 1;
materialType.enabled = true;
)
else if num == 2 then
(
materialType.state = 2;
materialType.caption = "Material Type:";
materialType.enabled = false;
)
else
(
materialType.caption = "High Poly Material Type:";
materialType.state = 1;
materialType.enabled = true;
)
)
on okButton pressed do
(
_assetID = assetIDVal.text;
case placementType.state of
(
1: ( _placementType = "Floor"; )
2: ( _placementType = "Wall"; )
3: ( _placementType = "Ceiling"; )
Default: ( _placementType = "Floor"; )
)
case purposeType.state of
(
1: ( _purpose = "rendering"; )
2: ( _purpose = "realtime"; )
3: ( _purpose = "both"; )
Default: ( _purpose = "rendering"; )
)
case materialType.state of
(
1: ( _materialType = "Vray"; )
2: ( _materialType = "PBR"; )
)
if (_assetID != "" AND (_assetID as Integer) != undefined) then
(
destroyDialog assetInfoDialog;
RaiseFlags();
abortProcess = StartWizard _assetID;
if (abortProcess != 0) do
(
CreateDialog AssetValidationSummary;
)
)
else
(
_assetID = undefined;
messageBox "Please enter a valid Asset ID" title:"Asset ID Invalid!" beep:true;
)
)
)
Components:
Labels and EditText:
Asset ID: Users input the unique identifier for the asset.
Radio Buttons:
Placement Type: Choices include Floor, Wall, Ceiling.
Purpose: Options for Photorealistic Rendering (High Poly), Real-time/AR (Low Poly), or Both.
Material Type: Options for Vray or PBR materials.
Proceed Button: Initiates the validation and bundling process.
Event Handlers:
on purposeType changed: Adjusts the Material Type options based on the selected purpose.
If "Photorealistic Rendering" or "Both" is selected, enables Material Type selection.
If "Real-time/AR" is selected, disables material type selection as PBR is probably implied.
on okButton pressed:
Data Collection: Retrieves and assigns user inputs to respective variables.
Validation: Checks if the Asset ID is provided and is a valid integer.
Process Initiation:
If valid, destroys the current dialog, raises necessary flags, starts the validation wizard, and upon success, displays the validation summary dialog.
If invalid, prompts the user to enter a valid Asset ID.
4. Execution Flow
At the end of the script:
maxscript
if (assetInfoDialog.isDisplayed) then ( destroyDialog assetInfoDialog; )
createDialog assetInfoDialog;
Behavior: Ensures that if the assetInfoDialog is already open, it gets closed before opening a new instance. This prevents multiple instances of the dialog from cluttering the UI.
5. External Dependencies
External DLLs and Modules:
Newtonsoft.Json.dll: A popular JSON framework for .NET, used here likely for handling JSON operations within the _validator_ or _assetExporter_ modules.
7za.exe: A command-line version of 7-Zip used for compressing files into ZIP archives.
_validator_ and _assetExporter_: External modules or scripts not defined within this script. These are crucial for the validation and exporting processes.
6. Error Handling and User Prompts
Throughout the script, especially in helper functions like PickOutputDir, PickMaxFile, and PickTexDir, user cancellations are gracefully handled by:
Prompting the user to confirm if they wish to abort the bundling process.
Allowing the user to retry selecting directories or files if they choose not to abort.
Additionally, input validations ensure that essential information like Asset ID is correctly provided before proceeding.
Summary
The AssetValidatorAndBundler MaxScript serves as an automated pipeline for validating and bundling 3D assets within 3ds Max. It offers a user-friendly interface for inputting asset details, performs necessary validations using external modules, and facilitates the exporting and bundling of assets in various formats. The script enhances efficiency by automating repetitive tasks and ensuring consistency in asset processing, making it a valuable tool for workflows that require meticulous asset management and validation.