Mientras desarrollo la version en ingles, les colge la ayuda en ingles.
Pero el programa sigue en espa
SAFER Poses 1.2.0 for Maya (maya script)
Create and store poses for your characteres
1-3 of 3
Previous
Next
Reviews Love it? Or maybe you want to share some creative ways you're putting this item to use.
-

-
/ Warning: line 103: fopen: unable to open file "d://maya/8.5/scripts//safer_config.mel" for mode "r". // // Error: // // Error: Cannot find file "d://maya/8.5/scripts//safer_set.mel" for source statement. // Getting this when trying to source... i sourced all mel files ... safer.mel is Is empty 0KB... cant Load GUI -
very useful! with the help of Google translate, I have a created a basic English version of saferUI.mel: _______________________________________________________________ //////////////////////////////////////////////////////////////////////////////// // Safer Poses UI ---- escrito por Sergio Fernandez ---------------- 2004 //////////////////////////////////////////////////////////////////////////////// //V1.0 2005 //v1.1 2007 //v1.2 2007 // ************************ GENERAATE INTERFACE ********************************* global proc saferUI() { string $cabe,$ref; $cabe = `internalVar -userScriptDir` + "/safer_logo"; $ref = `internalVar -userScriptDir` + "/safer_none"; global string $saferposesUI; if (`window -exists $saferposesUI` == 0) { $ruta= leoruta(); if ( `size($ruta)` > 0) { eval( "source \""+ $ruta+ "\""); } $saferposesUI = `window -title "Safer Poses v1.2" -width 360 -height 360 -minimizeButton 1 -sizeable 1`; menuBarLayout; menu -label "File" -tearOff false; menuItem -label "Open Character" -c "busca_character"; menuItem -label "Create Character" -c "Create_character"; menuItem -label "Exit" -c ("deleteUI -window "+ $saferposesUI); menu -label "Language" -tearOff false; menuItem -label "Spanish" -c ""; menuItem -label "English" -en false -c ""; menu -label " " -tearOff false; menu -label "Help" -tearOff false; menuItem -label "Help and Recent Updates" -c "Helpsafer"; rowLayout -columnWidth1 370 -height 314 -numberOfColumns 1 -width 362; columnLayout -columnWidth 360 -height 314 -rowSpacing 0 -width 370; image -height 33 -image $cabe -width 360; text -height 5 -label " " -width 80; rowLayout -columnWidth5 100 100 30 105 20 -height 20 -numberOfColumns 5 -width 365; text -align "left" -height 20 -label " Poses" -width 100; text -align "right" -height 18 -label " " -width 100; text -height 18 -label " " -width 30; //text -align "left" -height 18 -label " Preview" -width 104; button -height 20 -backgroundColor 1 1 0 -label "Create Preview" -width 120-command genero_preview; setParent ..; rowLayout -columnWidth3 5 200 160 -height 261 -numberOfColumns 3 -width 365; text -height 17 -label " " -width 5; textScrollList -dcc selecdata -height 249 -width 200 -sc cuandoselecciono casita; rowLayout -columnWidth2 30 120 -height 261 -numberOfColumns 2 -width 160; text -height 17 -label " " -width 30; columnLayout -columnWidth 120 -height 261 -rowSpacing 0 -width 120; image -height 120 -image $ref -width 120 imagenpreview; columnLayout -columnWidth 120 -height 141 -rowSpacing 6 -width 120; button -height 25 -label "NEW POSE" -width 120 -command entername; button -height 25 -label "delete Pose" -width 120 -command borroitem; button -height 25 -label "delete All" -width 120 -command borroitemall; button -height 25 -label "Exit" -width 120 -command ("deleteUI -window "+ $saferposesUI); text -height 5 -label " " -width 80; setParent ..; setParent ..; setParent ..; setParent ..; setParent ..; showWindow $saferposesUI; cargolista; cuandoselecciono; } }; //**************************************************************************** // ******************** ARCHIVO DE Help ******************************** global proc Helpsafer() { $exampleFileName = ( `internalVar -userScriptDir` + "/safer_instalacion.txt" ); system ( "start notepad.exe " + $exampleFileName ); } //************************************************************************************ // ******************** LEO CONFIGURACION DE DIRECTORIO ***************** global proc string leoruta() { global string $MainPath; $exampleFileName = ( `internalVar -userScriptDir` + "/safer_config.mel" ); $fileId=`fopen $exampleFileName "r"`; string $MainPath =""; string $MainPath = `fgetline $fileId`; fclose $fileId; if ($MainPath == "") { $MainPath = ( `internalVar -userScriptDir` + "/safer_set.mel" ); } return $MainPath; } //************************************************************************************ // ******************** GRABADO CONFIGURACION DE ARCHIVO ***************** global proc grabarconfig(string $config) { $exampleFileName = ( `internalVar -userScriptDir` + "/safer_config.mel" ); $fileId=`fopen $exampleFileName "w"`; fprint $fileId $config; fclose $fileId; refrescar; borrolista; cargolista; ordena_lista; //----------------- SI HAY ITEMS EN LA LISTA, SELECCIONO UNO -------------------- int $consulto = `textScrollList -q -ni casita`; if ($consulto > 0) { textScrollList -e -sii 1 casita; } cuandoselecciono; //------------------------------------------------------------------------------- }; //************************************************************************************ // ************************ Search character y grabar en safer_config ************ global proc busca_character() { $ruta = leoruta(); $filtro = dirname($ruta) + "/*.mel"; $abrir_character = `fileDialog -directoryMask $filtro`; if ( `size $abrir_character` == 0 ) { } else { grabarconfig($abrir_character); } }; //************************************************************************************ // ************************ Create CHARACTER ********************************** global proc Create_character() { $ruta = leoruta(); $filtro = dirname($ruta) + "/*.mel"; $abrir_character = `fileDialog -directoryMask $filtro -m 1`; if ( `size $abrir_character` == 0 ) { } else { $ruta_completa =""; $ruta_completa = $abrir_character + ".mel"; //generar el archivo nuevo $fileId=`fopen $ruta_completa "w"`; fprint $fileId ""; fclose $fileId; grabarconfig($ruta_completa); //llamo a la funcion para grabar config } }; //**************************************************************************** // ************************ VERIFICACION DE NUMEROS EN UN STRING ************* global proc string haynumeros(string $entrada) { int $i; string $resulta,$armocadena,$final="N"; for ($i = 0; $i < 10; $i++) { $armocadena="^" + $i; $resulta=`match $armocadena $entrada`; if ($resulta==$i) $final = "S"; } return $final; } //************************************************************************************ // ************************ SELECCIONO LA DATA DE LA LISTA ******************* global proc selecdata() { string $selGroup[] = `textScrollList -q -si casita`; select -clear; eval($selGroup); } //************************************************************************************ // *********************** CARGANDO LA LISTA ****************************** global proc cargolista() { $exampleFileName = leoruta(); global string $arrayparaordenar[]; clear($arrayparaordenar); $fileId=`fopen $exampleFileName "r"`; string $nextLine = `fgetline $fileId`; int $contarray= 0; while ( size( $nextLine ) > 0 ) { string $buffer[]; $numTokens = tokenize($nextLine ," ()", $buffer); for ($i=0 ; $i < $numTokens; $i++) { string $hh=$buffer[$i]; if ($hh=="proc") { $arrayparaordenar[$contarray]=$buffer[$i+1]; $contarray++; } } $nextLine = `fgetline $fileId`; } fclose $fileId; //------------------ ESTO ES PARA ORDENAR Y CARGAR LA LISTA ------------------------------------------ string $arrayordenado[] = sort($arrayparaordenar); for ($i=0 ; $i < size($arrayordenado) ; $i++) { textScrollList -e -a $arrayordenado[$i] casita; } //----------------------------------------------------------------------------------------------------- //----------------- SI HAY ITEMS EN LA LISTA, SELECCIONO UNO -------------------------------------------- int $consulto = `textScrollList -q -ni casita`; if ($consulto > 0) { textScrollList -e -sii 1 casita; } } //************************************************************************************************************* // ************************ delete, REFRESCAR y ORDENAR LA LISTA *********************************************** global proc ordena_lista() { int $itemslista= `textScrollList -q -numberOfItems casita`; string $Allsitems[]= `textScrollList -q -allItems casita`; string $Allsitemssort[] = sort($Allsitems); textScrollList -e -ra casita; for ($i=0 ; $i<$itemslista ; $i++) { textScrollList -e -a $Allsitemssort[$i] casita; } }; //********************************************************************************************************** // ************************ GENERO PREVIEW ************************************* global proc genero_preview() { modelEditor -e -nurbsCurves 0 modelPanel4; modelEditor -e -grid 0 modelPanel4; int $time = `currentTime -query`; string $selGroup[] = `textScrollList -q -si casita`; string $procedimiento = $selGroup[0]; $exampleFileName = ( dirname(leoruta()) + "/safer_preview/" ); if ($procedimiento != "") { playblast -orn off -st $time -et $time -w 120 -h 120 -p 100 -v off -fo -fmt "image" -cf ( $exampleFileName + $procedimiento); } cuandoselecciono; modelEditor -e -nurbsCurves 1 modelPanel4; modelEditor -e -grid 1 modelPanel4; } //************************************************************************************ //************************** CARGAR IMAGEN CUANDO SELECCIONO ************************* global proc cuandoselecciono() { int $time = `currentTime -query`; string $selGroup[] = `textScrollList -q -si casita`; string $procedimiento = $selGroup[0]; $exampleFileName = ( dirname(leoruta() ) + "/safer_preview/" + $procedimiento); $exampleFileName1 = ( `internalVar -userScriptDir` + "/safer_none"); if (`exists $exampleFileName`) { image -e -image $exampleFileName imagenpreview; } else { image -e -image $exampleFileName1 imagenpreview; } } //************************************************************************************ // ******************* COMPILANDO DATA PARA GRABAR ************************** global proc saf(string $name) { string $a[], $attr, $cadena, $final, $head, $end; int $i, $lock, $cuento; float $ss; string $cadena2; $cuento = 0 ; $a = `ls -sl`; $head="//I_"+ $name + "\n" + "global proc " + $name + "(){\n"; $end="}\n" + "//O_"+ $name + "\n"; for ( $i = 0; $i < `size $a`; $i++) //--------------> Selecciono atributos keyfremeables y genero un string <-----------> Graba el string con sus cabeceras para Create el proc <----------------> 0 ) { $cadena = $cadena + $nextLine; $nextLine = `fgetline $fileId`; } fclose $fileId; string $regularExpr = $in + ".*" + $out ; // ************** Reemplazo la cadena por nada ***************** string $exec_command = `substitute $regularExpr $cadena ""`; $exampleFileName2 = leoruta(); $fileId=`fopen $exampleFileName2 "w"`; fprint $fileId $exec_command; fclose $fileId; }; //************************************************************************************ //************************* EJECUTO LO LEIDO ***************************************** global proc refrescar() { string $ruta= leoruta(); eval( "source \""+ $ruta+ "\""); ordena_lista(); } //************************************************************************************** // ************************ DAR EL NOMBRE A UNA LA POSE ********************** global proc entername() { string $a[] = `ls -sl`; if (size($a)==0) { confirmDialog -message "To Create a pose, you have to select at least one object" -title "Warning" -button "Ok" -defaultButton "Ok" -cancelButton "Cancel"; } else { string $resultado = `promptDialog -message "Name New Pose" -button "Ok" -button "Cancel" -defaultButton "Ok" -cancelButton "Cancel" -dismissString "Cancel" -title "NEW POSE"`; if ($resultado=="Ok") { $resultado = `promptDialog -query -text`; string $buscoespace = `match " " $resultado`; if ($buscoespace == " " || haynumeros($resultado)=="S") { confirmDialog -message "The name can not contain spaces, or start with numbers" -title "Name New Pose" -button "Ok" -defaultButton "Ok" -cancelButton "Ok"; } else { textScrollList -e -append $resultado casita; int $consulto = `textScrollList -q -ni casita`; if ($consulto > 0) { textScrollList -e -sii 1 casita; } saf($resultado); } } } } //********************************************************************************************************** // ************************ BORRO ITEM DE LA LISTA Y EJECUTO FUNCION PARA MODIF safer_set ******************* global proc borroitem() { string $resultado = `confirmDialog -message "Delete selected pose?" -button "Ok" -button "Cancel" -defaultButton "Ok" -cancelButton "Cancel" -dismissString "Cancel" -title "delete Pose"`; if ($resultado=="Ok") { int $selGroup[] = `textScrollList -q -sii casita`; string $selGroup2[] = `textScrollList -q -si casita`; int $items = $selGroup[0]; string $cheche = $selGroup2[0]; string $cinicial= "//I_" + $cheche; string $cfinal= "//O_" + $cheche; if ($cheche != "") { textScrollList -e -rii $items casita; leo_borro($cinicial, $cfinal); int $consulto = `textScrollList -q -ni casita`; if ($consulto > 0) { textScrollList -e -sii 1 casita; } string $exampleFileName3 = ( dirname(leoruta()) + "/safer_preview/" + $cheche); string $fre = "\\"; string $fre1 = "//"; string $reemplazobarra = substituteAllString($exampleFileName3, $fre, $fre1); sysFile - delete $reemplazobarra; } } cuandoselecciono; } //************************************************************************************ // ************************ BORRO **************************************************** global proc borro_all_imagenes() { string $pp[]= `textScrollList -q -ai casita`; for ($i=0; $i); image -e -image $exampleFileName1 imagenpreview; } //************************************************************************************
Please confirm your email before commenting.