/* This file downloaded from Highend3d.com '' '' Highend3d.com File Information: '' '' Script Name: Onion Skin '' Author: '' Last Updated: Feb 24, 2007 '' Update/Change this file at: '' http://Highend3d.com/maya/downloads/mel_scripts/animation/4523.html '' '' Please do not alter any information above this line '' it is generated dynamically by Highend3d.com and will '' be changed automatically on any updates. */ // Onion Skin v 0.8.3 // // Creation Date : 7th FEB 2007 // // Author : Syed Ali Ahsan // // E-mail : yoda@cyber.net.pk // // Description: // This script uses Maya imageplane to create something like traditional Onion Skin. // // Thanks to Mark Behm for some very nice ideas !!! // Instruction: // * Select the viewport you want to Onion skin. // * Press Onionize to snap shot a single frame. // or select multiple frames from timeslider with drag. Press Onionize // * If you select any MESH object, and Onionize (either multiframe or single frame) // OnionSkin will create an outlined onion skin // * The referesh button will update the last set from frames. // * fix offseting button, fixes any OnionSkin misalignement. // ////////////////////////////////////////////////////////////////////////// // Special thanks to: // // // // * Melt van der Spuy (Animation Mentor) // // * Vincent Florio (Animation Mentor) // // * Keith Lango // // * Herman Gonzalas // // * Lord Ryan Santos // // // // For feature ideas and testing // ////////////////////////////////////////////////////////////////////////// // // Todo: // 1. Better multiple frame support. // 2. Clean the garbage. // //----------------------------------------------------------------------------------------------------------- // Main Procedure - onionMain() //----------------------------------------------------------------------------------------------------------- //History : //0.8.3 - Viewport setFocus debug //0.8.2 - Hide controls when Onionizing //0.8.1 - Outline bug fix //0.8.0 - Outline for selected, viewport selection, multiframe. //0.7.9 - Fix for large scenes //0.7.8 - Added frame buttons //0.7.7 - Bug fix of viewport fit type //0.7.6 - Remembers modelPanel //0.7.5 - Added fix for Onion offset on wide viewports //0.7 - Added multi frame update feature //0.6.5 - Added compatibility for Maya 7 // snapshot frame size now 640x480 // Basic interface added //0.5 - Multiframe support global float $frameArray[]; global string $modelPanel; global int $fitType; global int $viewportState[]; global int $isolateMode; global proc onionMain() { global float $frameArray[]; float $currentFrame = `currentTime -q`; int $arrayCount = `size($frameArray)`; $frameArray[$arrayCount] = $currentFrame; if ($arrayCount >= 0) button -e -en 1 BTNrefresh; float $min = timeRange(0); float $max = timeRange(1); float $range = $max - $min; if ($range == 1) { onionEXE ($frameArray[$arrayCount]); } else { clear ($frameArray); int $j=0; for ($i=$min; $i < $max; $i++) { $frameArray[$j] = $i; $j++; } onionRefresh(); } } global proc onionRefresh() { global string $modelPanel; global float $frameArray[]; if (objExists ("OnionIP")) { delete("OnionIP"); setFocus $modelPanel; } for ($i=0; $i|" BTNnextKey; button -c "stepForward" -label ">" BTNstepForward; setParent ..; rowColumnLayout -numberOfColumns 2 -columnWidth 1 205 -columnWidth 2 25; textField -en false -tx "no viewport selected" -width 200 txtViewport; button -c "viewportSelect" -label "Sel" BTNviewSel; setParent ..; columnLayout; button -en false -width 230 -al "center" -c "onionHide" -label "Hide" BTNhide; button -en false -width 230 -al "center" -c "onionRefresh" -label "Refresh" BTNrefresh; button -en false -width 230 -al "center" -c "deleteOnion" -label "deleteAll" BTNdeonionize; button -en false -width 230 -al "center" -c "fixOffset" -label "fix Offseting" BTNfixOffset; button -en false -width 230 -al "center" -c "isolateMode" -label "Outline Mode OFF" BTNisolate; $isolateMode = 0; showWindow WM_dbMain; window -e -wh 239 189 -s 1 WM_dbMain; window -q -wh WM_dbMain; global int $fitType; $fitType = 0; if (objExists ("OnionIP")) { button -e -en 1 BTNdeonionize; } if (size($frameArray) > 0) { button -e -en 1 BTNrefresh; } } goOnion();