This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#------------------------------------------------------------------------------- | |
# Boiler Plate Code for Windows | |
# By : Kumaran | |
import pymel.core as pm | |
class UI(pm.uitypes.Window): | |
_TITLE = "mkWindow" | |
_LAYOUT = "mkLayout" | |
_DOCKCONTROL = "mkDockCtrl" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#------------------------------------------------------------------------------- | |
# Boiler Plate Code for Windows | |
# By : Kumaran | |
import pymel.core as pm | |
class UI(pm.uitypes.Window): | |
_TITLE = "mkWindow" | |
_LAYOUT = "mkLayout" | |
_DOCKCONTROL = "mkDockCtrl" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright: Kumaran | |
function getSelectedComps(){ | |
var allItems = app.project.items; | |
selectedComps = new Array(); | |
for (var i = allItems.length; i >= 1; i--) { | |
eachItem = allItems[i]; | |
if ((eachItem instanceof CompItem) && eachItem.selected) { | |
selectedComps[selectedComps.length] = eachItem; | |
//$.writeln(eachItem.name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import path | |
import compileall | |
import sys, types | |
def recompile(modulename): | |
"""Recompile the given module, its directory's contents!""" | |
myScriptPath = sys.modules[modulename.__name__].__path__[0] | |
if path.isdir(myScriptPath): | |
compileall.compile_dir(myScriptPath, force=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.cmds as cmds | |
from os.path import join as joinpath, split as splitpath | |
class FileNotExist(IOError): | |
pass | |
def hasNumbers(inputString): | |
return any(char.isdigit() for char in inputString) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import copy | |
import subprocess as sp | |
zip_cmd = ['zip', '-r', '-9', '-T'] | |
lwza_cmd = ['7za', 'a', '-t7z', '-mx9', '-v2g'] | |
def loadExcludedListFromPath(path): | |
excludedList = list() | |
for afile in os.listdir(path): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
from platform import system | |
from os import stat | |
from os.path import basename, splitext, dirname, split as splitpath, \ | |
join as joinpath | |
from datetime import datetime | |
from glob import glob | |
import hashlib | |
import subprocess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In[5]: | |
x = [[ 795. , 501.0292887 ], | |
[ 794.97154472, 501. ], | |
[ 794.96078431, 500. ], | |
[ 795. , 499.09090909], | |
[ 795.03921569, 500. ], | |
[ 795.02777778, 501. ], | |
[ 795. , 501.0292887 ]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'kumar' | |
from bs4 import BeautifulSoup | |
import requests | |
page = requests.get('http://www.imdb.com/chart/?ref_=nv_ch_cht_2%3F') | |
soup = BeautifulSoup(page.text) | |
for x in soup.find_all('td', {"class": "ratingColumn"}): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def listLocation(root_location,files = [],folders = []): | |
""" A recursive function to get directory content into arrays | |
Usage : x,y = listLocation(directory/path) | |
Returns 2 arrays 1 files array and 1 folders array """ | |
for eachitem in os.listdir(root_location): | |
filePath = os.path.join(root_location,eachitem) | |
if os.path.isdir(filePath) and not eachitem.startswith('.'): | |
folders.append(filePath) | |
listLocation(filePath,files,folders) | |
elif os.path.isfile(filePath) and not eachitem.startswith('.'): |
NewerOlder