You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I think I did everything right, yet I cannot get the maya window:
Error: ImportError: file line 49: cannot import name 'show_dna_viewer_window' from 'dna_viewer' (C:\dna_callibration\dna_viewer_init_.py)
I made sure I downloaded python3
I downloaded: MetaHuman-DNA-Calibration-1.0.1
I copied the files in the ''lib'' folder to C:\MEGAscan\support\plugins\maya\6.8\MSLiveLink\DHI\lib\Windows\python3
In Maya, I executed one by one:
import dna
import sys
sys.modules["dna"]
I executed the script from dna_viewer_run_in_maya
I changed line 25 for the location of the folder
"""
This example demonstrates Maya UI Window for simple and non-programmatic creation the scene with the creating functional rig.
usage in command line:
call without arguments:
will not start with error message: "DNAViewer needs to be run with Maya2022"
NOTE: Script cannot be called with Python or mayapy, it' must be called in Maya Script Editor.
usage in Maya:
copy whole content of this file to Maya Script Editor
change value of ROOT_DIR to absolute path of dna_calibration, e.g. c:/dna_calibration in Windows or /home/user/dna_calibration. Important:
Use / (forward slash), because Maya uses forward slashes in path.
Expected: Maya will show UI.
NOTE: If running on Linux, please make sure to append the LD_LIBRARY_PATH with absolute path to the lib/linux directory before running the example:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:
"""
from os import environ
from os import path as ospath
from sys import path as syspath
from sys import platform
if you use Maya, use absolute path
#ROOT_DIR = f"{ospath.dirname(ospath.abspath(file))}/..".replace("\", "/")
ROOT_DIR = f'C:\dna_callibration'
ROOT_LIB_DIR = f"{ROOT_DIR}/lib"
if platform == "win32":
LIB_DIR = f"{ROOT_LIB_DIR}/windows"
elif platform == "linux":
LIB_DIR = f"{ROOT_LIB_DIR}/linux"
else:
raise OSError(
"OS not supported, please compile dependencies and add value to LIB_DIR"
)
Add bin directory to maya plugin path
if "MAYA_PLUG_IN_PATH" in environ:
separator = ":" if platform == "linux" else ";"
environ["MAYA_PLUG_IN_PATH"] = separator.join([environ["MAYA_PLUG_IN_PATH"], LIB_DIR])
else:
environ["MAYA_PLUG_IN_PATH"] = LIB_DIR
could you copy just code snippet from Maya script editor? It is difficult to follow with all this comments coming from the example. There is no need to copy lib folder anywhere.
This snippet works for me:
from sys import path as syspath
from sys import platform
ROOT_DIR = "D:/work/pycharmspace/MetaHuman-DNA-Calibration"
MAYA_VERSION = "2022" # or 2023
ROOT_LIB_DIR = f"{ROOT_DIR}/lib/Maya{MAYA_VERSION}"
if platform == "win32":
LIB_DIR = f"{ROOT_LIB_DIR}/windows"
elif platform == "linux":
LIB_DIR = f"{ROOT_LIB_DIR}/linux"
else:
raise OSError(
"OS not supported, please compile dependencies and add value to LIB_DIR"
)
syspath.insert(0, ROOT_DIR)
syspath.insert(0, LIB_DIR)
import dna_viewer
dna_viewer.show()
Hi, I think I did everything right, yet I cannot get the maya window:
Error: ImportError: file line 49: cannot import name 'show_dna_viewer_window' from 'dna_viewer' (C:\dna_callibration\dna_viewer_init_.py)
I made sure I downloaded python3
I downloaded: MetaHuman-DNA-Calibration-1.0.1
I copied the files in the ''lib'' folder to C:\MEGAscan\support\plugins\maya\6.8\MSLiveLink\DHI\lib\Windows\python3
In Maya, I executed one by one:
import dna
import sys
sys.modules["dna"]
I changed line 25 for the location of the folder
"""
This example demonstrates Maya UI Window for simple and non-programmatic creation the scene with the creating functional rig.
usage in command line:
NOTE: Script cannot be called with Python or mayapy, it' must be called in Maya Script Editor.
usage in Maya:
c:/dna_calibration
in Windows or/home/user/dna_calibration
. Important:Use
/
(forward slash), because Maya uses forward slashes in path.Expected: Maya will show UI.
NOTE: If running on Linux, please make sure to append the LD_LIBRARY_PATH with absolute path to the lib/linux directory before running the example:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:
"""
from os import environ
from os import path as ospath
from sys import path as syspath
from sys import platform
if you use Maya, use absolute path
#ROOT_DIR = f"{ospath.dirname(ospath.abspath(file))}/..".replace("\", "/")
ROOT_DIR = f'C:\dna_callibration'
ROOT_LIB_DIR = f"{ROOT_DIR}/lib"
if platform == "win32":
LIB_DIR = f"{ROOT_LIB_DIR}/windows"
elif platform == "linux":
LIB_DIR = f"{ROOT_LIB_DIR}/linux"
else:
raise OSError(
"OS not supported, please compile dependencies and add value to LIB_DIR"
)
Add bin directory to maya plugin path
if "MAYA_PLUG_IN_PATH" in environ:
separator = ":" if platform == "linux" else ";"
environ["MAYA_PLUG_IN_PATH"] = separator.join([environ["MAYA_PLUG_IN_PATH"], LIB_DIR])
else:
environ["MAYA_PLUG_IN_PATH"] = LIB_DIR
Adds directories to path
syspath.insert(0, ROOT_DIR)
syspath.insert(0, LIB_DIR)
this example is intended to be used in Maya
from dna_viewer import show_dna_viewer_window
show_dna_viewer_window()
Any help is greatly appreciated, thank you!!
The text was updated successfully, but these errors were encountered: