#!/usr/bin/env python # -*- coding: utf-8 -*- """ CreasePlus MEL Tool Wrapper Provides Python interface to launch the CreasePlus MEL tool """ import maya.cmds as cmds import maya.mel as mel import os def start(): """Launch CreasePlus MEL tool""" # Get the directory containing this script script_dir = os.path.dirname(os.path.abspath(__file__)) icon_dir = os.path.join(script_dir, 'icons').replace('\\', '/') # Set global MEL variable for icon path mel.eval(f'global string $cp_icon_path = "{icon_dir}/"') # Source the MEL script mel_script = os.path.join(script_dir, 'CreasePlus.mel').replace('\\', '/') try: mel.eval(f'source "{mel_script}"') mel.eval('cpUi') print(f"CreasePlus: UI launched successfully") except Exception as e: print(f"CreasePlus: Error launching UI: {e}")