Skip to content

Instantly share code, notes, and snippets.

@Onefabis
Onefabis / 0_reuse_code.js
Created June 30, 2016 19:55
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Onefabis
Onefabis / MAYA_findFlippedUVs.py
Created January 20, 2016 16:51 — forked from hmasato/MAYA_findFlippedUVs.py
[Maya, python] _findFlippedUVs
# -*- coding: utf-8 -*-
import maya.OpenMaya as om
import maya.cmds as cmds
def _findFlippedUVs(nodesOnly=True):
ret = []
selList = om.MSelectionList()
@Onefabis
Onefabis / reverse_subd.py
Created November 15, 2015 15:52
Reverse subdivision
from pymel.all import *
import maya.mel as mel
import maya.OpenMaya as om
'''
def makeUnique( lst ):
result = list()
map( lambda x: not x in result and result.append(x), lst )
return result
@Onefabis
Onefabis / Lazy_selection.py
Created November 15, 2015 15:51 — forked from SEVEZ/Lazy_selection.py
Select object objects, closest to cursor
import maya.cmds as cmds
from pymel.core import *
from pymel.core.datatypes import *
import maya.OpenMaya as om
import maya.OpenMayaUI as omui
class SamsClass():
ctx = cmds.currentCtx()
cto = cmds.contextInfo(ctx,c=1)
print cto
@Onefabis
Onefabis / renamer.py
Created November 15, 2015 15:50 — forked from jakecraige/renamer.py
Maya - Joint Hierarchy Alphabetical Renamer
import maya.cmds as mc
window = mc.window(title="Joint Hierarchy Renamer", widthHeight=(500, 55))
mc.columnLayout(adjustableColumn=True)
mc.text(label="Instructions: select top of joint hierarchy")
textField = mc.textFieldButtonGrp(label="New name prefix:", buttonLabel="Rename", buttonCommand="rename_joints()")
mc.showWindow(window)
def rename_joints():
@Onefabis
Onefabis / gist:712c5e5ae45507d6203c
Created November 15, 2015 15:49 — forked from oglops/gist:90ea08309483db07b615
improved maya ref parser
class MayaRefParser(object):
'''
This parses .ma file and get refrenced files info, store them in itself
'''
def __init__(self , maFile=None):
self.header = ''
self.refHeader = ''
self.otherHeader = ''
self.contents = ''
self.contentsLineNum = 0