This file contains hidden or 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 | |
def transfer_blendshapes(): | |
selection = cmds.ls(selection=True) | |
if len(selection) != 2: | |
print("Please select two objects. Select the source mesh first, then the target mesh.") | |
return | |
source_mesh = selection[0] |
This file contains hidden or 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 om | |
def create_curve_from_joints(): | |
selection = cmds.ls(selection=True, type='joint') | |
if len(selection) < 2: | |
cmds.warning('Please select at least two joints.') | |
return | |
positions = [om.MVector(cmds.xform(j, q=True, ws=True, t=True)) for j in selection] | |
degree = 1 if len(positions) == 2 else 3 |
This file contains hidden or 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 | |
def findSkin(target): | |
shapeHistory = cmds.listHistory(target, lv=0) | |
skin = cmds.ls(shapeHistory, typ='skinCluster') | |
if len(skin) > 0: | |
skin = skin[0] | |
else: | |
skin = None | |
return skin |
This file contains hidden or 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 pymel.core as pm | |
#list items | |
itemList = ['Soda', 'Juice', 'Tea', 'Water'] | |
#prompt user | |
userPrompt = cmds.promptDialog(title='Beverages', message='We have Soda, Juice, Tea, or Water. Enter your selection: ', button=['OK', 'Cancel'], defaultButton='OK', cancelButton='Cancel', dismissString='Cancel') | |
if userPrompt == 'OK': |
This file contains hidden or 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 pymel.core as pm | |
import maya.cmds as cmds | |
import random | |
class cardGenerate(): | |
def __init__(self): | |
This file contains hidden or 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
# Quick build joints on a curve tool with UI by Nate Hancock | |
# Simply run script, follow UI prompts and done! | |
#last update 07/14/2022 | |
import pymel.core as pm | |
import maya.cmds as cmds | |
#class in for variable | |
class nrhCurver(): | |
This file contains hidden or 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
current_age = input("What is your current age?") | |
value_age = int(current_age) | |
years_toGo = 100 - value_age | |
weeks_toGo = years_toGo * 52 | |
days_toGo = years_toGo * 365 | |
time_to_hundred = f"You have {years_toGo} years, {weeks_toGo} weeks, and {days_toGo} until age 100." | |
print(time_to_hundred) |
This file contains hidden or 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
# Nathaniel H. | |
# 04/29/2021 | |
# v4 updated 5/12/2021 | |
# Quick setup for complex space switching tool | |
import pymel.core as pm |
This file contains hidden or 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
global proc makeFKTR () | |
{ | |
// sets up FK controls to a joint chain of any size | |
// usage: makeFKTRS (requires makeFK UI) | |
// capturing variables | |
$selection = `ls -sl`; | |
int $size = `size ($selection)`; | |
float $controlSize = `floatSliderGrp -q -v controlSize`; |