Skip to content

Instantly share code, notes, and snippets.

View rBrenick's full-sized avatar

rBrenick

View GitHub Profile
import copy
import collections
import traceback
from maya import cmds
import pymel.core as pm
class AlignVerts():
__author__ = "rBrenick - [email protected]"
__created__ = "22/02/2020"
"""
1. Pull this script into a python tab in the script editor (or create a python shelf button)
1. Select blendshaped mesh
2. Select mesh to apply blendshapes on
3. Run script
__author__ = "rBrenick - [email protected]"
__created__ = "2020-07-13"
import os
import re
from Qt import QtGui
def hue_shift_stylesheet(base_sheet_path, new_sheet_path=None, hue_shift=160):
__author__ = "Richard Brenick - [email protected]"
__created__ = "2020-09-05"
__license__ = "MIT License"
import os
from Qt import QtCore, QtWidgets
class QtFilePath(QtWidgets.QWidget):
@rBrenick
rBrenick / connect_skeleton_to_ik_rig.py
Last active June 8, 2023 08:10
Maya script that connects up a skeleton to IKRig
import pymel.core as pm
# This is a script that connects one of the rigs from Maya's Content Browser to the IKRig from https://github.com/chadmv/cmt
base_ik_rig_list = [
"IKRig_Root",
"IKRig_Hips",
"IKRig_Chest",
"IKRig_Neck",
"IKRig_Head",
@rBrenick
rBrenick / preview_atom_parser.py
Last active October 27, 2021 01:04
Manual python parsing of an .atom file and extracting attribute information
from maya import cmds
class ReturnCode:
anim_layer_found = "anim_layer_found"
def preview_frame_from_atom(atom_path, preview_first_frame=True):
"""
Manual parse through the .atom file and figure out what a frame looks like
@rBrenick
rBrenick / split_unreal_stubs.py
Last active November 29, 2021 14:41
Quick script to split a big unreal.py stubs file into multiple smaller ones
# quick script to split a big unreal.py stubs file into multiple smaller ones
# for use as autocompletion in PyCharm (without having to increase the memory allocation)
__author__ = "[email protected]"
__version__ = "1"
import os
# path to unreal stubs
unreal_stubs_src_path = r"YOUR_PROJECT_HERE\Intermediate\PythonStub\unreal.py"
@rBrenick
rBrenick / custom_right_click_start_end_frame.py
Last active November 23, 2021 23:08
Adds a custom context menu to start and end frame selectors. So you can easily set the start/end frame without typing. NOTE: Might break on large layout refreshes of Maya UI elements (like a layout load)
__author__ = "[email protected]"
import sys
from functools import partial
from maya import mel
from maya import cmds
from maya import OpenMayaUI as omui
from PySide2 import QtCore, QtWidgets, QtGui
from shiboken2 import wrapInstance
@rBrenick
rBrenick / generate_lowres_textures.py
Created March 11, 2022 09:20
Find all textures in the maya scene, and create a low res proxy using Qt
import os
import pymel.core as pm
import json
from PySide2 import QtCore, QtGui
def generate_lowres_textures(output_textures_folder, new_size=1024):
"""
generate lowres textures from those found in the maya scene
"""
generated_texture_paths = []
@rBrenick
rBrenick / fancy_separate.py
Created June 30, 2022 19:19
Maya script for a combined Separate/Extract
"""
FancySeparate by Richard Brenick
(written for JKeys)
A combined Separate/Extract script.
Also does some clean up of groups created by seperate function.
"""
import maya.cmds as cmds
import maya.mel as mel