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
""" | |
External Maya Client | |
This can be run outside of Maya | |
Use in idle or an IDE that can accept input. | |
""" | |
import socket | |
import logging |
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
""" | |
Author: Randall Hess [email protected] | |
Purpose: Boilerplate UI Code for Maya | |
Created: 8/5/2018 | |
""" | |
import maya.cmds as cmds | |
import maya.OpenMayaUI as OpenMayaUI |
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 os | |
from shutil import copyfile | |
try: | |
# Pyside | |
from pysideuic import compileUi | |
except: | |
# Pyside2 | |
from pyside2uic import compileUi | |
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
// Randall Hess [email protected] | |
// Instructions: Copy this file over your local maya version to override the default behavior | |
// Maya 2022 and Higher | |
// Additional: You can also build and load this as a module and not overwrite the local maya file. | |
// Location: C:\Program Files\Autodesk\MayaXX\scripts\others\performFileDropAction.mel | |
global proc int | |
performFileDropAction (string $theFile) |
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 | |
string = "Kill all Maya Processes?" | |
result = cmds.confirmDialog(message = string, button = ["Kill", "Cancel"], defaultButton = "Kill", cancelButton = "Cancel", dismissString = "Cancel", icon = "Warning") | |
if result == "Kill": | |
import subprocess | |
subprocess.call('taskkill /f /im maya.exe', shell=True) | |
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
''' | |
Brute force method to adjust the poleVector of one ik chain | |
to line up the elbow joint of a similar arm chain | |
''' | |
import pymel.core as pymel | |
import maya.OpenMaya as OpenMaya | |
def adjust_pv_to_elbow(poleVector, ik_elbow, elbow): | |
""" |
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 unparent_nodes(fbx_filename): | |
''' | |
Unparent Hiearchy Nodes | |
In an effort to clean your fbx scene | |
This code is looking for specific nodes in your scene | |
In my example I have a heirarchy that houses an entire character or weapon | |
Character | |
-> Rig_Group | |
-> Bind_Skeleton (root) |
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 pymel.core as pymel | |
def create_pivot_bone(): | |
""" | |
Create a bone from the customPivot context | |
In component mode of a mesh: | |
Press "D" or "Insert" to go into custom pivot context | |
If you click on edges verts or faces the pivot will auto align |
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 get_clipboard_data(): | |
""" | |
Get data from the clipboard | |
*Arguments:* | |
* ``None`` | |
*Keyword Arguments:* | |
* ``None`` | |
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
""" | |
MIT License | |
Copyright (c) [year] [fullname] | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
NewerOlder