Maya에서 MEL 스크립트를 호출하여 큐브를 작성하는 간단한 Python 스크립트를 작성하려고합니다. 예! 소스 파일에 대한 구문을 잘못 알았을 수도 있습니다. 여기 Python에서 MEL 스크립트 호출 - MEL 스크립트 실행 중 오류가 발생했습니다.
내가 가진 무엇 :runMEL.py 파이썬 파일 : 멜
def runMEL():
print ("Running MEL from Python!")
mel.eval('"source D:\Maya_Python\myMELScript.mel;"') # source of the file
mel.eval("myMELScript;") #name of the function
runMEL() # call the function above
그리고 MEL 스크립트 myMELScript.mel로 수입 maya.mel
global proc myMELScript()
// call a MEL script with Python
{
polyCube -w 1 -h 1 -d 1 -sx 1 -sy 1 -sz 1 -ax 0 1 0 -cuv 4 -ch 1;
print("MEL just made a cube!");
}
내가 얻을 콘솔에서 다음을 입력하십시오 :
Running MEL from Python!
// Error: "source D:\Maya_Python\myMELScript.mel;"; //
// Error: Line 1.40: Syntax error //
# Error: RuntimeError: file <maya console> line 5: Error occurred during execution of MEL script
Line 1.40: Syntax error #
당신이 어색한 멜을 통해 이것을 기각하고 싶다는 특별한 이유가 있습니까? – user1767754