#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import maya.cmds as cmds from .config import data # 设置DNA路径 ROOT_DIR = data.TOOL_PATH MAYA_VERSION = data.MAYA_VERSION PYDNA_PATH = data.PYDNA_PATH print(f"ROOT_DIR: {ROOT_DIR}") print(f"MAYA_VERSION: {MAYA_VERSION}") print(f"PYDNA_PATH: {PYDNA_PATH}") # 添加DNA路径 if PYDNA_PATH not in sys.path: sys.path.insert(0, PYDNA_PATH) if PYDNA_PATH not in os.environ["PATH"]: os.environ["PATH"] = os.pathsep.join([PYDNA_PATH, os.environ["PATH"]]) # 先导入dna模块 try: import dna except ImportError as e: print(f"无法导入dna模块: {e}") print(f"PYDNA_PATH: {PYDNA_PATH}") raise # 现在导入其他模块 from .api import build_meshes, build_rig from .builder.config import Config, RigConfig from .builder.maya.skin_weights import ( get_skin_weights_from_scene, set_skin_weights_to_scene, ) from .dnalib.dnalib import DNA from .dnalib.layer import Layer from .MetaFusion import show from .version import __version__ __all__ = [ "DNA", "build_rig", "build_meshes", "show", "get_skin_weights_from_scene", "set_skin_weights_to_scene", "Config", "RigConfig", "Layer", "__version__", ]