This is my rough notebook - I add information to it that I like to keep as reference.
Get link
Facebook
X
Pinterest
Email
Other Apps
Fisrt WIP-pass for shoes. I am creating this shoe for game engine so trying to keep the vertices to minimum.This is a single geometry, all sculpted in Zbrush.
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...
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)
Install Visual Studio Code. Once installed, open visual studio code. press "command + p", a window will open at the top. Type : ext install python Open terminal and type following commands : pip install pep8 pip install --upgrade autopep8 pip install pylint Start auto formatting python code
Comments