Skip to content

Instantly share code, notes, and snippets.

View KINO-REALA's full-sized avatar

Kino KINO-REALA

View GitHub Profile
@viktorasm
viktorasm / code.py
Created December 7, 2023 22:52
path from a to b, chatgpt edition
import maya.cmds as cmds
import maya.api.OpenMaya as om
from typing import List, Optional
def get_locator_position(locator_name: str) -> om.MVector:
"""Retrieve the position of a given locator"""
if not cmds.objExists(locator_name):
raise ValueError(f"Locator '{locator_name}' does not exist.")
return om.MVector(
# Python version of findRelatedSkinCluster.mel
# Based in findRelatedSkinCluster.mel MEL script file found in Maya 2020
import maya.cmds
def find_related_skin_cluster(skin_obj):
skin_shape = None
skin_shape_with_path = None
hidden_shape = None
@BigRoy
BigRoy / maya_list_file_node_sequence_files.py
Created February 27, 2018 14:46
For maya file paths list all files that match a pattern like UDIM patterns or file sequence patterns
def seq_to_glob(path):
"""Takes an image sequence path and returns it in glob format,
with the frame number replaced by a '*'.
Image sequences may be numerical sequences, e.g. /path/to/file.1001.exr
will return as /path/to/file.*.exr.
Image sequences may also use tokens to denote sequences, e.g.
/path/to/texture.<UDIM>.tif will return as /path/to/texture.*.tif.