getting error when running maya viewer #45
Labels
No Label
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: CGNICO/Metahuman_DNA_Calibration#45
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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!!
Hi,
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: