Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2014
    Posts
    5

    Maya File Specific type Options

    I have a script in which this sets in the options in the File Type Specific Options as User clicks on File >> Export Selection option menu

    However I am having some trouble in getting the selection in the radiobutton to work in the plugin.
    Within the two radio buttons, whichever that I choose, it seems to be printing out only the first function.

    Any ideas on who I can make it to print either function based on which radiobutton is selected?


    Options scrpt - http://pastebin.com/raw.php?i=AcLG495X
    Plugin - http://pastebin.com/raw.php?i=gc5y89AA

  2. #2
    Join Date
    Apr 2011
    Posts
    103
    like this???

    Code:
    rowColumnLayout -numberOfColumns 3;
    	text -label "Range Selection";
    	radioCollection;
    		radioButton -label "Use Object Range" -onCommand uorProc -select;
    		radioButton -label "Use Time Slider Range" -onCommand utsrProc;
    this is how use raidoButtons. Substituted my labels for yours and made up some cammand proc to execute.

  3. #3
    Join Date
    Oct 2014
    Posts
    5
    Hey PencilShavings, thanks for getting back to me despite my late reply.
    Anyway I have found out the cause to my issue. Thanks again!

  4. #4
    Join Date
    Oct 2011
    Posts
    547
    Quote Originally Posted by salik View Post
    Hey PencilShavings, thanks for getting back to me despite my late reply.
    Anyway I have found out the cause to my issue. Thanks again!
    Could you post the solution that you have taken to fix the issue or if the solution provided by PencilShavings was the one used? Others might encounter this issue so it would be helpful for them.

    Thanks.

  5. #5
    Join Date
    Oct 2014
    Posts
    5
    It was an error in the variables part. I think I did not edit the variables accordingly in the query part...

    But here you go, hopefully someone may find it useful

    Code:
    // $parent - the parent UI layout
    // $action - "post" or "query"
    // $initialSettings - the initial exporter settings
    // $resultCallback - the function to call
    //
    global proc int chanOptions(	string $parent,
    									    string $action,
    									    string $initialSettings,
    									    string $resultCallback ) {
    
    	int $result;
    	string $currentOptions;
    	string $optionList[];
    	string $optionBreakDown[];
    	int $index;
    
     	// if we need to create the user interface... 
    	if ($action == "post") {
    
    		setParent $parent;
    
    		columnLayout -adj true;
    		radioButtonGrp 
    			-l "Range Mode"
    			-nrb 2 -cw3 175 75 75
    			-la2 "Option1" "Option2" optMode;
    
    		if (size($initialSettings) > 0) {
    			tokenize($initialSettings, ";", $optionList);
    			for ($index = 0; $index < size($optionList); $index++) {
    				tokenize($optionList[$index], "=", $optionBreakDown);
    
                    // This selects the radioButtons
    				if ($optionBreakDown[0] == "m") {
    					if ($optionBreakDown[$index++] == "0") {
    						radioButtonGrp -e -sl 1 optMode;
    					} else {
    						radioButtonGrp -e -sl 2 optMode;
    					}
    				} 
    			}
    		}
    		$result = 1;
    	} 
        
        else if ($action == "query") {
    
    		if (`radioButtonGrp -q -sl optMode` == 2) {
    			$currentOptions = $currentOptions + "m=1";
    		} else {
    			$currentOptions = $currentOptions + "m=0";
    		}
    
    
    		eval($resultCallback+" \""+$currentOptions+"\"");
    		$result = 1;
    	} else {
    		$result = 0;
    	}
    	
    	return $result;
    }

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •