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
# maya Python Script | |
# based on https://gist.github.com/protofALk/4564420 | |
import maya.cmds as cmds | |
import pymel.core as pm | |
class NumericString: | |
def __init__(self, rawValue): | |
self.rawValue = rawValue |
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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.Playables; | |
using UnityEngine.Timeline; | |
public class IntroCinematicCharacters : MonoBehaviour | |
{ | |
public PlayableDirector characterDirector; | |
public List<CharacterData> MeatTeam; |
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
//useful for multiple sprites that cannot be put into a sheet | |
//unity current does not support slicing sheets for SVG import so this allows you to take multiple SVGs and animate them in editor | |
//based on an script from Anima2D | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
[ExecuteInEditMode] | |
public class SpriteSwap : MonoBehaviour |
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.cmds as cmds | |
from maya import cmds, OpenMaya | |
def AddBones(): | |
cmds.select() | |
sel = cmds.ls(sl=True) | |
if len(sel) == 0: | |
cmds.error("No Joints Selected") | |
cuts = input("Number of joints: ") | |
relSel = cmds.listRelatives(sel, children = True) | |
sel.extend(relSel) |
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.cmds as mc | |
import maya.OpenMaya as OpenMaya | |
def getVertices(mesh): | |
mc.select(mesh) | |
selList = OpenMaya.MSelectionList() | |
OpenMaya.MGlobal.getActiveSelectionList(selList) | |
meshObj = OpenMaya.MObject() | |
selList.getDependNode(0,meshObj) | |
meshFn = OpenMaya.MFnMesh( meshObj ) |
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.cmds as cmds | |
sel = cmds.ls(sl=True) | |
curve = cmds.ls(sel[0]+'.cv[0:]', fl = True) | |
cmds.select(curve) | |
pos = [] | |
for i, cv in enumerate(curve): | |
cvpos = (cmds.pointPosition(cv, l = True)) | |
pos.append(cvpos) | |
pointString = str(pos) | |
pointString = pointString.replace('[','(') |
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.cmds as cmds | |
import maya.api.OpenMaya as OpenMaya | |
pv = cmds.circle(n='poleVector_ctrl') | |
pvGrp = cmds.group(pv, n = 'poleVector_o') | |
start = cmds.xform(IKJoints[0], q = 1, ws =1, t =1) | |
mid = cmds.xform(IKJoints[1], q = 1, ws =1, t =1) | |
end = cmds.xform(IKJoints[2], q = 1, ws =1, t =1) | |
#create 3 vectors. this uses openmaya api's MVector, could also use a python math module? | |
startV = OpenMaya.MVector(start[0], start[1], start[2]) | |
midV = OpenMaya.MVector(mid[0], mid[1], mid[2]) |
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
Shader "Custom/HalfLambert" | |
{ | |
Properties | |
{ | |
_Color ("Color", Color) = (1,1,1,1) | |
_MainTex ("Albedo (RGB)", 2D) = "white" {} | |
_RampTex ("Ramp (RGB)", 2D) = "white" {} | |
_BumpMap ("Bumpmap", 2D) = "bump" {} | |
_ShadowTint ("Shadow Color", Color) = (0, 0, 0, 1) | |
_RimColor ("Rim Color", Color) = (0.26,0.19,0.16,0.0) |
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
def shapeReplacer(obj, crv): | |
selection=[] | |
shape=[] | |
if(obj == ""): | |
selection = cmds.ls(sl=True) | |
else: | |
selection = obj | |
shape = cmds.listRelatives(selection, f=True,s=True) | |
#this split to make sure that we don't delete shapes we are using for common controls added from the 'shapeParent' function | |
#those shapes return as separate strings in the same list index for some maya reason |