Posts

Wrapper functions

A very simple example for writing wrapper functions in Python. def polySphere(*args,**kwargs):     try:         return cmds.polySphere(*args,**kwargs)     except:         print "Could not create polySphere"         print sys.exc_info()  polySphere(r=5,sw=20,sh=20)

Bounding Box in PIL (Python Image Library)

Image
Bounding Box in PIL(Python Image Library) : Bounding Box function of PIL can be very useful for removing unused pixels from an image. Eg. If we want to remove unused pixels based on alpha channel of an image, we can use following code.   im = Image.open(imagePath) r,g,b,a = im.split() left,upper,right,lower = a.getbbox() tempImage = im.crop((left,upper,right,lower)) newPath = imagePath.split(".")[0]+"_Cropped" + "." + imagePath.split(".")[1] tempImage.save(newPath) To understand which values, getbbox() function returns and what do they look like on an image, I created an image showing the values returned by the function. left,upper,right,lower = image.getbbox()   Suppose you have a point in an original image and you want to find out the new position of the same point in the cropped image, lets see how we can do it. Suppose the point is at (300,450) position in an original image, so after cr...

Some Regex Expressions

http://www.tutorialspoint.com/python/python_reg_expressions.htm

Nice Little Game Development Breakdown.

http://blogs.wsj.com/digits/2013/03/04/behind-the-making-of-a-mobile-game/

Dynamically Generating Curves

These are few lines of code to generate dynamic curves in Maya. I wrote this code while researching about effect of different trigonometrical function on a curve. import math,maya.cmds as cmds,maya.mel as mel points ="[" x= 0 for i in xrange(50):    x+=i    points = points + ("("+str(x)+","+ str(math.sin(i*10)*10) +",0),") points = points.rstrip(",")+"]" cmds.curve(p=eval(points))

Python Performance Tuning and Optmization

Python高级编程(二) from Qiangning Hong

Euler Rotation and Gimbal Lock Explained

Euler Rotations Explained from The Guerrilla CG Project on Vimeo .

What is sprite sheet ?

SpriteSheets - TheMovie - Part 1 by Code'n'Web

http://floony.blogspot.fr/

Mesmerizing Concept art : http://floony.blogspot.fr/

Maya API tutorial

Image
Other Resources :  http://download.autodesk.com/media/adn/DevTV_Introduction_to_Maya_Dependency_Graph_Programming/DevTV%20-%20Introduction%20to%20Maya%20Dependency%20Graph%20Programming.html

Unity 3D Free Tutorial

Unity 3D Free Tutorial : http://walkerboystudio.com/html/unity_training___free__.html

How to install Win32 extension for Python for Maya 2012

 You might have two different versions of Maya2012 on your machine. Maya 2012 64 bit Maya 2012 32 bit 1. First, we will have to grab correct win32com library for Maya version. Following are the link for different versions . For Maya 2012 64 bit  => win32com for python 2.6 64 bit . For Maya 2012 32 bit  => win32com for python 2.6 32 bit. 2. Installation of these libraries will also require Python standalone installation, which you can get from  python.org website. Python 2.6 64 bit ( compatible to Maya 2012 64 bit ) Python 2.6 32 bit ( compatible to Maya 2012 32 bit ) 3. After you would install python standalone, your installed win32com library would go in following directory : C:\Python26_64bit\Lib\site-packages Add above path in your system paths by executing following commands in Maya. import sys                      ...

Sending email through Maya2012 (using Python and Outlook express)

How to send email using Outlook express through Maya. We will be using python to send an email through Outlook express and to initiate Outlook express Maya python we will need a module called as : win32com. For Maya 2012 64 bit :   pywin32-217.win-amd64-py2.6.exe For Maya 2012 32 bit :   pywin32-217.win32-py2.6.exe    Its a good idea to install python32bit and python64bit on your machine because you may requires different versions depending upon libraries you are using for your tools and sometimes while loading win32api in Maya2012 64bit so might see .dll errors all others : http://sourceforge.net/projects/pywin32/files/pywin32/Build%20217/ ( To install these executable you will also need Python 2.6 64bit or 32bit installed on your machine ) After installing Python and pywin32 run Maya2012. Now when you will import win32com module in Maya, your system should know where this module exists therefore  we will add the path of this module in sys...
Image
Maya Commands : import maya.cmds as cmds object = cmds.ls(sl=True) bbox = cmds.exactWorldBoundingBox( object[0]) cmds.curve(d=1,p=[(bbox[0],bbox[4],bbox[5]),(bbox[3],bbox[4],bbox[5]),(bbox[3],bbox[4],bbox[2]),(bbox[0],bbox[4],bbox[2]),(bbox[0],bbox[1],bbox[5]),(bbox[3],bbox[1],bbox[5]),(bbox[3],bbox[1],bbox[2]),(bbox[0],bbox[1],bbox[2])])
As being a Technical Artist I keep pounding my head against different types of problems everyday. I came across a good documentation on problem solving which is a very nice articulation of 'Problem Solving' which sometimes is so vague to describe. http://pages.uoregon.edu/moursund/Books/PS-Workshop/PS-Workshop.pdf
Image
Quick and very clear explanation of how this was done !
Character-WIP
Image
Character WIP :
Image
Shirt in Progress