Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Copyright L. Spiro 2009
- * All rights reserved.
- *
- * Written by: Shawn (L. Spiro) Wilcoxen
- *
- * This code may not be sold or traded for any personal gain without express written consent. You may use
- * this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact.
- * You may not take credit for having written this code.
- * If you wish to use this code in a commercial product contact yogurtemperor@hotmail.com.
- *
- * Description: Add options to the exporter.
- */
- global proc int LSpiroModelsOptions( string $parent,
- string $action,
- string $initialSettings,
- string $resultCallback ) {
- // Return value.
- int $bResult = 1;
- // For parsing the options strings.
- string $currentOptions;
- string $optionList[];
- string $optionBreakDown[];
- if ( $action == "post" ) {
- setParent $parent;
- columnLayout -adj true lsmTypeCol;
- string $modelOnly = (uiRes("m_LSpiroModelsOptions.kModelOnly"));
- string $modelAndAnims = (uiRes("m_LSpiroModelsOptions.kModelAndAnims"));
- string $animsOnly = (uiRes("m_LSpiroModelsOptions.kAnimOnly"));
- radioButtonGrp
- -label (uiRes("m_LSpiroModelsOptions.kAnims"))
- -nrb 3 -cw4 175 95 95 95
- -labelArray3 $modelAndAnims $modelOnly $animsOnly lsmAnims;
- // Current settings.
- $currentOptions = $initialSettings;
- if ( size( $currentOptions ) > 0 ) {
- tokenize( $currentOptions, ";", $optionList );
- for ( $index = 0; $index < size( $optionList ); $index++ ) {
- tokenize( $optionList[$index], "=", $optionBreakDown );
- if ( $optionBreakDown[0] == "anims" ) {
- if ( $optionBreakDown[1] == "0" ) {
- radioButtonGrp -e -sl 1 lsmAnims;
- }
- if ( $optionBreakDown[1] == "1" ) {
- radioButtonGrp -e -sl 2 lsmAnims;
- }
- else {
- radioButtonGrp -e -sl 3 lsmAnims;
- }
- }
- }
- }
- $result = 1;
- }
- else if ( $action == "query" ) {
- if ( `radioButtonGrp -q -sl lsmAnims` == 1 ) {
- $currentOptions = $currentOptions + "anims=0";
- }
- else if ( `radioButtonGrp -q -sl lsmAnims` == 2 ) {
- $currentOptions = $currentOptions + "anims=1";
- }
- else {
- $currentOptions = $currentOptions + "anims=2";
- }
- eval( $resultCallback + " \"" + $currentOptions + "\"" );
- $result = 1;
- }
- return $bResult;
- }
- // REGISTERED WITH:
- // Register the translator with the system.
- mStatus = mpPlugin.registerFileTranslator( "L. Spiro Models",
- "",
- MPI_CharExport::creator,
- "LSpiroModelsOptions",
- "anims=1;" );
- // Radio boxes are always unchecked when the dialog first appears.
- // The default "anims=1" seems to do nothing.
Add Comment
Please, Sign In to add comment