Skip to content

Instantly share code, notes, and snippets.

@paulwinex
paulwinex / folderDownloaderClass.py
Created May 9, 2014 15:34
Download folder structure from http
import urllib, urllib2
import re
import os
import shutil
import time
class downloaderClass(object):
def __init__(self):
self.v = False
@paulwinex
paulwinex / imageToJson.py
Created June 18, 2014 11:28
Save image to json and load back
import base64, json
from PySide.QtCore import *
from PySide.QtGui import *
filename = 'C:/image.jpg'
# save to json
f = open(filename, 'rb')
img_data = f.read()
f.close()
enc_data = base64.b64encode(img_data)
@paulwinex
paulwinex / getUvShells.py
Created July 8, 2014 09:39
Get all UV shells from mesh object
import maya.OpenMaya as om
import maya.cmds as cmds
def getUvShelList(name):
selList = om.MSelectionList()
selList.add(name)
selListIter = om.MItSelectionList(selList, om.MFn.kMesh)
pathToShape = om.MDagPath()
selListIter.getDagPath(pathToShape)
meshNode = pathToShape.fullPathName()
@paulwinex
paulwinex / edgesIsSmooth.py
Last active May 11, 2016 19:41
Return array of smoothed/harded edges by index
import maya.OpenMaya as om
import maya.cmds as cmds
def edgesIsSmooth(name, edgeArray):
selList = om.MSelectionList()
selList.add(name)
selListIter = om.MItSelectionList(selList, om.MFn.kMesh)
pathToShape = om.MDagPath()
selListIter.getDagPath(pathToShape)
shapeFn = om.MFnMesh(pathToShape)
from PySide.QtCore import *
from PySide.QtGui import *
lineWidth = 3
rows = 4
columns = 6
color = 'red'
class UnderlinedItemClass(QWidget):
def __init__(self):
def htoaEnv(data):
# print '>>',data
# return
# ver = open(join(data['modules_htoa'],'current_version.txt')).read()
path = None
if os.path.exists(data['modules_htoa']):
for f in os.listdir(data['modules_htoa']):
if f.startswith('htoa'):
hou_version = join(data['modules_htoa'], f, 'scripts/python/htoa/build.py')
if os.path.exists(hou_version):
@paulwinex
paulwinex / alembic_export_selected.py
Created November 12, 2015 19:55
Export selected poly object to .abc
from pymel.core import *
import maya.OpenMaya as om
from imath import *
from alembic.Abc import *
import alembic
import math
def get_mesh_data():
selection = om.MSelectionList()
from pymel.core import *
import maya.OpenMaya as om
from imath import *
from alembic.Abc import *
import alembic
import math
def get_mesh_data():
selection = om.MSelectionList()
@paulwinex
paulwinex / alembic_export_selected2.py
Created November 13, 2015 12:09
Export geometry with custom attributes
import maya.OpenMaya as om
from imath import *
from alembic.Abc import *
from alembic.AbcGeom import *
import alembic
import math
def get_mesh_data():
selection = om.MSelectionList()
@paulwinex
paulwinex / alembic_maya_to_houdini.py
Created November 14, 2015 18:37
Full example for export Maya polygons to Houdini winth attributes and groups
import maya.OpenMaya as om
from imath import *
from alembic.Abc import *
from alembic.AbcGeom import *
import math
import alembic
def get_mesh_data():
selection = om.MSelectionList()