Skip to content

Instantly share code, notes, and snippets.

@BigRoy
BigRoy / maya_what_is_mel_code.py
Created June 17, 2021 11:15
Return location of MEL script using maya whatIs plus directly print the source code of the procedure
from maya import cmds
import re
import os
def get_mel_script_code(name):
"""Return source code of the MEL procedure loaded from a .mel script file"""
result = mel.eval('whatIs("%s")' % name)
if result == "Unknown":