Update
This commit is contained in:
parent
4fb8654dfc
commit
693a9663b9
@ -1,4 +1,65 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from . import *
|
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__",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import webbrowser
|
|||||||
import datetime
|
import datetime
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
__version__ = "2.1.1"
|
||||||
# Base Information
|
# Base Information
|
||||||
TOOL_NAME = str("MetaFusion")
|
TOOL_NAME = str("MetaFusion")
|
||||||
TOOL_VERSION = str("Beta v1.0.0")
|
TOOL_VERSION = str("Beta v1.0.0")
|
||||||
@ -31,10 +31,24 @@ BUILDER_PATH = str(os.path.join(SCRIPTS_PATH, "builder").replace("\\", "/"))
|
|||||||
DNALIB_PATH = str(os.path.join(SCRIPTS_PATH, "dnalib").replace("\\", "/"))
|
DNALIB_PATH = str(os.path.join(SCRIPTS_PATH, "dnalib").replace("\\", "/"))
|
||||||
UI_PATH = str(os.path.join(SCRIPTS_PATH, "ui").replace("\\", "/"))
|
UI_PATH = str(os.path.join(SCRIPTS_PATH, "ui").replace("\\", "/"))
|
||||||
UTILS_PATH = str(os.path.join(SCRIPTS_PATH, "utils").replace("\\", "/"))
|
UTILS_PATH = str(os.path.join(SCRIPTS_PATH, "utils").replace("\\", "/"))
|
||||||
# System Information
|
def get_system_os():
|
||||||
SYSTEM_OS = str(sys.platform)
|
SYSTEM_OS = str(sys.platform)
|
||||||
MAYA_VERSION = str(mel.eval("$gMAJOR.$gMINOR"))
|
"""获取系统平台"""
|
||||||
|
if SYSTEM_OS == "win32":
|
||||||
|
return "Windows"
|
||||||
|
elif SYSTEM_OS == "linux":
|
||||||
|
return "Linux"
|
||||||
|
elif SYSTEM_OS == "darwin":
|
||||||
|
return "macOS"
|
||||||
|
else:
|
||||||
|
return SYSTEM_OS
|
||||||
|
|
||||||
|
SYSTEM_OS = get_system_os()
|
||||||
|
|
||||||
|
# 使用cmds.about()获取Maya版本
|
||||||
|
MAYA_VERSION = str(cmds.about(version=True))
|
||||||
PYTHON_VERSION = str(f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}")
|
PYTHON_VERSION = str(f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}")
|
||||||
|
|
||||||
def get_python_version():
|
def get_python_version():
|
||||||
"""获取Python版本目录名称"""
|
"""获取Python版本目录名称"""
|
||||||
version = sys.version_info
|
version = sys.version_info
|
||||||
@ -120,7 +134,6 @@ if __name__ == "__main__":
|
|||||||
TOOL_STYLE_FILE,
|
TOOL_STYLE_FILE,
|
||||||
DNACALIB_PATH,
|
DNACALIB_PATH,
|
||||||
BUILDER_PATH,
|
BUILDER_PATH,
|
||||||
|
|
||||||
DNALIB_PATH,
|
DNALIB_PATH,
|
||||||
UI_PATH,
|
UI_PATH,
|
||||||
UTILS_PATH,
|
UTILS_PATH,
|
||||||
|
Loading…
Reference in New Issue
Block a user