// ========================================================================== // http://www.tjgalda.com // // Copyright (C) 2007 TJ Galda. All rights reserved. // // The coded instructions, statements, computer programs, and/or related // material (collectively the "Data") in these files contain unpublished // information proprietary to TJ Galda which is protected by U.S. and // Canadian federal copyright law and by international treaties. // // The Data is provided for use exclusively by You. You have the right // to use, modify, and incorporate this Data into other products for // purposes authorized by TJ Galda, without fee. // // The copyright notices in the Software and this entire statement, // including the above license grant, this restriction and the // following disclaimer, must be included in all copies of the // Software, in whole or in part, and all derivative works of // the Software, unless such copies or derivative works are solely // in the form of machine-executable object code generated by a // source language processor. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. // TJ GALDA DOES NOT MAKE AND HEREBY DISCLAIMS ANY EXPRESS OR IMPLIED // WARRANTIES INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES OF // NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR // PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE, OR // TRADE PRACTICE. IN NO EVENT WILL TJ GALDA AND/OR ITS LICENSORS // BE LIABLE FOR ANY LOST REVENUES, DATA, OR PROFITS, OR SPECIAL, // DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES, EVEN IF TJ GALDA // AND/OR ITS LICENSORS HAS BEEN ADVISED OF THE POSSIBILITY // OR PROBABILITY OF SUCH DAMAGES. // // http://www.tjgalda.com // ========================================================================== // // TJ Galda Script File // MODIFY THIS AT YOUR OWN RISK // // Creation Date: tj, May 8 2001 // // Procedure Name: // tj_cameraSliders.mel // // Description: // colourizes dormant wireframes // // explanation: the user selects a colour // via a number that is directly assigned to // their user colour area under window -> preferences // this then is used to colourize the dormant wireframe for // all the selected objects // // Input Arguments: // None // // Return Value: // None. // // http://www.tjgalda.com // ========================================================================== global proc tj_colourizer() { ////////////////// // define default strings ////////////////// string $tj_selected_nodes[]; int $tj_user_colour_choice = 2; print("Starting..."); ////////////////// // start window ////////////////// if ( `window -exists TJ_colourizer_window` ) deleteUI -window TJ_colourizer_window; window -widthHeight 100 100 -title "TJ Colourizer" -in "TJ_colourizer_window" -rtf true -mxb false -s true TJ_colourizer_window; ////////////////// // window interface ////////////////// print("Init: interface"); columnLayout; textFieldGrp -label "User Colour to Assign [1-8]" -ann "This is straight from the colour preference window, choices from 1 to 8" -text $tj_user_colour_choice -cc "tj_updateColourizerWindow" current_tj_user_colour_choice; button -label " Colour Assign " -command "tj_colourizer_proc()" tj_assign_button; ////////////////// // Show window ////////////////// print("Show Window"); showWindow TJ_colourizer_window; } //-------Window.Done----------------------------------------------------------- global proc tj_updateColourizerWindow() { //////////////// // Get UI values //////////////// int $label_current_tj_user_colour_choice = `textFieldGrp -q -tx current_tj_user_colour_choice`; if ($label_current_tj_user_colour_choice > 8) { string $tj_error_message = "ERROR: Must be a number from 1-8"; print $tj_error_message; $label_current_tj_user_colour_choice = 8; button -edit -label $tj_error_message tj_assign_button; } else if ($label_current_tj_user_colour_choice < 1) { string $tj_error_message = "ERROR: Must be a number from 1-8"; print $tj_error_message; $label_current_tj_user_colour_choice = 8; button -edit -label $tj_error_message tj_assign_button; } else { string $tj_assign_button_text = (" Assign Colour # " + $label_current_tj_user_colour_choice + " "); button -edit -label $tj_assign_button_text tj_assign_button; } } //-------Update.Done----------------------------------------------------------- ///////////////////////////// // execution ////////////////////////////// // global proc tj_colourizer_proc() { //////////////// // Get UI values //////////////// string $label_current_tj_user_colour_choice = `textFieldGrp -q -tx current_tj_user_colour_choice`; // store all the selected items string $tj_selected_nodes[]; string $tj_selected_nodes[] = `selectedNodes`; // loop for all selected for ($t = 0; $t < `size($tj_selected_nodes)`; $t++) { // store the colour -ud command in a temp string so will execute properly string $temp_command = "color -ud " + $label_current_tj_user_colour_choice + " " +$tj_selected_nodes[$t]; // evaluate the temp string eval $temp_command; } } ///////// // end // /////////