// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // fltOptions() // // Description: // // This script posts the OpenFlight file translator options. // The optionsString is of the form: // // varName1=value1;varName2=value2;... // // Parameters: // // $parent - The ELF parent layout for this options layout. // $action - The action that is to be performed with the invocation of this procedure. // Valid options are: // // "query" - Construct the options string and pass it to the resultCallback. // "post" - post all the ELF controls. // // $initialSettings - The current options string in effect at the time this procedure is called. // $resultCallback - This is the procedure to be called with the result string: // // "resultCallback( string $optionsString );" // // Return Values: // // 1 - if successful // 0 - otherwise // global proc int fltOptions( string $parent, string $action, string $initialSettings, string $resultCallback ) { int $result = 1; string $optionsString = $initialSettings; // If we are in "post" mode, generate the UI for the translator options. // if( $action == "post" ) { setParent $parent; // Hide the "optionsBoxForm" layout during UI generation. // formLayout -e -vis false optionsBoxForm; // Generate UI. // columnLayout -adj true -rs 10; columnLayout -adj true; checkBox -l "Convert Grouped Faces to Mesh Objects" fltConvertToMesh; checkBox -l "Import unused records" fltImportAllRecords; setParent ..; frameLayout -l "Selective Loading" -cll false -li 5 -fn "smallPlainLabelFont" -mh 10 -mw 5 fltSelectiveLoading; columnLayout -adj true; checkBoxGrp -ncb 2 -l1 "Polygon Meshes" -l2 "Materials" fltSelectiveLoadOpts1; checkBoxGrp -ncb 2 -l1 "Textures" -l2 "Lights" fltSelectiveLoadOpts2; setParent ..; setParent ..; frameLayout -l "File I/O Reporting" -cll false -li 5 -fn "smallPlainLabelFont" -mh 10 -mw 5 fltFileIOReporting; columnLayout -adj true; text -l "Import Reports" -al "left" -fn "smallPlainLabelFont" fltImportReportLabel; separator -h 5 -style "none"; checkBox -l "Post Process Report" fltImpPostProcReport; checkBox -l "File Structure Report" fltImpFileStructReport; checkBox -l "Read Structure Report" fltImpReadStructReport; setParent ..; setParent ..; setParent..; formLayout -e -vis true optionsBoxForm; } // Else, if we are in "query mode", construct the options string and pass it to // the resultCallback. // else if( $action == "query" ) { // File I/O Reporting // $optionsString += "ImpProcRpt=" + `checkBox -q -v fltImpPostProcReport` + ";"; $optionsString += "ImpFileRpt=" + `checkBox -q -v fltImpFileStructReport` + ";"; $optionsString += "ImpReadRpt=" + `checkBox -q -v fltImpReadStructReport` + ";"; eval( $resultCallback + " \"" + $optionsString + "\"" ); } return $result; }