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
@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):
@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()
@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
#-------------------------------------------------------------------------------
@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
@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) {
@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:
@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.
@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)
#----------------------------------
# Create Dynamic Joint Chains
#----------------------------------
dynChain = lpDynamiChain(startJoint, endJoint)
dynChain.create()
def __init__(self, startJoint="", endJoint="", node=""):
""" Constructor. Creates the custom node.