Skip to content

Instantly share code, notes, and snippets.

@meepzh
meepzh / renumber_and_reorder.py
Last active March 22, 2021 11:50
Maya: Renumbers and reorders the selected geometry based on the selection order.
"""Renumbers the selected geometry based on the selection order.
"""
import re
from maya import cmds
INDEX_REGEX = re.compile(r'\d+')
def getNumber(s):
match = INDEX_REGEX.findall(s)
if not match:
@meepzh
meepzh / rename_postfix_to_index.py
Last active March 22, 2021 03:51
Maya: Removes number postfixes from object names and increments internal number indexes
"""Renames the selected objects with numbers at the end with proper index
numbers in the middle of the name.
.. note::
Only the last occurrence of the index is used.
"""
import re
from maya import cmds
@meepzh
meepzh / imagePlaneToPolyPlane.py
Last active February 6, 2020 13:41
Rigs a Maya mesh poly plane to match an image plane
import maya.cmds as cmds
ipShapes = cmds.ls(type="imagePlane")
currentIpShape = ipShapes[0]
def mz_updateImagePlane(ipShape):
currentIpShape = ipShape
@meepzh
meepzh / convertTargaSequence.bat
Created June 23, 2017 18:53
Converts a targa sequence to video using FFmpeg - for CIS 462/562
@echo off
setlocal EnableDelayedExpansion
rem ***************************************************************************
rem This batch file attempts to find FFmpeg. If it doesn't exist, it downloads
rem the latest version and extracts ffmpeg.exe. It finds a valid .tga image in
rem the current directory and uses FFmpeg to convert it into an H.264 MP4.
rem This script requires PowerShell 3.0 or later and .NET Framework 4.5 or
rem later. They should be default in Windows 8 and later.
@meepzh
meepzh / camera_remote_v2.ino
Last active March 21, 2021 13:46
3-Button Nikon Camera Remote
/**
* 3-Button Nikon Camera Remote
*
* An Arduino camera remote that emulates the Nikon ML-L3. This can take single
* shots or, by taking input through 2 buttons, take shots continuously at a
* specified interval. This particular sketch is designed for the D3300.
*
* Buttons:
* - The "add" button increments the least significant digit by 1.
* - The "shift" button multiplies the current interval by 10.