Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeroen Hoolmans jhoolmans

View GitHub Profile
@jhoolmans
jhoolmans / ArduinoClock.ino
Created Mar 26, 2018
ZS-042 DS3231 Clock and SSD1306 OLED (128x64) both on i2c with the Adafruit Trinket Pro.
View ArduinoClock.ino
// Pro Trinket - OLED Display Clock
//
// OLED (SSD1306)
// CLOCK (ZS-042)
//
#include "Wire.h"
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
@jhoolmans
jhoolmans / openclip.xml
Created Sep 19, 2017
Example for OpenClip files using patterns.
View openclip.xml
<?xml version="1.0" encoding="UTF-8"?>
<clip type="clip" version="5">
<handler>
<name>MIO Clip</name>
<version>2</version>
<longName>MIO Clip</longName>
<options type="dict">
<ScanPattern type="string">SH050_comp_v{version}.{frame}.exr</ScanPattern>
</options>
</handler>
@jhoolmans
jhoolmans / toggle_menubar_native.py
Created Sep 18, 2014
MAYA: Toggle MainWindow menubar to be native or not. Moves the menubar into the mainwindow on OSX. This may be useful while recording and scaling your window to fit a certain size.
View toggle_menubar_native.py
import maya.OpenMayaUI as OMUI
from PySide import QtCore
from PySide import QtGui
from shiboken import wrapInstance
def maya_main_window():
mainWindowPtr = OMUI.MQtUtil.mainWindow()
return wrapInstance(long(mainWindowPtr), QtGui.QMainWindow)
View UsersHelper.rb
module UsersHelper
#Returns the Gravatar for the given user.
def gravatar_for(user, options = { size: 50 })
gravatar_id = Digest::MD5::hexdigest(user.email.downcase)
size = options[:size]
gravatar_url = "https://secure.gravatar.com/avatar/#{gravatar_id}?s=#{size}"
image_tag(gravatar_url, alt: user.email, class: "img-responsive")
end
@jhoolmans
jhoolmans / softCluster.py
Created Feb 24, 2014
Maya create soft cluster
View softCluster.py
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()
@jhoolmans
jhoolmans / CubeOnJoints.py
Created Jan 23, 2013
Create cube on joints
View CubeOnJoints.py
import pymel.core as pm
from pymel.core.datatypes import Matrix
for item in pm.ls(sl=True):
cube = pm.polyCube(ch=False)
mat = Matrix(pm.xform(item, m=True, ws=True, q=True))
pm.xform(cube, ws=True, m=mat)
pm.parent(cube, item)
@jhoolmans
jhoolmans / divideJoint.py
Created Jan 20, 2013
[Maya] Divide selected joint
View divideJoint.py
import pymel.core as pm
# Helper methods
def debug(message):
print("DEBUG: %s" % message)
# Average between 2 nodes
def averageBetween(a, b):
return matrixLinearBetween(a, b, 0.5)
@jhoolmans
jhoolmans / orientTipJointsToWorld.mel
Created Jan 20, 2013
Orients all tip joints to world. Alternative to orientTipJointsToParent.
View orientTipJointsToWorld.mel
// Orient tip joint to world
{
proc string[] getChildren(string $nodes[])
{
return `listRelatives -f -c $nodes`;
}
proc int isTip(string $node)
{
if (size(getChildren({$node})) > 0)
@jhoolmans
jhoolmans / orientTipJointsToParent.mel
Last active Dec 11, 2015
Zeroes out all tip joints' orients axis.
View orientTipJointsToParent.mel
// Orient tip joint to parent
{
proc string[] getChildren(string $nodes[])
{
return `listRelatives -f -c $nodes`;
}
proc int isTip(string $node)
{
if (size(getChildren({$node})) > 0)
@jhoolmans
jhoolmans / HierarchyLRA.mel
Created Jan 20, 2013
Toggle local rotation axis display on entire hierarchy
View HierarchyLRA.mel
select -hi;
ToggleLocalRotationAxes;
You can’t perform that action at this time.