This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |