User Tools

Site Tools


This page exists within the Old ArtZone Wiki section of this site. Read the information presented on the linked page to better understand the significance of this fact.

Getting the script accessible settings from an importer/exporter.

Author: Rob Whisenant, © 2008


Below are examples of how to retrieve the script accessible settings from all importers/exporters.

Importers

* The DAZ Studio API, prior to version 2.3.3.57, is lacking the DzImportMgr::getImporter() function, so the importer example below will fail.

var oIMPORT_MANAGER = App.getImportMgr();
var nIMPORTERS = oIMPORT_MANAGER.getNumImporters();
var oImporter, oSettings;
var sImporterExtensions;
var nExtensions;
for( var i = 0; i < nIMPORTERS; i++ ){
	oImporter = oIMPORT_MANAGER.getImporter( i );
	oSettings = new DzFileIOSettings();
	oImporter.getOptions( oSettings, false );
	print( "-----------------------------" );
	print( String( "Class Name : %1" ).arg( oImporter.className() ) );
	print( String( "Description : %1" ).arg( oImporter.getDescription() ) );
 
	sImporterExtensions = ''; 
	nExtensions = oImporter.getNumExtensions(); 
	for( var j = 0; j < nExtensions; j++ ){ 
	   if( j > 0 ){ sImporterExtensions += ', '; } 
	   sImporterExtensions += oImporter.getExtension( j ); 
	}
 
	print( String( "Extension : %1" ).arg( sImporterExtensions ) );
	print( oSettings.toString() );
	print( "\n" );
}

Exporters

var oEXPORT_MANAGER = App.getExportMgr();
var nEXPORTERS = oEXPORT_MANAGER.getNumExporters();
var oExporter, oSettings;
for( var i = 0; i < nEXPORTERS; i++ ){
	oExporter = oEXPORT_MANAGER.getExporter( i );
	oSettings = new DzFileIOSettings();
	oExporter.getOptions( oSettings, false );
	print( "-----------------------------" );
	print( String( "Class Name : %1" ).arg( oExporter.className() ) );
	print( String( "Description : %1" ).arg( oExporter.getDescription() ) );
	print( String( "Extension : %1" ).arg( oExporter.getExtension() ) );
	print( oSettings.toString() );
	print( "\n" );
}