2025-02-09 21:35:41 +08:00
|
|
|
|
#!/usr/bin/env python
|
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
2025-02-09 23:46:33 +08:00
|
|
|
|
import os
|
|
|
|
|
import sys
|
|
|
|
|
from . import config
|
|
|
|
|
|
|
|
|
|
# 确保PYDNA_PATH在sys.path中
|
|
|
|
|
if config.PYDNA_PATH not in sys.path:
|
|
|
|
|
sys.path.insert(0, config.PYDNA_PATH) # 将PYDNA_PATH添加到搜索路径的最前面
|
|
|
|
|
|
|
|
|
|
# 先导入dna模块
|
|
|
|
|
try:
|
|
|
|
|
import dna
|
|
|
|
|
except ImportError as e:
|
|
|
|
|
# 更详细的错误信息
|
|
|
|
|
print("="*80)
|
|
|
|
|
print("DNA模块导入失败:")
|
|
|
|
|
print(f"错误信息: {str(e)}")
|
|
|
|
|
print(f"PYDNA_PATH: {config.PYDNA_PATH}")
|
|
|
|
|
print(f"当前Python路径:")
|
|
|
|
|
for p in sys.path:
|
|
|
|
|
print(f" - {p}")
|
|
|
|
|
print("="*80)
|
|
|
|
|
|
|
|
|
|
# 检查pydna目录是否存在及其内容
|
|
|
|
|
if os.path.exists(config.PYDNA_PATH):
|
|
|
|
|
print(f"\nPYDNA目录内容:")
|
|
|
|
|
for root, dirs, files in os.walk(config.PYDNA_PATH):
|
|
|
|
|
print(f"\n目录: {root}")
|
|
|
|
|
for d in dirs:
|
|
|
|
|
print(f" 目录: {d}")
|
|
|
|
|
for f in files:
|
|
|
|
|
print(f" 文件: {f}")
|
|
|
|
|
else:
|
|
|
|
|
print(f"\nPYDNA目录不存在: {config.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 .config import __version__
|
|
|
|
|
|
|
|
|
|
__all__ = [
|
|
|
|
|
"DNA",
|
|
|
|
|
"build_rig",
|
|
|
|
|
"build_meshes",
|
|
|
|
|
"show",
|
|
|
|
|
"get_skin_weights_from_scene",
|
|
|
|
|
"set_skin_weights_to_scene",
|
|
|
|
|
"Config",
|
|
|
|
|
"RigConfig",
|
|
|
|
|
"Layer",
|
|
|
|
|
"__version__",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|