Skip to content

Instantly share code, notes, and snippets.

View evitolins's full-sized avatar
🏠
Working from home

Eriks Vitolins evitolins

🏠
Working from home
View GitHub Profile
#----------------------------------
# Create Dynamic Joint Chains
#----------------------------------
dynChain = lpDynamiChain(startJoint, endJoint)
dynChain.create()
def __init__(self, startJoint="", endJoint="", node=""):
""" Constructor. Creates the custom node.
@AndrewtConroy
AndrewtConroy / gist:60d7327d945e65cc624d
Created October 29, 2014 20:49
simple joint utilities
def jointLock():
allJoints = cmds.ls(type='joint')
for joint in allJoints:
cmds.setAttr(joint+'.radius',.01)
cmds.setAttr(joint+'.radius',lock=1,keyable=1,channelBox=0)
def jointUnlock():
allJoints = cmds.ls(type='joint')
for joint in allJoints:
cmds.setAttr(joint+'.radius',lock=0,keyable=1,channelBox=1)
@AndrewtConroy
AndrewtConroy / UV_transfer.py
Last active October 20, 2015 19:22
UV transfer
import maya.cmds as cmds
import maya.mel as mel
'''
What is this:
This is a simple script that will copy UV's from one mech to another. The meshes should be simular for best results.
It will copy the UV's to a rigged mesh or a non rigged mesh.
Instructions:
In order to run this script correctly, just select the mesh with the good UV's, then select the mesh with bad UV's.
@Mark-Booth
Mark-Booth / git-branch-status
Last active August 19, 2019 16:00 — forked from lth2h/git-branch-status
Version of git-branch-status which only shows the current branch and only generates output if a branch is ahead or behind.Added options to:* Show all branches (revert to the old behaviour)* Show output even if the branch isn't ahead or behind (revert to the old behaviour)* Show branch(es) with respect to origin/master (inspired by git-branches-v…
#!/bin/bash
# hosted at https://gist.github.com/Mark-Booth/5058384
# forked from https://gist.github.com/lth2h/4177524 @ ae184f1 by mark.booth
# forked from https://gist.github.com/jehiah/1288596 @ e357c1e by lth2h
# ideas from https://github.com/kortina/bakpak/blob/master/bin/git-branches-vs-origin-master
# this prints out some branch status
# (similar to the '... ahead' info you get from git status)
# example:
@naholyr
naholyr / monkey-patch.js
Created December 21, 2012 11:52
JS monkey patching
// Original method
var object = {
method: function (x, y) {
return x+y;
}
}
// Add operations before or after!
object.method = (function (original) {
return function (x, y) {
@santazhang
santazhang / install_ffmpeg.py
Created March 4, 2012 07:55
Python script to compile and install ffmpeg
#!/usr/bin/env python
#
# Python script to compile and install ffmpeg.
#
# part of ffcluster project.
# see full project at github.com/santazhang/ffcluster
#
# Author: Santa Zhang <santa1987@gmail.com>
import os
@derekkwok
derekkwok / encode.py
Last active December 5, 2020 12:14
Simple python script to encode videos using ffmpeg
"""
This python script encodes all files that have the extension mkv in the current
working directory.
Sources:
http://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide
"""
import subprocess, os
#-------------------------------------------------------------------------------
@kevinelliott
kevinelliott / osx-10.11-setup.md
Last active April 10, 2022 15:47
Mac OS X 10.11 El Capitan Setup

Mac OS X 10.11 El Capitan

Custom recipe to get OS X 10.11 El Capitan running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.10 Yosemite setup recipe (as found on this gist https://gist.github.com/kevinelliott/0726211d17020a6abc1f). Note that I expect this to change significantly as I install El Capitan several times.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

@jhoolmans
jhoolmans / softCluster.py
Created February 24, 2014 19:49
Maya create soft cluster
import maya.cmds as mc
import maya.OpenMaya as om
def softSelection():
selection = om.MSelectionList()
softSelection = om.MRichSelection()
om.MGlobal.getRichSelection(softSelection)
softSelection.getSelection(selection)
dagPath = om.MDagPath()
@justinfx
justinfx / modelPanelPyQt4.py
Last active September 15, 2023 03:31
Mixing PyQt4 and Maya UI objects
from PyQt4 import QtCore, QtGui
import maya.cmds as cmds
import maya.OpenMayaUI as mui
import sip
class MyDialog(QtGui.QDialog):