Page 1 of 1

Creates a batch optimizer in a simple way

Posted: Mon Apr 29, 2024 3:31 pm
by mootools
Polygon Cruncher SDK provides a simple way to create your own custom command line optimizer.
This command line optimizer work in a similar way than Polygon Cruncher Command Line end-user software.


This can be done using the class BatchCruncherOptions and CBatchOptimizer

The following code allows to perform the processing:

Code: Select all

	// SDK initialization code should be called below
	...
	// the command line version turns off all by default
	unsigned int flags = BatchCruncherOptions::BATCH_HANDLE_SCENE_DELETION | BatchCruncherOptions::BATCH_NO_DIALOG | BatchCruncherOptions::BATCH_NO_SPLASH;
	CCustomData cmddata;
	BatchCruncherOptions options(cmddata, flags);
	options.InitFromCommandLine(argc, argv);
	if (cmddata.HasData()) // We have some information on the command line
	{
		CBatchOptimizerCommandLine optimizer(options);
		optimizer.Batch();
	}
Once compiled you can then call your optimization process and process a whole set of files.

For example:

YourAppName.exe -input-dir "D:/sample" -input-recursedir -magic-similarity 0 -ouput-numberingmode 1 -uv-protect -uv-tolerance 0.001 -vc-protect -vc-tolerance 10 -normal-protect -normal-tolerance 3 -ouput-namesuffix " " -output-convertformat ".obj"