<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>MAYAPY</title>
	<atom:link href="http://mayapy.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mayapy.wordpress.com</link>
	<description>Ricardo Viana&#039;s adventures into learning Python in Maya</description>
	<lastBuildDate>Wed, 01 Feb 2012 09:29:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='mayapy.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/0577a47ad6214737e8ce4e793056a6f8?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>MAYAPY</title>
		<link>http://mayapy.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mayapy.wordpress.com/osd.xml" title="MAYAPY" />
	<atom:link rel='hub' href='http://mayapy.wordpress.com/?pushpress=hub'/>
		<item>
		<title>PyQt4 camera presets Tool</title>
		<link>http://mayapy.wordpress.com/2012/01/26/pyqt4-camera-presets-tool/</link>
		<comments>http://mayapy.wordpress.com/2012/01/26/pyqt4-camera-presets-tool/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 15:34:00 +0000</pubDate>
		<dc:creator>mayapy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Maya]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[vfx]]></category>
		<category><![CDATA[pyqt]]></category>
		<category><![CDATA[window widgets]]></category>
		<category><![CDATA[canon 7d]]></category>
		<category><![CDATA[canon 5d]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[pyqt4]]></category>
		<category><![CDATA[qt]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://mayapy.wordpress.com/?p=92</guid>
		<description><![CDATA[Hi there. This post is going to be about building a Camera Presets Tool. Sure we can build on maya&#8217;s own presets button. But this way you can share it with your coworkers. If by the end of this post you feel confortable, change the code to introduce your own presets in there. This time [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayapy.wordpress.com&amp;blog=28430714&amp;post=92&amp;subd=mayapy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://mayapy.files.wordpress.com/2012/01/combobox.png"><img class="alignnone size-full wp-image-93" title="comboBox" src="http://mayapy.files.wordpress.com/2012/01/combobox.png?w=640" alt=""   /></a><a href="http://mayapy.files.wordpress.com/2012/01/main_menu.png"><img class="alignnone size-full wp-image-94" title="main_menu" src="http://mayapy.files.wordpress.com/2012/01/main_menu.png?w=640" alt=""   /></a></p>
<p>Hi there. This post is going to be about building a Camera Presets Tool. Sure we can build on maya&#8217;s own presets button. But this way you can share it with your coworkers. If by the end of this post you feel confortable, change the code to introduce your own presets in there.</p>
<p>This time instead of using standard cmds to build the interface i used PyQt which is a much better solution for designing ui&#8217;s. It&#8217;s based on <a href="http://qt.nokia.com" target="_blank">QT</a> (a tech owned by nokia ). As far as my knowledge goes this would work on maya 2011+ due to its new QT interface integration. I&#8217;ve heard the about it working on older versions but you have to be a more experienced developer to make it work i guess.</p>
<p><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/classes.html" target="_blank">here is the documentation</a> for the all classes available in PyQT4</p>
<p>So let&#8217;s go!!</p>
<p>1. First Step is to get the PyQt installer.<a href="http://www.justinfx.com/2011/11/09/installing-pyqt4-for-maya-2012-osx/" target="_blank"> You can get it here</a>. Thank&#8217;s Justin Israel for that.</p>
<p>2. Run this code in Maya. I&#8217;ve included all the necessary comments for you to follow along.</p>
<pre>from PyQt4 import QtGui, QtCore
import maya.cmds as cmds

#data specs on the cameras name and sensor sizes [name,(width,height)]

camListSpecs = [ ["Arri Alexa", (0.935, 0.526)],
["Red Mysterium-X 4k", (0.870, 0.489) ],
["Red Mysterium-X 2k", (0.435, 0.244) ],
["Canon 5D MkII", (1.417, 0.799)],
["Canon 7D", (0.877, 0.492)],
["Phantom HD Gold 1080p", (0.944, 0.531)]
]

# camera creation function
def createCam():
    camName = str(cameraSel.currentText())
    index = cameraSel.currentIndex()
    focal = float(focalLengthInput.text())
    cmds.camera(name=camName, horizontalFilmAperture=camListSpecs[index][1][0],
    verticalFilmAperture=camListSpecs[index][1][1], focalLength=focal)
    mainWin.close()

#list to store only the camera names

camList = []

for i in range(len(camListSpecs)):
    camList.append(camListSpecs[i][0]) 

#SETUP PYQT WINDOW/WIDGETS

#setup mainwindow
mainWin = QtGui.QWidget()
mainWin.setGeometry(300, 300, 160, 200) #pos x,pos y,width,height
mainWin.setWindowTitle("Camera")

#camera Type combobox
cameraLabel = QtGui.QLabel("Camera Type", parent=mainWin)
cameraLabel.move(5, 5)
cameraSel = QtGui.QComboBox(parent=mainWin)
cameraSel.setGeometry(5, 25, 150, 20)

#add camera list to comboBox
cameraSel.addItems(camList)

#focalLenght field
focalLabel = QtGui.QLabel("Focal Length", parent=mainWin)
focalLabel.setGeometry(5, 50, 150, 20)
focalLengthInput = QtGui.QLineEdit(parent=mainWin)
focalLengthInput.setGeometry(75, 50, 50, 20)

focalLengthInput.setText("35")
mmLabel = QtGui.QLabel("mm", parent=mainWin)
mmLabel.setGeometry(130, 50, 50, 20)

#create camera button
createCambtn = QtGui.QPushButton("Create Camera", parent=mainWin)
createCambtn.setGeometry(5, 75, 150, 20)

#interface actions/signals
QtCore.QObject.connect(createCambtn, QtCore.SIGNAL("clicked()"), createCam)

#show QT window
mainWin.show()
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mayapy.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mayapy.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mayapy.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mayapy.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mayapy.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mayapy.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mayapy.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mayapy.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mayapy.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mayapy.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mayapy.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mayapy.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mayapy.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mayapy.wordpress.com/92/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayapy.wordpress.com&amp;blog=28430714&amp;post=92&amp;subd=mayapy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mayapy.wordpress.com/2012/01/26/pyqt4-camera-presets-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/84901d059654d2cb499a94566d4e5c19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mayapy</media:title>
		</media:content>

		<media:content url="http://mayapy.files.wordpress.com/2012/01/combobox.png" medium="image">
			<media:title type="html">comboBox</media:title>
		</media:content>

		<media:content url="http://mayapy.files.wordpress.com/2012/01/main_menu.png" medium="image">
			<media:title type="html">main_menu</media:title>
		</media:content>
	</item>
		<item>
		<title>.OBJ sequence importer for Maya</title>
		<link>http://mayapy.wordpress.com/2011/12/19/obj-sequence-importer-for-maya/</link>
		<comments>http://mayapy.wordpress.com/2011/12/19/obj-sequence-importer-for-maya/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 15:49:52 +0000</pubDate>
		<dc:creator>mayapy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Maya]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[obj sequence]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[cg]]></category>
		<category><![CDATA[vfx]]></category>

		<guid isPermaLink="false">http://mayapy.wordpress.com/?p=79</guid>
		<description><![CDATA[Hey there. I&#8217;m aware that many artists don&#8217;t use OBJ sequences any more. But now and then this may come in handy. Which happened to me. And odd enough Maya doesn&#8217;t allow to import obj sequences. i used it some years ago in max and it worked quite nicely. So i took the time to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayapy.wordpress.com&amp;blog=28430714&amp;post=79&amp;subd=mayapy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://mayapy.files.wordpress.com/2011/12/obj_seq.png"><img class="alignnone size-full wp-image-80" title="obj_seq" src="http://mayapy.files.wordpress.com/2011/12/obj_seq.png?w=640" alt=""   /></a></p>
<p>Hey there.<br />
I&#8217;m aware that many artists don&#8217;t use OBJ sequences any more.<br />
But now and then this may come in handy. Which happened to me.<br />
And odd enough Maya doesn&#8217;t allow to import obj sequences. i used<br />
it some years ago in max and it worked quite nicely.</p>
<p>So i took the time to write a python script for it. With a little help<br />
from my Buddy John P. Neumann aka Arrantsquid here it is.</p>
<p>Hope it will help you. If not, you can still learn a bit from the code <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Cheers</p>
<pre>import maya.cmds as cmds

current_scene=cmds.ls(assemblies=True)

def selectDir():
	basicFilter = "*.obj"
	filename=cmds.fileDialog2(fileMode=4,ds=1, caption="Select Sequence",fileFilter=basicFilter)
	uniToStr=str(filename)
	global objList
	filePath=uniToStr.split("'")
	search=".obj"
	objList=[mesh for mesh in filePath if search in mesh]
	cmds.textScrollList(path, edit=True, append=objList)

def importer():
	objList.sort()
	for each in objList:
		loaded=cmds.file(each,i=True,dns=True)
	cmds.deleteUI('objwindow',window=True)
	getMeshes()

def loadWin():
	if cmds.window('objwindow',exists=True):
		cmds.deleteUI('objwindow',window=True)
	win=cmds.window('objwindow',title="Load Obj sequence",widthHeight=(250,450))
	cmds.columnLayout()
	cmds.text('Path to files')
	global path
	path=cmds.textScrollList(w=250)
	browseButton=cmds.button(label='browse',w=250,c='selectDir()')
	importButton=cmds.button(label='import',w=250,c='importer()')
	cmds.showWindow(win)

def getMeshes():
	newScene=cmds.ls(assemblies=True)
	meshList=[mesh for mesh in newScene if mesh not in current_scene]
	cmds.group(meshList,n="OBJ_GROUP")
	for i in range(len(meshList)):
		cmds.setKeyframe(meshList[i],attribute='visibility',value=0,t=0)
		cmds.setKeyframe(meshList[i],attribute='visibility',value=1,t=i+1)
		cmds.setKeyframe(meshList[i],attribute='visibility',value=0,t=i+2)

loadWin()</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mayapy.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mayapy.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mayapy.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mayapy.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mayapy.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mayapy.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mayapy.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mayapy.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mayapy.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mayapy.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mayapy.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mayapy.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mayapy.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mayapy.wordpress.com/79/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayapy.wordpress.com&amp;blog=28430714&amp;post=79&amp;subd=mayapy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mayapy.wordpress.com/2011/12/19/obj-sequence-importer-for-maya/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/84901d059654d2cb499a94566d4e5c19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mayapy</media:title>
		</media:content>

		<media:content url="http://mayapy.files.wordpress.com/2011/12/obj_seq.png" medium="image">
			<media:title type="html">obj_seq</media:title>
		</media:content>
	</item>
		<item>
		<title>Import OS module example.</title>
		<link>http://mayapy.wordpress.com/2011/12/13/import-os-module-example/</link>
		<comments>http://mayapy.wordpress.com/2011/12/13/import-os-module-example/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 14:17:05 +0000</pubDate>
		<dc:creator>mayapy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Maya]]></category>
		<category><![CDATA[OS module]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://mayapy.wordpress.com/?p=68</guid>
		<description><![CDATA[Hi there. Here i explain a bit about the OS module functionality. Basically it opens up the possibility for Maya to comunicate with the OS. In this case we are going to create a simple folder called &#8220;Test_folder&#8221; #first import the module import os #get the home directory through the environment variable 'HOME' and store [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayapy.wordpress.com&amp;blog=28430714&amp;post=68&amp;subd=mayapy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi there.<br />
Here i explain a bit about the OS module functionality.<br />
Basically it opens up the possibility for Maya to comunicate with<br />
the OS. In this case we are going to create a simple folder called &#8220;Test_folder&#8221;</p>
<pre>
#first import the module
import os

#get the home directory through the environment variable 'HOME' and store in var dir
dir =os.getenv('HOME')

#join dir with "/Documents"
newdir=os.path.join(dir,'Documents')

#create a Test_folder inside "/documents"
makeDir=os.mkdir(os.path.join(newdir,'Test_folder'))</pre>
<p>if you write dir(os) and execute, you can see all of its functionality printed on the console.</p>
<p>for instance &#8216;rmdir&#8217; &#8211; removes a directory</p>
<p>write -&gt; help(os.rmdir)<br />
and you will see the help on each of them, in this case (rmdir) prints:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
rmdir(&#8230;)<br />
    rmdir(path)</p>
<p>    Remove a directory.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mayapy.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mayapy.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mayapy.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mayapy.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mayapy.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mayapy.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mayapy.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mayapy.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mayapy.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mayapy.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mayapy.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mayapy.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mayapy.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mayapy.wordpress.com/68/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayapy.wordpress.com&amp;blog=28430714&amp;post=68&amp;subd=mayapy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mayapy.wordpress.com/2011/12/13/import-os-module-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/84901d059654d2cb499a94566d4e5c19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mayapy</media:title>
		</media:content>
	</item>
		<item>
		<title>Create shaders through Python</title>
		<link>http://mayapy.wordpress.com/2011/11/04/create-shaders-through-python/</link>
		<comments>http://mayapy.wordpress.com/2011/11/04/create-shaders-through-python/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 21:54:09 +0000</pubDate>
		<dc:creator>mayapy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mayapy.wordpress.com/?p=61</guid>
		<description><![CDATA[Here&#8217;s a quick script to create a simple shader via Python. import maya.cmds as cmds #create a shader shader=cmds.shadingNode("blinn",asShader=True) #a file texture node file_node=cmds.shadingNode("file",asTexture=True) # a shading group shading_group= cmds.sets(renderable=True,noSurfaceShader=True,empty=True) #connect shader to sg surface shader cmds.connectAttr('%s.outColor' %shader ,'%s.surfaceShader' %shading_group) #connect file texture node to shader's color cmds.connectAttr('%s.outColor' %file_node, '%s.color' %shader)<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayapy.wordpress.com&amp;blog=28430714&amp;post=61&amp;subd=mayapy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick script to create a simple shader via Python.</p>
<pre class="brush:python">import maya.cmds as cmds
#create a shader
shader=cmds.shadingNode("blinn",asShader=True)
#a file texture node
file_node=cmds.shadingNode("file",asTexture=True)
# a shading group
shading_group= cmds.sets(renderable=True,noSurfaceShader=True,empty=True)
#connect shader to sg surface shader
cmds.connectAttr('%s.outColor' %shader ,'%s.surfaceShader' %shading_group)
#connect file texture node to shader's color
cmds.connectAttr('%s.outColor' %file_node, '%s.color' %shader)</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mayapy.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mayapy.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mayapy.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mayapy.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mayapy.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mayapy.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mayapy.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mayapy.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mayapy.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mayapy.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mayapy.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mayapy.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mayapy.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mayapy.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayapy.wordpress.com&amp;blog=28430714&amp;post=61&amp;subd=mayapy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mayapy.wordpress.com/2011/11/04/create-shaders-through-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/84901d059654d2cb499a94566d4e5c19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mayapy</media:title>
		</media:content>
	</item>
		<item>
		<title>Maya Script editor, text editor or ide</title>
		<link>http://mayapy.wordpress.com/2011/11/03/maya-script-editor-text-editor-or-ide/</link>
		<comments>http://mayapy.wordpress.com/2011/11/03/maya-script-editor-text-editor-or-ide/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 10:25:49 +0000</pubDate>
		<dc:creator>mayapy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[Maya]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">https://mayapy.wordpress.com/?p=55</guid>
		<description><![CDATA[When you begin writing your first scripts, the natural way is to use maya script editor. You can reach it by clicking the bottom right icon in your ui. A few years ago with maya 2010 and bellow, this was a poor solution. No syntax coloring, code completion, or any other fancy handy stuff, so [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayapy.wordpress.com&amp;blog=28430714&amp;post=55&amp;subd=mayapy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://mayapy.files.wordpress.com/2011/11/script_editor.png"><img class="alignnone size-full wp-image-56" title="script_editor" src="http://mayapy.files.wordpress.com/2011/11/script_editor.png?w=640" alt=""   /></a></p>
<p>When you begin writing your first scripts, the natural way is to use maya script editor.<br />
You can reach it by clicking the bottom right icon in your ui.</p>
<p>A few years ago with maya 2010 and bellow, this was a poor solution. No syntax coloring, code completion, or any other fancy handy stuff, so developers use to go for external text editors to manage and write their scripts. Advanced programmers still do it this way.<br />
But since Maya 2011, the built in script editor has evolved and became very powerfull. Now has syntax highlighting, quick help,code completion, and all. Still missing python feedback instead of having to translate the mel it spits, to python, but with some experience you will naturally figure it out.</p>
<p><strong>the other way</strong></p>
<p>There are really fancy text editors out there with a lot of nice tools to work in maya python.<br />
Some of them actually connect to Maya via &#8220;commandPort&#8221;.</p>
<p>Here is a list of some of them: (i haven&#8217;t try them all <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</p>
<p>Sorry, i&#8217;m not a Windows so i only suggest mac and linux/unix editors. But some of them have win version.</p>
<p>- <a href="http://macromates.com/" target="_blank">TextMate</a> for Mac (paid): easy to learn, connects to Maya with an optional plugin/bundle.</p>
<p><img class="alignnone" title="Textmate for mac" src="http://manual.macromates.com/images/project_window_with_tabs.png" alt="" width="330" height="226" /></p>
<p>- <a href="http://http://www.eclipse.org/" target="_blank">Eclipse</a> (win,mac,linux) free and very powerful ide: It takes a few complicated steps to make it work with Maya and python/pymel but after a few headbangs it&#8217;s really power in your hands. <a href="http://www.creativecrash.com/tutorials/using-eclipse-as-a-maya-ide" target="_blank">Setup instructions here</a></p>
<p><a href="http://mayapy.files.wordpress.com/2011/11/screen-shot-2011-11-03-at-11-05-32-am.png"><img class="alignnone size-full wp-image-57" title="Screen shot 2011-11-03 at 11.05.32 AM" src="http://mayapy.files.wordpress.com/2011/11/screen-shot-2011-11-03-at-11-05-32-am.png?w=640" alt=""   /></a></p>
<p><a href="http://wingware.com/" target="_blank">wing IDE</a>: Never used it, but a lot of people seem to like it.</p>
<p><img class="alignnone" title="WingIDE" src="http://wingware.com/images/screenshots/wingide4-screenshot-809x573.png" alt="" width="517" height="365" /></p>
<p><a title="Jedit" href="http://www.jedit.org/" target="_blank">Jedit</a>: my first try at a Text Editor. It&#8217;s nice, but never got it to connect to Maya. It is possible, but i just couldn&#8217;t make it work.</p>
<p><img class="alignnone" title="Jedit" src="http://www.jedit.org/images/screenshot.png" alt="" width="256" height="191" /></p>
<p>&nbsp;</p>
<p><strong>And Now Some really heavy sh*t!!</strong></p>
<p>Hardcore programmers use older texteditors that can take a while to learn. Myself am learning. Never though spending so much time understanding a text editor program. Acknowledge that a Text editor is not a Word processor !!</p>
<p>In this category i found two that are most used, both are free and come with mac and linux. don&#8217;t know about windows though.</p>
<p><a title="VIM" href="http://www.vim.org/" target="_blank">VIM</a> . Don&#8217;t be fooled by the screenshot, it&#8217;s really more powerful than it seems. There is a lot of <a href="http://vim-scripts.org/vim/scripts.html" target="_blank">plugins</a> available in which you can find connecting to Maya.</p>
<p>It runs on the Terminal, but it can also run as standard app. See <a href="http://gvim.en.softonic.com/" target="_blank">Gvim</a> or <a href="http://code.google.com/p/macvim/" target="_blank">Macvim</a></p>
<p><a href="http://mayapy.files.wordpress.com/2011/11/screen-shot-2011-11-03-at-11-16-24-am.png"><img class="alignnone size-full wp-image-58" title="Screen shot 2011-11-03 at 11.16.24 AM" src="http://mayapy.files.wordpress.com/2011/11/screen-shot-2011-11-03-at-11-16-24-am.png?w=640" alt=""   /></a></p>
<p>or</p>
<p><a href="http://www.gnu.org/s/emacs/" target="_blank">Emacs</a>: which is kind of the same concept with different handling</p>
<p><img class="alignnone" title="Emacs" src="http://www.gnu.org/s/emacs/tour/images/splash-small.png" alt="" width="243" height="220" /></p>
<p><strong></strong>There&#8217;s an active discussion on google groups about which editor everyone uses, check it <a title="Googlegroup" href="http://groups.google.com/group/python_inside_maya/browse_thread/thread/e3438fc9e5b070bf" target="_blank">here</a>.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Remember that i&#8217;m not an expert or guru in the matter. My opinions are based on my experience which isn&#8217;t much.</p>
<p>Comments welcome!!</p>
<p>That is it. Have fun.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mayapy.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mayapy.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mayapy.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mayapy.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mayapy.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mayapy.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mayapy.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mayapy.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mayapy.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mayapy.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mayapy.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mayapy.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mayapy.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mayapy.wordpress.com/55/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayapy.wordpress.com&amp;blog=28430714&amp;post=55&amp;subd=mayapy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mayapy.wordpress.com/2011/11/03/maya-script-editor-text-editor-or-ide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/84901d059654d2cb499a94566d4e5c19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mayapy</media:title>
		</media:content>

		<media:content url="http://mayapy.files.wordpress.com/2011/11/script_editor.png" medium="image">
			<media:title type="html">script_editor</media:title>
		</media:content>

		<media:content url="http://manual.macromates.com/images/project_window_with_tabs.png" medium="image">
			<media:title type="html">Textmate for mac</media:title>
		</media:content>

		<media:content url="http://mayapy.files.wordpress.com/2011/11/screen-shot-2011-11-03-at-11-05-32-am.png" medium="image">
			<media:title type="html">Screen shot 2011-11-03 at 11.05.32 AM</media:title>
		</media:content>

		<media:content url="http://wingware.com/images/screenshots/wingide4-screenshot-809x573.png" medium="image">
			<media:title type="html">WingIDE</media:title>
		</media:content>

		<media:content url="http://www.jedit.org/images/screenshot.png" medium="image">
			<media:title type="html">Jedit</media:title>
		</media:content>

		<media:content url="http://mayapy.files.wordpress.com/2011/11/screen-shot-2011-11-03-at-11-16-24-am.png" medium="image">
			<media:title type="html">Screen shot 2011-11-03 at 11.16.24 AM</media:title>
		</media:content>

		<media:content url="http://www.gnu.org/s/emacs/tour/images/splash-small.png" medium="image">
			<media:title type="html">Emacs</media:title>
		</media:content>
	</item>
		<item>
		<title>Maya Zoom/Pan Tools Script</title>
		<link>http://mayapy.wordpress.com/2011/10/19/maya-zoompan-tools-script/</link>
		<comments>http://mayapy.wordpress.com/2011/10/19/maya-zoompan-tools-script/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 16:36:49 +0000</pubDate>
		<dc:creator>mayapy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mayapy.wordpress.com/?p=46</guid>
		<description><![CDATA[Here goes another tool for productivity. No more scrolling in attr editor for pan/zoom How to: 1. copy script to script editor in Python tab, select all text and then MM drag it to your shelf. 2. select a camera 3. hit the little icon with a looking glass over the viewport 4. press in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayapy.wordpress.com&amp;blog=28430714&amp;post=46&amp;subd=mayapy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://mayapy.files.wordpress.com/2011/10/picture-7.png"><img src="http://mayapy.files.wordpress.com/2011/10/picture-7.png?w=640" alt="" title="TOOL"   class="alignnone size-full wp-image-51" /></a></p>
<p>Here goes another tool for productivity. No more scrolling in attr editor for pan/zoom <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>How to:<br />
1. copy script to script editor in Python tab, select all text and then MM drag it to your shelf.<br />
2. select a camera<br />
3. hit the little icon with a looking glass over the viewport<a href="http://mayapy.files.wordpress.com/2011/10/picture-8.png"><img src="http://mayapy.files.wordpress.com/2011/10/picture-8.png?w=640" alt="" title="Looking Glass"   class="alignright size-full wp-image-52" /></a><br />
4. press in your shelf button to launch<br />
5. have fun</p>
<pre>

import maya.cmds as cmds

cam=cmds.ls(sl=True)
if len(cam)&lt;1:
    cmds.confirmDialog(message=&quot;select a camera&quot;)
    camShape=cmds.listRelatives(cam)

def reset():
    cmds.panZoom(camShape,abs=True,z=1)
    cmds.panZoom(camShape,abs=True,l=0)
    cmds.panZoom(camShape,abs=True,d=0)
    cmds.floatSliderGrp(valZ, edit=True, value=1)
    cmds.floatSliderGrp(valX, edit=True, value=0)
    cmds.floatSliderGrp(valY, edit=True, value=0)

def paniZoom():
    zoomRate=cmds.floatSliderGrp(valZ, query=True, value=True)
    cmds.panZoom(camShape,abs=True,z=zoomRate)

    widthRate=cmds.floatSliderGrp(valX, query=True, value=True)
    cmds.panZoom(camShape,abs=True,l=widthRate)

    depthRate=cmds.floatSliderGrp(valY, query=True, value=True)
    cmds.panZoom(camShape,abs=True,d=depthRate)

windowZ=cmds.window(title=&quot;Zoom/pan&quot;,w=350,h=250)
cmds.columnLayout(w=150,adj=True)
valZ=cmds.floatSliderGrp(label=&quot;Zoom&quot;, field=True,dc=&quot;paniZoom()&quot;,value=1,min=-0.001,max=1,pre=3)
valY=cmds.floatSliderGrp(label=&quot;Vertical Pan&quot;, field=True,dc=&quot;paniZoom()&quot;,value=0,min=-1,max=1,pre=3)
valX=cmds.floatSliderGrp(label=&quot;Horizontal Pan&quot;, field=True,dc=&quot;paniZoom()&quot;,value=0,min=-1,max=1,pre=3)

resetButton=cmds.button(label=&quot;reset&quot;, c=&quot;reset()&quot;)
cmds.showWindow(windowZ)
cmds.panZoom(camShape,abs=True,z=10)

reset()
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mayapy.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mayapy.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mayapy.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mayapy.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mayapy.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mayapy.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mayapy.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mayapy.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mayapy.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mayapy.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mayapy.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mayapy.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mayapy.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mayapy.wordpress.com/46/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayapy.wordpress.com&amp;blog=28430714&amp;post=46&amp;subd=mayapy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mayapy.wordpress.com/2011/10/19/maya-zoompan-tools-script/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/84901d059654d2cb499a94566d4e5c19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mayapy</media:title>
		</media:content>

		<media:content url="http://mayapy.files.wordpress.com/2011/10/picture-7.png" medium="image">
			<media:title type="html">TOOL</media:title>
		</media:content>

		<media:content url="http://mayapy.files.wordpress.com/2011/10/picture-8.png" medium="image">
			<media:title type="html">Looking Glass</media:title>
		</media:content>
	</item>
		<item>
		<title>Inspiration for starting to code</title>
		<link>http://mayapy.wordpress.com/2011/10/15/inspiration-for-starting-to-code/</link>
		<comments>http://mayapy.wordpress.com/2011/10/15/inspiration-for-starting-to-code/#comments</comments>
		<pubDate>Sat, 15 Oct 2011 11:16:04 +0000</pubDate>
		<dc:creator>mayapy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mayapy.wordpress.com/?p=34</guid>
		<description><![CDATA[I&#8217;m not a geek. Never was. Probably never will. In fact, the first computer i owned was a Pentium III back in 2001. (Younger folks probably will think what is a Pentium III ?). Unlike my closest friends, i never had a ZXSpectrum, Amiga, Nintendo, Timex, Sega, Commodore or even a videoPack. When the University [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayapy.wordpress.com&amp;blog=28430714&amp;post=34&amp;subd=mayapy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>I&#8217;m not a geek. </strong><br />
Never was. Probably never will. In fact, the first computer i owned was a Pentium III back in 2001. (Younger folks probably will think what is a Pentium III ?). Unlike my closest friends, i never had a ZXSpectrum, Amiga, Nintendo, Timex, Sega, Commodore or even a videoPack.</p>
<p>When the University of Kassel in Germany gave me an email account back in 1998, i was thinking: &#8220;what that hell do i do with this?&#8221;. Since then, internet changed my whole spectrum and gave me the opportunity to learn whatever i wanted to.</p>
<p>I always considered myself as an artist. Therefore, the coding in programs was always a 12 leg huge bug, that i would never have to face it. The maths, equations, functions and stuff were just too hard to understand, i thought.</p>
<p><strong>What made me consider to start coding</strong></p>
<p><img class="alignnone" title="Joshua Davis Work" src="http://pedamado.files.wordpress.com/2008/05/printscreen_047-2008-05-07_.png?w=642&#038;h=364" alt="" width="642" height="364" /></p>
<p>One day at an <a href="http://www.offf.ws/oeiras/" target="_blank">OFFF</a> conference, i saw the presentation of this very funny visual artist called <a href="http://www.joshuadavis.com/" target="_blank">Joshua Davis</a>. If you never saw him giving a speech, i advise you to.</p>
<p>Joshua at that time presented us with a series of illustrations he made procedurally. By Procedurally, i mean computer generated through a series of equations and math. Joshua isn&#8217;t really a computer scientist with thick googles, he is a skater, tattooed, rock n roll style guy.</p>
<p>He showed a series of hugely complex illustrations, all vector based, and asked the audience: &#8220;Go draw that by hand! i dare you!&#8221;</p>
<p>But the most important phrase that i heard from him was:</p>
<p><img class="alignleft" title="Joshua Davis" src="http://farm2.static.flickr.com/1349/979714555_33701e80f3.jpg" alt="" width="500" height="375" /></p>
<p><strong>&#8220;Hey, if i can do math, so can you!&#8221;</strong></p>
<p>I say the same thing to you.</p>
<p>cheers.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mayapy.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mayapy.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mayapy.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mayapy.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mayapy.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mayapy.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mayapy.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mayapy.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mayapy.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mayapy.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mayapy.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mayapy.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mayapy.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mayapy.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayapy.wordpress.com&amp;blog=28430714&amp;post=34&amp;subd=mayapy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mayapy.wordpress.com/2011/10/15/inspiration-for-starting-to-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/84901d059654d2cb499a94566d4e5c19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mayapy</media:title>
		</media:content>

		<media:content url="http://pedamado.files.wordpress.com/2008/05/printscreen_047-2008-05-07_.png" medium="image">
			<media:title type="html">Joshua Davis Work</media:title>
		</media:content>

		<media:content url="http://farm2.static.flickr.com/1349/979714555_33701e80f3.jpg" medium="image">
			<media:title type="html">Joshua Davis</media:title>
		</media:content>
	</item>
		<item>
		<title>Light Values Script</title>
		<link>http://mayapy.wordpress.com/2011/10/14/light-values-script/</link>
		<comments>http://mayapy.wordpress.com/2011/10/14/light-values-script/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 19:15:51 +0000</pubDate>
		<dc:creator>mayapy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mayapy.wordpress.com/?p=22</guid>
		<description><![CDATA[Here goes one simple script for you guys to chew. It basically sets up a window UI to change Intensity and color of the Lights in the scene. Just copy it from the script editor to your shelf. It loads all your lights in the scene to the list. Then select the lights you want [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayapy.wordpress.com&amp;blog=28430714&amp;post=22&amp;subd=mayapy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://mayapy.files.wordpress.com/2011/10/picture-6.png"><img class="alignnone size-full wp-image-43" title="Lighting script" src="http://mayapy.files.wordpress.com/2011/10/picture-6.png?w=640" alt=""   /></a></p>
<p>Here goes one simple script for you guys to chew. It basically sets up a window UI to change Intensity and color of the Lights in the scene. Just copy it from the script editor to your shelf. It loads all your lights in the scene to the list. Then select the lights you want to change settings (it allows multiple selection).</p>
<p>Later i will introduce specular,diffuse, depth map shadows and raytrace shadow options.</p>
<p>in the meantime, enjoy it.</p>
<p>cheers</p>
<pre>import maya.cmds as cmds

initiallightList=cmds.ls(type="light")
lightArray=[]

def Lighter():
    for o in lightArray:
        print lightArray
        iniVal= cmds.getAttr(o+".intensity")
        iniRGB = cmds.getAttr(o+".color")
        value=cmds.floatSliderGrp(newVal,query=True,value=True)
        colorRGB=cmds.colorSliderGrp (RGB, query=True, rgbValue=True)
        cmds.setAttr(o+".intensity",value)
        cmds.setAttr(o+".colorR",colorRGB[0])
        cmds.setAttr(o+".colorG",colorRGB[1])
        cmds.setAttr(o+".colorB",colorRGB[2])

def index():
    indexl=cmds.textScrollList(lista, q=True,si=True)
    del lightArray[:]
    for i in range(len(indexl)):
        lightArray.append(indexl[i])
        cmds.select(indexl[i])

#window UI
LightWindow=cmds.window(title="Light Values",w=150)
cmds.columnLayout(w=150,adj=True)
lista=cmds.textScrollList(height=150, ams=True, da=True,sc="index()")
for each in initiallightList:
    cmds.textScrollList(lista,edit=True,append=each)

cmds.frameLayout(label="Adjust Settings for selected Lights",w=150)
newVal=cmds.floatSliderGrp(label="Intensity",w=150,cal=(1,"left"),pre=2,adj=1,field=True)
RGB=cmds.colorSliderGrp(label="color RGB",cal=(1,"left"),adj=True)
cmds.setParent('..')
cmds.rowLayout()
cmds.setParent('..')
cmds.button(label="Apply",c="Lighter()")
cmds.button(label="Close", c="cmds.deleteUI(LightWindow)")
cmds.setParent('..')

cmds.showWindow(LightWindow)</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mayapy.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mayapy.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mayapy.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mayapy.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mayapy.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mayapy.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mayapy.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mayapy.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mayapy.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mayapy.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mayapy.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mayapy.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mayapy.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mayapy.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayapy.wordpress.com&amp;blog=28430714&amp;post=22&amp;subd=mayapy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mayapy.wordpress.com/2011/10/14/light-values-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/84901d059654d2cb499a94566d4e5c19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mayapy</media:title>
		</media:content>

		<media:content url="http://mayapy.files.wordpress.com/2011/10/picture-6.png" medium="image">
			<media:title type="html">Lighting script</media:title>
		</media:content>
	</item>
		<item>
		<title>First Book</title>
		<link>http://mayapy.wordpress.com/2011/10/14/15/</link>
		<comments>http://mayapy.wordpress.com/2011/10/14/15/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 17:26:15 +0000</pubDate>
		<dc:creator>mayapy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mayapy.wordpress.com/?p=15</guid>
		<description><![CDATA[This was my first reading. Definitely a must have. Although a quarter away in the book i had to abandon. The problem is that i started to know pretty things about Python, but nothing about how to use in Maya. I&#8217;ll get back to it for sure in the future. The Second resource i found [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayapy.wordpress.com&amp;blog=28430714&amp;post=15&amp;subd=mayapy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.amazon.com/Programming-Python-Mark-Lutz/dp/0596158106/ref=sr_1_1?ie=UTF8&amp;qid=1318612797&amp;sr=8-1"><img class="alignnone" title="book" src="http://ecx.images-amazon.com/images/I/51geJj9aghL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA300_SH20_OU01_.jpg" alt="" width="300" height="300" /></a></p>
<p>This was my first reading. Definitely a must have. Although a quarter away in the book i had to abandon. The problem is that i started to know pretty things about Python, but nothing about how to use in Maya. I&#8217;ll get back to it for sure in the future.</p>
<p>The Second resource i found was <a href="http://www.chadvernon.com/blog/resources/python-scripting-for-maya-artists/">Chad Vernon&#8217;s website</a>. Great material in there.</p>
<p>There is also the Python for Maya<a href="http://groups.google.com/group/python_inside_maya"> google group</a>, but hey!!!,  those discussions are still way too advanced for me.</p>
<p>After these, i found this Technical Artist on twitter who has a nice blog about Python, his name is John Neumann. <a href="http://animateshmanimate.com" target="_blank">check here.</a></p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mayapy.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mayapy.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mayapy.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mayapy.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mayapy.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mayapy.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mayapy.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mayapy.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mayapy.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mayapy.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mayapy.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mayapy.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mayapy.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mayapy.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayapy.wordpress.com&amp;blog=28430714&amp;post=15&amp;subd=mayapy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mayapy.wordpress.com/2011/10/14/15/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/84901d059654d2cb499a94566d4e5c19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mayapy</media:title>
		</media:content>

		<media:content url="http://ecx.images-amazon.com/images/I/51geJj9aghL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA300_SH20_OU01_.jpg" medium="image">
			<media:title type="html">book</media:title>
		</media:content>
	</item>
		<item>
		<title>Introduction</title>
		<link>http://mayapy.wordpress.com/2011/10/14/introduction/</link>
		<comments>http://mayapy.wordpress.com/2011/10/14/introduction/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 13:43:49 +0000</pubDate>
		<dc:creator>mayapy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mayapy.wordpress.com/?p=5</guid>
		<description><![CDATA[Who should read this: Hello Maya artists, this is going to be place where i will post my learning experience with Python in Maya. There will be small scripts and hopefully one day, great ones. I will also post my experience and problems i may encounter. It will be a great reading for newcomers in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayapy.wordpress.com&amp;blog=28430714&amp;post=5&amp;subd=mayapy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Who should read this:</strong></p>
<p>Hello Maya artists, this is going to be place where i will post my learning experience with Python in Maya. There will be small scripts and hopefully one day, great ones. I will also post my experience and problems i may encounter. It will be a great reading for newcomers in Maya Python, but experienced TA&#8217;s and TD&#8217;s will certainly have a laugh reading it.(go on, i encorage you to comment my post with TD jokes. More than welcome!! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ).</p>
<p><strong>Inspiration</strong></p>
<p>I started learning Python one day, after a chat session with my Tutor Lee Danskin at <a title="escape studios mentored vfx course" href="http://www.escapestudios.co.uk/online-vfx-courses/" target="_blank">escape studios</a>, advised me to learn Python. I was at the time starting to learn MEL (Maya Embed Language) and i so excited with it. Lee Danskin said that MEL is great but Python or Pymel is the way to go. That and some Linux skills.</p>
<p><strong>Book</strong></p>
<p><strong></strong><a href="http://www.amazon.com/Maya-Python-Games-Film-Reference/dp/0123785782/ref=sr_1_1?ie=UTF8&amp;qid=1318587084&amp;sr=8-1"><img class="alignleft" title="book_cover" src="http://ecx.images-amazon.com/images/I/51Xd70PLBzL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA300_SH20_OU01_.jpg" alt="" width="300" height="300" /></a><br />
<strong></strong></p>
<p><strong>Maya Python for Games and Film: A Complete Reference for Maya Python and the Maya Python API</strong><br />
This is the book that i&#8217;m reading as i go. check it <a title="BOOK" href="http://www.amazon.com/Maya-Python-Games-Film-Reference/dp/0123785782/ref=sr_1_1?ie=UTF8&amp;qid=1318587084&amp;sr=8-1" target="_blank">here</a>.</p>
<p><strong>Online Learning</strong></p>
<p>Also watching Justin Israel video about Python for Maya in <a href="http://www.cmivfx.com/tutorials/view/320/Python+Introduction+Vol+01+-+Maya" target="_blank">CMIVFX</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mayapy.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mayapy.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mayapy.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mayapy.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mayapy.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mayapy.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mayapy.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mayapy.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mayapy.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mayapy.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mayapy.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mayapy.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mayapy.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mayapy.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayapy.wordpress.com&amp;blog=28430714&amp;post=5&amp;subd=mayapy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mayapy.wordpress.com/2011/10/14/introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/84901d059654d2cb499a94566d4e5c19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mayapy</media:title>
		</media:content>

		<media:content url="http://ecx.images-amazon.com/images/I/51Xd70PLBzL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA300_SH20_OU01_.jpg" medium="image">
			<media:title type="html">book_cover</media:title>
		</media:content>
	</item>
	</channel>
</rss>
