Skip to content

Instantly share code, notes, and snippets.

View thirstydevil's full-sized avatar

David Moulder thirstydevil

View GitHub Profile
import mgear.shifter.custom_step as cstp
import pymel.core as pm
import pprint
import logging
log = logging.getLogger("PostSetp")
DEGUB = False
@thirstydevil
thirstydevil / git-update.py
Created October 16, 2018 08:48
Git - force pull latest repro
import git, os, shutil
DIR_NAME = "c:/temp2"
REMOTE_URL = "https://gitlab.com/blarblar/blar.git"
# This is a note to myself on how to pull down to a local folder the latest code from a remote branch.
class Progress(git.remote.RemoteProgress):
"""
@thirstydevil
thirstydevil / cleanDuplicateMeshFaces.py
Last active May 10, 2017 18:48
Method of traversing polygons and removing duplicate faces that are sat on top of one and another.
def cleanDuplicateMeshFaces(transform=None):
"""
We are getting lots of meshes from a client with duplicate polygons sat ontop of each other and the vertex positions
of each face are the same. Usually most of them are welded and so every face in lamina. The mesh cleanup tools just
separate every face on the mesh. There's no garantee that the mesh has UV's.
:param transform: PyNode or None
:return: None
"""
if transform is None:
transform = pCore.selected()[0]
def locatorOnPoly(name=""):
"""
Requires a single poly selection. The script will then create a locator of the polygon normal and then orient it
to the tangent of the longest edge on the polygon using a aim constraint and and a couple of locators that finally
get cleaned up. Probably a nice way to do this by building a world space rotation matrix from the vector of
point A and B on the longest edge and the normal of the poly.
:param name: str(Locator Name)
:return: pCore.dt.transform()
"""