<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>NikosGatos.com &#124; Blog</title>
	<atom:link href="http://blog.nikosgatos.com/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.nikosgatos.com</link>
	<description>Maya, MEL, Python, RenderMan, RSL</description>
	<lastBuildDate>Mon, 16 May 2011 22:44:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>MEL: Remove objects from sets</title>
		<link>http://blog.nikosgatos.com/index.php/2011/05/16/mel-remove-objects-from-sets/</link>
		<comments>http://blog.nikosgatos.com/index.php/2011/05/16/mel-remove-objects-from-sets/#comments</comments>
		<pubDate>Mon, 16 May 2011 22:35:46 +0000</pubDate>
		<dc:creator>nikos</dc:creator>
				<category><![CDATA[MEL]]></category>
		<category><![CDATA[Maya]]></category>

		<guid isPermaLink="false">http://blog.nikosgatos.com/?p=111</guid>
		<description><![CDATA[One can only wonder why Autodesk has never added a simple command to the standard menus for removing objects from sets. Instead the normal user has to go through the Relationship Editor to remove objects. Here&#8217;s a command that simplifies the process. Usage: removeFromSet Make sure you have selected at least one object and a [...]]]></description>
			<content:encoded><![CDATA[<p>One can only wonder why Autodesk has never added a simple command to the standard menus for removing objects from sets. Instead the normal user has to go through the Relationship Editor to remove objects. Here&#8217;s a command that simplifies the process. </p>
<p>Usage: <strong>removeFromSet</strong><br />
Make sure you have selected at least one object and a set</p>
<pre class="brush: jscript; title: ;">
proc removeFromSet() {
    string $objectSets[] = `ls -sl -type objectSet`;
    string $selection[] = `ls -sl`;
    $selection = stringArrayRemove( $objectSets, $selection );
    for ( $set in $objectSets ) {
        for ( $sel in $selection ) {
            if ( `sets -im $set $sel` ) {
                sets -rm $set $sel;
            }
        }
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.nikosgatos.com/index.php/2011/05/16/mel-remove-objects-from-sets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MEL: Find and edit a procedure</title>
		<link>http://blog.nikosgatos.com/index.php/2011/05/13/mel-find-and-edit-a-procedure/</link>
		<comments>http://blog.nikosgatos.com/index.php/2011/05/13/mel-find-and-edit-a-procedure/#comments</comments>
		<pubDate>Fri, 13 May 2011 14:07:42 +0000</pubDate>
		<dc:creator>nikos</dc:creator>
				<category><![CDATA[MEL]]></category>
		<category><![CDATA[Maya]]></category>

		<guid isPermaLink="false">http://blog.nikosgatos.com/?p=103</guid>
		<description><![CDATA[Here&#8217;s a handy little tool I always use if I want to quickly find and edit the procedure of a MEL script I don&#8217;t know the location of. The $editor variable can be changed to point to your favourite text editor. Usage: edit &#8220;nameofprocedure&#8221;; global proc edit( string $file ) { string $editor; if (`about [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a handy little tool I always use if I want to quickly find and edit the procedure of a MEL script I don&#8217;t know the location of.</p>
<p>The $editor variable can be changed to point to your favourite text editor.</p>
<p>Usage:<br />
<strong>edit &#8220;nameofprocedure&#8221;;</strong></p>
<pre class="brush: jscript; title: ;">
global proc edit( string $file ) {
	string $editor;
	if (`about -linux`){
		$editor = &quot;nedit&quot;;
	}
	else if (`about -nt`){
		$editor = &quot;notepad&quot;;
	}
	string $result = `whatIs $file`;
	string $buffer[];
	tokenize( $result, &quot; &quot;, $buffer );
	exec( $editor + &quot; &quot; + $buffer[ size($buffer) - 1 ] );
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.nikosgatos.com/index.php/2011/05/13/mel-find-and-edit-a-procedure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python: Controlling window size and position</title>
		<link>http://blog.nikosgatos.com/index.php/2011/05/07/python-controlling-window-size-and-position/</link>
		<comments>http://blog.nikosgatos.com/index.php/2011/05/07/python-controlling-window-size-and-position/#comments</comments>
		<pubDate>Sat, 07 May 2011 22:05:40 +0000</pubDate>
		<dc:creator>nikos</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Maya 2011]]></category>
		<category><![CDATA[Win32]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.nikosgatos.com/?p=93</guid>
		<description><![CDATA[32 bit Maya Windows users can control the size and position of a window by querying the GetSystemMetrics command that is part of the win32api module. import sys sys.path.append( 'c:/python26//lib/site-packages/win32' ) # Path to Python package from win32api import GetSystemMetrics import maya.cmds as cmds # Create a window that is exactly center on screen systemWidth [...]]]></description>
			<content:encoded><![CDATA[<p>32 bit Maya Windows users can control the size and position of a window by querying the GetSystemMetrics command that is part of the win32api module.</p>
<pre class="brush: jscript; title: ;">
import sys
sys.path.append( 'c:/python26//lib/site-packages/win32' )     # Path to Python package
from win32api import GetSystemMetrics
import maya.cmds as cmds

# Create a window that is exactly center on screen
systemWidth = GetSystemMetrics (0)
systemHeight = GetSystemMetrics (1)
width = systemWidth / 2
height = systemHeight / 2
left = width / 2
top = height / 2

window = cmds.window()
cmds.showWindow( window )
cmds.window( window, edit=True, topLeftCorner=( top, left ), widthHeight=( width, height ) )
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.nikosgatos.com/index.php/2011/05/07/python-controlling-window-size-and-position/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python: getAttr and setAttr with color attributes</title>
		<link>http://blog.nikosgatos.com/index.php/2011/04/25/python-getattr-and-setattr-with-color-attributes/</link>
		<comments>http://blog.nikosgatos.com/index.php/2011/04/25/python-getattr-and-setattr-with-color-attributes/#comments</comments>
		<pubDate>Mon, 25 Apr 2011 13:29:41 +0000</pubDate>
		<dc:creator>nikos</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Maya]]></category>
		<category><![CDATA[PyMEL]]></category>

		<guid isPermaLink="false">http://blog.nikosgatos.com/?p=75</guid>
		<description><![CDATA[Maya&#8217;s built-in Python support leaves plenty of things to be desired when it comes to dealing with arrays of attributes. Lets say we want to set the color of the built-in lambert shader. # The hard way import maya.cmds as cmds color = cmds.getAttr( &#34;lambert1.color&#34; ) # result: [(0.5, 0.5, 0.5)] cmds.setAttr( &#34;lambert1.color&#34;, color[0][0], color[0][1], [...]]]></description>
			<content:encoded><![CDATA[<p>Maya&#8217;s built-in Python support leaves plenty of things to be desired when it comes to dealing with arrays of attributes. Lets say we want to set the color of the built-in lambert shader.</p>
<pre class="brush: jscript; title: ;">
# The hard way
import maya.cmds as cmds
color = cmds.getAttr( &quot;lambert1.color&quot; )
# result: [(0.5, 0.5, 0.5)]
cmds.setAttr( &quot;lambert1.color&quot;, color[0][0], color[0][1], color[0][2], type=&quot;double3&quot; )
</pre>
<p>As we can see the built-in Python module returns a tuple wrapped in a list. This is very strange and not very handy. Fortunately the bright minds behind PyMEL for Maya wrote the attribute functions the way they were meant to be run.</p>
<pre class="brush: jscript; title: ;">
# The easy way
from pymel.core import *
color = getAttr( &quot;lambert1.color&quot; )
# result: (0.5, 0.5, 0.5)
setAttr( &quot;lambert1.color&quot;, color )
</pre>
<p>Much better and we don&#8217;t even have to specify the data type when setting the attribute.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nikosgatos.com/index.php/2011/04/25/python-getattr-and-setattr-with-color-attributes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MEL: Render Time Calculator</title>
		<link>http://blog.nikosgatos.com/index.php/2011/04/19/mel-render-time-calculator/</link>
		<comments>http://blog.nikosgatos.com/index.php/2011/04/19/mel-render-time-calculator/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 22:55:46 +0000</pubDate>
		<dc:creator>nikos</dc:creator>
				<category><![CDATA[MEL]]></category>
		<category><![CDATA[Maya 2011]]></category>

		<guid isPermaLink="false">http://blog.nikosgatos.com/?p=54</guid>
		<description><![CDATA[I decided to write a Render Time Calculator to pseudo estimate how long a render job will take after all layers have been added up. Feel free to update, improve and modify the code and let me know if you come up with something worth sharing. I&#8217;ve only tested it in Maya 2011 and know [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to write a Render Time Calculator to pseudo estimate how long a render job will take after all layers have been added up. Feel free to update, improve and modify the code and let me know if you come up with something worth sharing. I&#8217;ve only tested it in Maya 2011 and know that the interface will probably break when run in an older pre-QT Maya environment</p>
<p>Usage:<br />
<strong>renderTimeCalculator();</strong>   // will only run in Maya 2011 or later</p>
<p><img src="http://blog.nikosgatos.com/wp-content/upload/2011/render_time_calculator.gif" alt="Render Time Calculator" /></p>
<pre class="brush: jscript; title: ;">
global proc renderTimeCalculator_createUI( string $renderLayer[] ) {
    string $window = `window -rtf true -title &quot;Render Time Calculator&quot; `;

	string $form = `formLayout`;
	string $tabs = `tabLayout -innerMarginWidth 5 -innerMarginHeight 5`;

	formLayout -edit
		-attachForm $tabs &quot;top&quot;    3
		-attachForm $tabs &quot;left&quot;   3
		-attachForm $tabs &quot;bottom&quot; 3
		-attachForm $tabs &quot;right&quot;  3
	$form;

	string $child1 = `columnLayout -adjustableColumn true &quot;ctl_layers_columnLayout&quot;`;
		rowColumnLayout -cw 1 50 -cw 2 50 -cw 3 50 -cw 4 50 -cw 5 70 -cw 6 50 -numberOfColumns 6 &quot;ctl_framerange_rowColumnLayout&quot;;
			text -label &quot;Start&quot; &quot;ctl_start_text&quot;;
			intField
				-value (`playbackOptions -q -ast`)
				-cc &quot;renderTimeCalculator_addValues();&quot;
				&quot;ctl_start_intField&quot;;

			text -label &quot;End&quot; &quot;ctl_end_text&quot;;
			intField
				-value (`playbackOptions -q -aet`)
				-cc &quot;renderTimeCalculator_addValues();&quot;
				&quot;ctl_end_intField&quot;;

			text -label &quot;Frames&quot; &quot;ctl_frames_text&quot;;
			floatField -pre 1 -cc &quot;renderTimeCalculator_addValues()&quot; &quot;ctl_frames_floatField&quot;;
		setParent..;

		separator -style &quot;in&quot; &quot;ctl_div1_separator&quot;;

		columnLayout -adjustableColumn true &quot;ctl_renderlayers_columnLayout&quot;;
			for ( $layer in $renderLayer ) {

				int $isEnabled = `getAttr ($layer+&quot;.renderable&quot;)`;
				if ( $layer == &quot;defaultRenderLayer&quot; ) $layer = &quot;masterLayer&quot;;

				rowColumnLayout -cw 1 150 -cw 2 300 -numberOfColumns 3 (&quot;ctl_&quot;+$layer+&quot;_rowColumnLayout&quot;);
					string $floatSliderGrpLabel = (&quot;ctl_&quot;+$layer+&quot;_floatSliderGrp&quot;);

					popupMenu;
						menuItem -label &quot;Select All&quot; -c &quot;renderTimeCalculator_select( 1 ); renderTimeCalculator_addValues();&quot;;
						menuItem -label &quot;De-select All&quot; -c &quot;renderTimeCalculator_select( 0 ); renderTimeCalculator_addValues();&quot;; 

					checkBox
						-value $isEnabled
						-label $layer
						-onc ( &quot;floatSliderGrp -edit -enable true \&quot;&quot; + $floatSliderGrpLabel + &quot;\&quot;; renderTimeCalculator_addValues();&quot; )
						-ofc ( &quot;floatSliderGrp -edit -enable false \&quot;&quot; + $floatSliderGrpLabel + &quot;\&quot;; renderTimeCalculator_addValues();&quot; )
					( &quot;ctl_&quot;+$layer+&quot;_checkBox&quot; );

					floatSliderGrp
						-enable $isEnabled
						-dc &quot;renderTimeCalculator_addValues()&quot;
						-cc &quot;renderTimeCalculator_addValues()&quot;
						-value 1
						-cal 1 &quot;left&quot; -cal 2 &quot;left&quot; -cal 3 &quot;left&quot; -cw 1 80 -cw 2 100 -cw 3 250
						-label &quot;hours per frame&quot;
						-field true -minValue 0.0 -maxValue 10.0 -fieldMinValue 0.0 -fieldMaxValue 100.0
					$floatSliderGrpLabel;

				setParent..;
			}

		setParent..;

		separator -style &quot;in&quot; &quot;ctl_div_separator&quot;;

		rowColumnLayout -numberOfColumns 4 -cw 1 100 -cw 2 100 -cw 3 100 -cw 4 100;
			text -label &quot;Total render hours&quot; &quot;ctl_totalrenderhours_text&quot;;
			floatField -editable false -pre 1 -value 0 &quot;ctl_totalrenderhours_floatField&quot;;
			text -label &quot;Total frames&quot; &quot;ctl_totalframes_text&quot;;
			floatField -editable false -pre 1 &quot;ctl_totalframes_floatField&quot;;
		setParent..;

		separator -style &quot;in&quot; &quot;ctl_div3_separator&quot;;

		rowColumnLayout -numberOfColumns 2 &quot;ctl_uibuttons_rowColumnLayout&quot; ;
			button -label &quot;Reset&quot; -command ( &quot;deleteUI -window \&quot;&quot; + $window + &quot;\&quot;; renderTimeCalculator();&quot; ) &quot;ctl_reset_button&quot;;
			button -label &quot;Close&quot; -command ( &quot;deleteUI -window &quot; + $window ) &quot;ctl_close_button&quot;;
		setParent..;

	setParent..;

	string $child2 = `columnLayout -adjustableColumn true`;
        scrollField -wordWrap true -text &quot;Non editable with word wrap&quot; -editable false -nl 32 &quot;ctl_outputlog_scrollField&quot;;
	setParent ..;

	tabLayout -edit -tabLabel $child1 &quot;Render Layers&quot; -tabLabel $child2 &quot;Output Log&quot; $tabs;

    showWindow $window;
}

proc float renderTimeCalculator_setRowItem( string $mode, float $value ) {
	string $layerColumns[] = `columnLayout -q -childArray &quot;ctl_layers_columnLayout&quot;`;
	for ( $layer in $layerColumns ) {
		if ( $layer == &quot;ctl_renderlayers_columnLayout&quot; ) {

			string $columns[] = `columnLayout -q -childArray $layer`;
			for ( $col in $columns ) {
					string $rows[] = `rowColumnLayout -q -childArray $col`;
					for ( $row in $rows ) {
						if ( $mode == &quot;select&quot; ) {
							if ( objectTypeUI( $row ) == &quot;rowGroupLayout&quot; ) {
								floatSliderGrp -edit -enable $value $row;
							}
							if ( objectTypeUI( $row ) == &quot;checkBox&quot; ) {
								checkBox -edit -value $value $row;
							}
						}
						if ( $mode == &quot;frames&quot; ) {
							if ( objectTypeUI( $row ) == &quot;rowGroupLayout&quot; ) {
								if ( `floatSliderGrp -q -enable $row` ) {
									$value++;
								}
							}
						}
						if ( $mode == &quot;total_frames&quot; ) {
							if ( objectTypeUI( $row ) == &quot;rowGroupLayout&quot; ) {
								if ( `floatSliderGrp -q -enable $row` ) {
									$value += `floatSliderGrp -q -value $row`;
								}
							}
						}
					}
				}
		}
	}
	return $value;
}

proc renderTimeCalculator_setTotalFramesFloatField() {
	float $frames = `floatField -q -value &quot;ctl_frames_floatField&quot;`;
	float $total = renderTimeCalculator_setRowItem( &quot;frames&quot;, $total );
	$total = $total * $frames;
	floatField -edit -value $total &quot;ctl_totalframes_floatField&quot;;
}

proc renderTimeCalculator_setRenderFrameGlobals() {
	int $total = `intField -q -value &quot;ctl_end_intField&quot;` - `intField -q -value &quot;ctl_start_intField&quot;` + 1;
	floatField -edit -value $total &quot;ctl_frames_floatField&quot;;
}

global proc renderTimeCalculator_select( int $value ) {
	renderTimeCalculator_setRowItem( &quot;select&quot;, $value );
}

global proc renderTimeCalculator_addValues() {
	renderTimeCalculator_setRenderFrameGlobals();
	renderTimeCalculator_setTotalFramesFloatField();

	float $frames = `floatField -q -value &quot;ctl_frames_floatField&quot;`;
	float $total = renderTimeCalculator_setRowItem( &quot;total_frames&quot;, 0 );

	$total = $total * $frames;
	floatField -edit -value $total &quot;ctl_totalrenderhours_floatField&quot;;

	scrollField -edit -text ( renderTimeCalculator_writeOutputLog( (string)$frames, (string)$total ) ) &quot;ctl_outputlog_scrollField&quot;;
}

global proc string renderTimeCalculator_writeOutputLog( string $frames, string $total ) {
	string $log = &quot;Total Frames: &quot;+ $frames + &quot;\n&quot;;
	$log += &quot;Total Render Hours: &quot; + $total + &quot;\n&quot;;
	return( $log );
}

global proc float renderTimeCalculator_getTotalRenderHours() {
	float $total =`floatField -q -value &quot;ctl_totalrenderhours_floatField&quot;`;
	return $total ;
}

global proc float renderTimeCalculator_getTotalFrames() {
	float $total = `floatField -q -value &quot;ctl_totalframes_floatField&quot;`;
	return $total ;
}

global proc float renderTimeCalculator() {
	renderTimeCalculator_createUI( `ls -type &quot;renderLayer&quot;` );
	renderTimeCalculator_addValues();
	return true;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.nikosgatos.com/index.php/2011/04/19/mel-render-time-calculator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MEL: Querying the Illuminates by Default attribute</title>
		<link>http://blog.nikosgatos.com/index.php/2011/03/14/mel-querying-the-illuminates-by-default-attribute/</link>
		<comments>http://blog.nikosgatos.com/index.php/2011/03/14/mel-querying-the-illuminates-by-default-attribute/#comments</comments>
		<pubDate>Mon, 14 Mar 2011 00:31:56 +0000</pubDate>
		<dc:creator>nikos</dc:creator>
				<category><![CDATA[MEL]]></category>

		<guid isPermaLink="false">http://blog.nikosgatos.com/?p=29</guid>
		<description><![CDATA[Finding lights in Maya that have the &#8220;Illuminates by Default&#8221; attribute on/off can be a bit tricky because we aren&#8217;t querying a normal attribute but instead a connection between nodes. Here&#8217;s a procedure that allows us to select lights that have the flag enabled or disabled. Usage: selectIlluminatesByDefault( 0 ); // selects all lights with [...]]]></description>
			<content:encoded><![CDATA[<p>Finding lights in Maya that have the &#8220;Illuminates by Default&#8221; attribute on/off can be a bit tricky because we aren&#8217;t querying a normal attribute but instead a connection between nodes. Here&#8217;s a procedure that allows us to select lights that have the flag enabled or disabled.</p>
<p>Usage:<br />
<strong>selectIlluminatesByDefault( 0 );</strong>  // selects all lights with the flag &#8220;off&#8221;<br />
<strong>selectIlluminatesByDefault( 1 );</strong>  // selects all lights with the flag &#8220;on&#8221;</p>
<pre class="brush: jscript; title: ;">
proc selectIlluminatesByDefault( int $mode ) {
    select -clear;
    string $lights[] = `ls -dag -lights`;
    for ( $light in $lights ) {
        string $transforms[] = `listRelatives -parent $light`;
        string $connections[] = `listConnections $transforms[0]`;
        string $inst = $transforms[0] + &quot;.instObjGroups&quot;;
        string $dfs[] = `connectionInfo -dfs ( $inst )`;

        int $isConnected = 0;
        if ( objExists( $dfs[0] ) &amp;&amp; `isConnected $inst $dfs[0]` ) {
            $isConnected = 1;
        }
        if ( $mode == 1 ) {
            if ( $isConnected ) {
                select -add $light;
            }
        }
        else {
            if ( !$isConnected ) {
                select -add $light;
            }
        }
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.nikosgatos.com/index.php/2011/03/14/mel-querying-the-illuminates-by-default-attribute/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MEL: Look through a light</title>
		<link>http://blog.nikosgatos.com/index.php/2011/03/12/mel-look-through-light/</link>
		<comments>http://blog.nikosgatos.com/index.php/2011/03/12/mel-look-through-light/#comments</comments>
		<pubDate>Sat, 12 Mar 2011 22:39:33 +0000</pubDate>
		<dc:creator>nikos</dc:creator>
				<category><![CDATA[MEL]]></category>

		<guid isPermaLink="false">http://blog.nikosgatos.com/?p=16</guid>
		<description><![CDATA[Here&#8217;s a MEL procedure that opens a light or a camera in a new window Usage: lookThrough( `ls -sl` ); proc lookThrough( string $selection[] ) { string $shapeType[] = `listRelatives -shapes $selection[0]`; string $type = nodeType( $shapeType[0] ); if ( $type == &#34;spotLight&#34; &#124;&#124; $type == &#34;areaLight&#34; &#124;&#124; $type == &#34;volumeLight&#34; &#124;&#124; $type == &#34;camera&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a MEL procedure that opens a light or a camera in a new window</p>
<p>Usage: <strong>lookThrough( `ls -sl` );</strong></p>
<pre class="brush: jscript; title: ;">
proc lookThrough( string $selection[] ) {
    string $shapeType[] = `listRelatives -shapes $selection[0]`;
    string $type = nodeType( $shapeType[0] );

    if ( $type == &quot;spotLight&quot; || $type == &quot;areaLight&quot; || $type == &quot;volumeLight&quot; || $type == &quot;camera&quot; || $type == &quot;directionalLight&quot; ) {
        string $wndName = &quot;&quot;;
        string $cmdStr;
        string $whichPanel = `getPanel -withLabel $selection[0]`;
        string $panelType = &quot;modelPanel&quot;;
        string $panelLabel = $selection[0];

        $wndName = $whichPanel + &quot;Window&quot;;

        if (&quot;&quot; != $whichPanel) {
            if (`panel -q -to $whichPanel`) {
                showWindow $wndName;
            }
            else {
                $cmdStr = ($panelType + &quot; -e -to &quot; + $whichPanel);
                eval $cmdStr;
            }
        }
        else {
            $cmdStr = ($panelType + &quot; -l \&quot;&quot;+ $panelLabel +&quot;\&quot; -to;&quot;);
            eval $cmdStr;
            $whichPanel = `getPanel -withLabel $selection[0]`;
        }
        lookThru $whichPanel $selection[0];
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.nikosgatos.com/index.php/2011/03/12/mel-look-through-light/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MEL: Setting the color of multiple lights</title>
		<link>http://blog.nikosgatos.com/index.php/2011/03/12/mel-setting-the-color-of-multiple-lights/</link>
		<comments>http://blog.nikosgatos.com/index.php/2011/03/12/mel-setting-the-color-of-multiple-lights/#comments</comments>
		<pubDate>Sat, 12 Mar 2011 22:30:11 +0000</pubDate>
		<dc:creator>nikos</dc:creator>
				<category><![CDATA[MEL]]></category>

		<guid isPermaLink="false">http://blog.nikosgatos.com/?p=11</guid>
		<description><![CDATA[Here&#8217;s a snippet for setting the RGB color on multiple lights. colorEditor; if (`colorEditor -query -result`) { string $lights[] = `ls -sl -dag -type light`; float $values[]; $values = `colorEditor -query -rgb`; for ( $l in $lights ) { setAttr ($l + &#34;.color&#34;) -type double3 $values[0] $values[1] $values[2] ; } }]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a snippet for setting the RGB color on multiple lights.</p>
<pre class="brush: jscript; title: ;">
colorEditor;
if (`colorEditor -query -result`) {
    string $lights[] = `ls -sl -dag -type light`;
    float $values[];
    $values = `colorEditor -query -rgb`;

    for ( $l in $lights ) {
        setAttr ($l + &quot;.color&quot;) -type double3 $values[0] $values[1] $values[2] ;
   }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.nikosgatos.com/index.php/2011/03/12/mel-setting-the-color-of-multiple-lights/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

