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'taskkill /f /im maya.exe', shell=True)
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
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
-> Rig_Group
-> Bind_Skeleton (root)
View create_pivot_bone
def create_pivot_bone():
Create a bone from the customPivot context
In component mode of a mesh:
Press "D" to go into custom pivot context
If you click on edges verts or faces the pivot will auto align
If you want to aim an axis click on the axis and ctrl+shift on another vert/edge/face to aim it
When you have the pivot you want run this to create the joint with that pivot
def get_clipboard_data():
Get data from the clipboard
* ``None``
*Keyword Arguments:*
* ``None``
This is a helper FBX class useful in accessing and modifying the FBX Scene
Documentation for the FBX SDK
# 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
def remove_layers(fbx_file, layers):
Remove layers from the FBX Scene
layer_names = []
for layer in layers:
# set these property values
import FBX_Scene
import FbxCommon
def clean_character_scene(fbx_filename):
Clean up character fbx file
# open the fbx scenes and get the scene nodes
fbx_file = FBX_Class(fbx_filename)
if not fbx_file: