Files
Nexus/2023/scripts/modeling_tools/creaseplus/__init__.py
2025-12-06 18:23:17 +08:00

32 lines
869 B
Python

#!/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}")