Skip to content

Instantly share code, notes, and snippets.

Randall Meatplowz

Block or report user

Report or block Meatplowz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Meatplowz
Meatplowz / Test_UI.py
Created Sep 3, 2018
Test_UI.py Boilerplate code for a Maya Tool
View Test_UI.py
"""
Author: Randall Hess randall.hess@gmail.com
Purpose: Boilerplate UI Code for Maya
Created: 8/5/2018
"""
import maya.cmds as cmds
import maya.OpenMayaUI as OpenMayaUI
@Meatplowz
Meatplowz / maya_psyide_ui_convert.py
Last active Sep 3, 2018
Convert a designer .UI file to .Py file and insert into an existing .Py tool file
View maya_psyide_ui_convert.py
import os
from shutil import copyfile
try:
# Pyside
from pysideuic import compileUi
except:
# Pyside2
from pyside2uic import compileUi
@Meatplowz
Meatplowz / performFileDropAction.mel
Last active Dec 26, 2018
Override the Maya Drag and Drop Behavior for File Open/Import
View performFileDropAction.mel
// Randall Hess randall.hess@gmail.com
// Instructions: Copy this file over your local maya version to override the default behavior
// 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)
{
@Meatplowz
Meatplowz / KillMaya.py
Last active Aug 20, 2018
Quickly Kill Maya Processes
View KillMaya.py
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)
@Meatplowz
Meatplowz / adjust_pv_to_elbow.py
Last active May 18, 2018
Brute force method to adjust the poleVector of one ik chain to line up the elbow joint of a similar arm chain
View adjust_pv_to_elbow.py
'''
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):
"""
View FBX_Unparent_Nodes.py
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)
@Meatplowz
Meatplowz / create_pivot_bone.py
Last active Nov 12, 2018
Create a joint based on the manipulator position and orientation
View create_pivot_bone.py
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
@Meatplowz
Meatplowz / get_clipboard_data.py
Created Apr 25, 2017
Maya get_clipboard_data
View get_clipboard_data.py
def get_clipboard_data():
"""
Get data from the clipboard
*Arguments:*
* ``None``
*Keyword Arguments:*
* ``None``
@Meatplowz
Meatplowz / FBX_Scene.py
Last active Mar 29, 2019
This is a wrapper FBX class useful in accessing and modifying the FBX Scene
View FBX_Scene.py
"""
This is a helper FBX class useful in accessing and modifying the FBX Scene
Documentation for the FBX SDK
http://help.autodesk.com/view/FBX/2015/ENU/?guid=__cpp_ref_index_html
Examples:
# instantiate the class, as seen below with a path to an FBX file
fbx_file = FBX_Class(r'c:\my_path\character.fbx')
#get all of the scene nodes
all_fbx_nodes = fbx_file.file.scene_nodes()
# remove namespaces from all of the nodes
@Meatplowz
Meatplowz / FBX_Remove_Layers.py
Last active Apr 2, 2018
Remove Display Layers from an FBX Scene
View FBX_Remove_Layers.py
def remove_layers(fbx_file, layers):
"""
Remove layers from the FBX Scene
"""
layer_names = []
for layer in layers:
layer_names.append(layer.GetName())
# set these property values
try:
You can’t perform that action at this time.