User Tools

Site Tools


Save Filter Settings

Summary

Below is an example demonstrating how you can inspect the script accessible settings of each save filter.

API Areas of Interest

Example

SaveFilter_Settings.dsa
// Define an anonymous function;
// serves as our main loop,
// limits the scope of variables
(function(){
 
	// Get the asset IO manager
	var oAssetIOMgr = App.getAssetIOMgr();
	// Get the number of filters
	var nFilters = oAssetIOMgr.getNumFilters();
 
	// Declare variables we'll be using as we iterate
	var oAssetIOFilter, oSettings;
 
	// Iterate over all filters
	for( var i = 0; i < nFilters; i += 1 ){
		// Get the 'current' filter
		oAssetIOFilter = oAssetIOMgr.getFilter( i );
		// Create a new settings object to collect settings with
		oSettings = new DzFileIOSettings();
		// Cause the filter to give up the goods,
		// without displaying its options dialog
		oAssetIOFilter.getOptions( oSettings, false, "" );
		// Dump information about the filter to the console/log,
		// so we can see what we are dealing with
		print( "-----------------------------" );
		print( "Class Name :", oAssetIOFilter.className() );
		print( "Description :", oAssetIOFilter.getDescription() );
		print( "Support Asset :", oAssetIOFilter.isSupportAssetFilter() );
		print( "Compatiblity Base :", oAssetIOFilter.getCompatiblityBase() );
		print( "Content Type :", oAssetIOFilter.getContentType() );
		print( "Standard Save :", oAssetIOFilter.getStandardSaveRelativePath() );
		print( "Do Save :", oAssetIOFilter.getDoSavePath() );
		print( "Load Save :", oAssetIOFilter.getLoadSavePath() );
		print( "Settings :", oSettings.toJsonString() );
		print( "\n" );
	}
 
// Finalize the function and invoke
})();