What is API in Model Packer
API stands for Application Programming Interface.
In Model Packer, the API is represented as a Structure, and allows automatic packing entirely at the software level without human intervention.
Also, this tutorial will describe how to work with manifest files to get programmatic access to the information they contain.
Important!Download Model Packer
To use the API, you must have minimal knowledge of Maxscript!
A simple example of using the API
To use the API, you need to enable them with:
Next, you need to run the script and initialize:
try(fileIn script) catch()
api = ::MODEL_PACKER_API()
Next, enable the desired preset, transfer the data and start packing:
api.inputData() -- How to use see example
See an example for a detailed breakdown.
An example of batch packing using the API
Parsing data from manifest files
Extracting data with Maxscript
Using the Maxscript example below, you can extract files from the archive, find the *.ini file and get any information from it. The code is not complicated and there are many comments to it.
Maxscript execution result:
Extracting data with PHP
Using the PHP example below, you can extract files from the archive, find the * .xml file and get any information from it. The code is not complicated and there are many comments to it.
PHP execution result:
Search in manifest files
Copy the code below, save it to a file with the "bat" extension, for example "Find in my library.bat".
Place "Find in my library.bat" in your 3D model library folder. The search will be carried out in all subfolders, start with the one containing the * .bat file.
The main condition is that the archives must be unzipped.
Run "Find in my library.bat", enter search words separated by a space and press Enter. Folders will be opened for all found models.
This is a fairly primitive way to search, but it works well for small libraries.