This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# User specific aliases and functions | |
__PROMPT_COMMAND() { | |
local allOFF='\[\e[0m\]' | |
local underline='\[\e[4m\]' | |
local underlineOFF='\[\e[24m\]' | |
local italic='\[\e[3m\]' | |
local italicOFF='\[\e[23m\]' | |
local black_bg='\[\e[40m\]' | |
local black_fg='\[\e[30m\]' | |
local red_bg='\[\e[41m\]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import chain, groupby | |
def group_frame_numbers(frame_range, range_char="-", step_char="x", sep=","): | |
""" | |
Take a list of frame numbers and group them according to step. | |
i.e [1, 4, 5, 6, 12, 15, 18, 22, 25, 29, 33] -> 1,4-6,12-18x3,22,25-33x4 | |
:param frame_numbers: A list[int] of frame numbers representing a frame range. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from maya import OpenMaya | |
# create selection | |
sel = OpenMaya.MSelectionList() | |
sel.add("locator1") | |
sel.add("camera1") | |
# get dag paths | |
loc_dag = OpenMaya.MDagPath() | |
sel.getDagPath(0, loc_dag) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.api.OpenMaya as om | |
import maya.cmds | |
import time | |
def is_normal_reversed(poly, mesh): | |
""" | |
Check the normal faces in or out of the model by doing a simple ray cast and | |
count results. Evens face out, odds face in. | |