Skip to content

Instantly share code, notes, and snippets.

View OmniZ3D's full-sized avatar

Jason Barnidge OmniZ3D

View GitHub Profile
@vshotarov
vshotarov / markingMenu.py
Created May 13, 2017 11:48
Example of a custom marking menu in Maya, scripted in Python.
'''A simple example of a custom marking menu in Maya. The benefits of doing it this way with Python are that
it is very flexible and easily maintainable. Additionally, you can keep it in a version control system.
This file is used for demonstration purposes, to be followed along with in this blog post
http://bindpose.com/custom-marking-menu-maya-python/
'''
import maya.cmds as mc
@vshotarov
vshotarov / ikFkSwitch.py
Last active August 30, 2022 16:50
Functions for switching between IK and FK setups, matching the existing pose.
'''File containing simple commands for switching between IK and FK and keeping the pose.
This file is used for demonstration purposes, to be followed along with in this blog post
http://bindpose.com/seamless-ik-fk-switch-maya-python/
'''
import maya.cmds as mc
def ikFkSwitch_sameOrient():
@vshotarov
vshotarov / shelfBase.py
Last active May 29, 2024 03:59
Maya base class for building custom shelves.
import maya.cmds as mc
def _null(*args):
pass
class _shelf():
'''A simple class to build shelves in maya. Since the build method is empty,
it should be extended by the derived class to build the necessary shelf elements.
@Meatplowz
Meatplowz / FBX_Scene.py
Last active April 29, 2024 10:12
This is a wrapper FBX class useful in accessing and modifying the FBX Scene
"""
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
@Meatplowz
Meatplowz / FBX_Character_Cleanup.py
Last active January 20, 2022 15:22
This is used with the FBX_Scene Class in cleaning up an exported skeletal mesh fbx
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:
@timrijckaert
timrijckaert / image-comparator
Last active December 19, 2022 11:04
A simple Python script used for comparing two folders containing screenshots after an Espresso/Spoon run. One folder contains your base screenshots the other folder your newly screenshots. Use this as your last regression resort to see if Espresso overlooked something.
#!/usr/bin/python
import glob
import os
import sys
from subprocess import Popen, PIPE
# Script that will compare screenshots to a set of previous screenshots
# first arg: full path to base screenshots
# second arg: full path to spoon output dir
@unixpickle
unixpickle / main.go
Created January 5, 2017 02:49
RBF Network Diagrams
package main
import (
"image"
"image/color"
"image/png"
"math"
"os"
"strconv"
)
"""
Warning: The mirror functionnality of OMTK is in alpha stage. Use it at your own risk!
Usage example:
# Step 1: Add attributes
for obj in pymel.selected():
add_mirror_attr(obj)
# Step 2: Manually configure attributes
@yamahigashi
yamahigashi / MTypeId.tsv
Last active September 18, 2019 02:49
maya MTypeId listing (incomplete)
typeId typeName classification attributeCount
0x345dad01 substance texture/2d 38L
0x346dad01 substanceOutput drawdb/shader/texture/2d/substanceOutput:texture/2d 36L
0x41424141 animBlendNodeAdditiveDA animation 12L
0x41424146 animBlendNodeAdditiveF animation 12L
0x41424149 animBlendNodeAdditiveI32 animation 12L
0x4142414c animBlendNodeAdditiveDL animation 12L
0x41424153 animBlendNodeAdditiveI16 animation 12L
0x4142424f animBlendNodeBoolean animation 11L
0x41424641 animBlendNodeAdditiveFA animation 12L
@BigRoy
BigRoy / maya_extract_edits.py
Created January 20, 2016 15:28
Description of how one could retrieve the "edits" for referenced nodes (draft implementation)
"""This is a first draft template that could be used to retrieve the edits on referenced nodes that define a look
Next step would be to filter the edits of interest, like shader assignments, sets they are added to, attributes that were added or changed in value.
Then we need to store these changes in a format that is artist-friendly and can be re-applied in another scene.
"""
import maya.cmds as mc
from collections import defaultdict