Creates a batch optimizer in a simple way

Question and answer about Polygon Cruncher SDK
Post Reply
Site Admin
Posts: 282
Joined: Thu Jul 05, 2007 11:06 am

Creates a batch optimizer in a simple way

Post by mootools » Mon Apr 29, 2024 3:31 pm

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);
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"

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest