회원 로그인
정보기억 정보기억에 체크할 경우 다음접속시 아이디와 패스워드를 입력하지 않으셔도 됩니다.
그러나, 개인PC가 아닐 경우 타인이 로그인할 수 있습니다.
PC를 여러사람이 사용하는 공공장소에서는 체크하지 마세요.
소셜네트워크 서비스를 통해서 로그인하시면 별도의 로그인 절차없이 회원서비스를 이용하실 수 있습니다.


최근 게시물

1.노션에서 작성 중

1.노션에서 작성 중

개편하기 전까지 노션에서 작성 중

2024.04.04//read more

2.ChatGPT

2.ChatGPT

OpenAI로 대규모 언어 모델대화형...

2023.03.16//read more

3.노코딩 게임 엔진 - 빌..

3.노코딩 게임 엔진 - 빌..

빌드 지원안드로이드iOS윈도우즈특이사...

2023.03.14//read more

4.(완료) 미접속 회원 정..

4.(완료) 미접속 회원 정..

[완료] 36명의 회원을 정리하였습니...

2023.02.16//read more

5.매뉴얼 플러스 - 전자제..



안정적인 DNS 서비스 DNSEver
DNS Powered by DNSEver.com


[스크랩] Maya help에 있는 Python 참조문 번역 - Python in Maya

artsone | 2008.01.15 16:54 | 조회 5109

http://cafe.naver.com/vfxlabs

제데로된 영어공부를 시작한지 4개월.. 초보적 번역이라서 쪽팔리긴 하지만 매일 조금씩 번역한거 올리기로 했습니다.
제가 번역한것이 맞는지 틀린지 알고싶기도 하고.. 여러분이 생소한 Python을 공부하는데 조금이라도 도움이 되었으면 하는 마음입니다.. 어순은 영문으로 적혀있는 그대로가 아니라 뜻이 통하겠다고 생각되는데로 제가 맞춰서 적었고 도저희 모르는 단어나 전문용어들은 영문철자 그대로 적었습니다.. 읽어보시다가 저의 번역이 오역이라고 생각되시면 가차없이 덧글을 달아서 수정해 주시거나 저에게 전화 하셔서 몇마디 욕과함께 대안을 제시해 주셔도됩니다(욕얻어먹을 준비가 되있음..) 그러나 번역이라는게 쉬운건 아니더군요 단어, 숙어, 문법을 알아도 사전검색해서 나오지 않는 전문용어때문에 번역이 안되는 일이 많았습니다.. 부족하지만 많이 읽어주시면 감사하겠습닌다.
그럼 Let's go to the Python world..



Python in Maya

Autodesk Maya supports the use of Python-style scripting wherever you used to use MEL commands. The implementation of Python scripting in Maya provides the same access to native Maya commands as is provided through MEL. , all of the built-in Maya commands, such as sphere, ls, and so on, are accessible through Python.
오토데스크 마야는 멜이 쓰일수있는 어디에라도 파이썬 스타일의 스크립트를 지원한다. Maya에서 Python 스크립팅의 완성은 원래의 Maya 고유 명령어로의 접속을 MEL을 통해 제공해준다. sphere, ls,등등 과같은 모든 내장maya command들을 Python을통해 쉽게 접근할수 있다.

Commands that are written as MEL scripts—which are actually MEL global procedures (procs)—are accessible using a call to access MEL (maya.mel.eval). For more information, see MEL/Python communication.
MEL 글로벌 프로시져(procs)와 같이 쓰여진 command들은 maya.mel.eval사용해서 쉽게 접근할수 있다..(역주:Python 탭에서는 MEL로된 문을 실행할수 없으나 (maya.mel.eval)메쏘드를 이용해서 Python 탭에서도 MEL실행이 가능하다..). 더많은 정보를 원한다면 MEL/Python communication보기를 바란다.

Note
There are certain MEL built-ins that are not available in Python, though they generally have Python counterparts.These include math functions (abs, sin, cos, ...) and string functions (match, gmatch, tokenize...). (The set of MEL built-in functions can be considered the MEL runtime library.)
Python comes with a wide variety of standard modules that provide similar functionality. Refer to Python documentation for information on what is available and how to use these functions in your Python scripts.
Python에서 실행되지않는 내장MEL이 분명히 존재한다 . 그러나 Python은 그와유사한 기능들을 갖추고 있다. abs, sin, cos…를 포함하는 수학함수와 match, gmatch, tokenize…를 포함하는 문자함수가 그것들이다..(내장MEL 기능들은 MEL rutime library로 간주된다)
Python은 비슷한 기능으로 폭넓게 변형된 표준 모듈과함께 maya에 들어왔다. Python 스크립트의 함수를 어떻게 이용할수 있는지 무엇이 쓸모있는지 의 정보를 위해 Python documentation을 참고하기 바란다.

(역주: MEL에는있는 tokenize명려어가 Python에는 없다. 그러나 Python에는 split이라는 아주유용한
메쏘드가 있기 때문에 궂이 MEL을 쓸필요가 없다.. Ex:

MEL
string $select = "Lee . Sueng"
tokenize $select "." $buffer; $buffer = {Lee , Sueng}

Python
select = "Lee . Sueng"
Buffer = select.split('.') buffer = [Lee , Sueng]

역주: http://docs.python.org/lib/lib.html
Python Library Reference
오늘은 아무리봐도 별내용이 없군요 ㅎㅎ)



Python Command Reference
Python Conmmand Reference (Python 참고자료..)

There is a Python command reference similar to the MEL command reference. For details on all Python commands, refer to the Python command reference documentation in Maya Help.
MEL command reference 와비슷한 Python command reference가 있다. Python command의 상세한 참조를 위해 Maya help에 Python command 참조 문서를 조회하면 된다.

You can access the help by selecting Help > Python Command Reference or open the Maya Help (Help > Maya Help), and when the Help appears, click CommandsPython at the bottom of the navigation frame.
Help > Python Command Reference 또는 Maya Help (Help > Maya Help) 클릭 후 help 화면이 뜨면 CommandsPython (역주: 왼쪽 맨아래 빨간글씨) 를 클릭해 보라.


Version
Version (버젼)

Maya installs Python with your Maya installation. Maya uses Python version 2.4.3 on all supported platforms. The standalone Python shell for Maya is named mayapy.exe on Windows and mayapy on Linux and Mac OS X.
Maya를 인스톨할때 Python은 함께 인스톨된다. Maya는 Python 2.4.3버젼을 사용하며 모든 소프웨어 환경을 지원합니다. 내장 Python 이외에도 Maya를위한 standalone Python의 이름은 window에서 mayapy.exe이고 Linux와 Mac os x에서는 mayapy라고 붙여진다.
(역주:Maya와 다른프로그램과의 대화를위해 일반의 Python과 모양이 비슷한 Python interpreter가 Program Files > Autodesk > Maya8.5 > bin 에 mayapy.exe라는이름으로 있습니다.)



External resources
External resources (외부 자료)

For information about getting started with Python, including reference material and resources, see:
Python의 정보(참고 자료와 resources)를 위해 www.python.org 에 방문해 보라.

* www.python.org


Initializing the Maya Environment in and for Python
Initializing the Maya Environment in and for Python (Maya 환경 초기화를 위한 Python)

Maya runs any Python commands in the userSetup.py file whenever it starts up. You can use this file to set up your working environment or execute commonly used Python commands such as importing the maya.cmds module.
Maya는 처음실행할때(역주:Maya 실행파일을 클릭 후 UI가 나타날 때) userSetup.py안에 있는 Python문들을 실행한다. 이파일은 작업환경을 조성하거나 maya.cmds module을 불러오기와 같은 Python문을 이용한 일반적인 실행에 쓰일 수 있다.

The userSetup.py script is executed during the initialization and setup phase of Maya; therefore, only commands which set up your working environment and have no dependencies on Maya functionality can be successfully run in this script.
userSetup.py는 Maya의 setup단계나 초기화 하는 동안 실행된다.
(역주: Mel의 userSetup.mel과 같은 일을 한다)


Note
You can use maya.utils.executeDeferred() to delay code execution until after the Maya scene is initialized. For more information, see maya.utils.
maya.utils.executeDeferred()메쏘드를 써서 userSetup.py안의 코드의 실행을 Maya scene이 초기화된 이후까지 늦출수 있다. 더자세한 사항은 maya.utils를 참고하기 바란다.

1. Create a file named userSetup.py in the following folder:
1. 다음 폴더안에 userSetup.py라는이름에 file을하나 만들어라:
* Windows: :Documents and SettingsMy Documentsmayascripts
* Windows경로 : :Documents and SettingsMy Documentsmayascripts
* Mac OS X: ~/Library/Preferences/Autodesk/maya//scripts
* Mac OS X경로 : ~/Library/Preferences/Autodesk/maya//scripts
* Linux: ~/maya//scripts
* Linux경로 : ~/maya//scripts

2. In the userSetup.py file, type the commands you want Maya to run on start up; for example,
import maya.cmds as mc.
2. userSetup.py File안에 Maya가 실행될때 함께 실행하고 싶은 Command를 코딩하라 Ex:
import maya.cmds as mc.


Note
Make sure you save the file with the right extension (.py).
저장할때 확장자명을 옳바르게 .py로 했는지 확인하기 바란다


Adding items to your Python path
Adding items to your Python path (Python 경로에 데이터 항목 더하기)

To add items to your path in Python, do one of the following:
Python경로에 데이터항목 더하는 작업은 다음과같이 행하라:

1. Set PYTHONPATH in your Maya.env file, or in your environment before you run Maya
1. Maya실행전에 Maya.env file이나 작업자 환경변수에 Python 경로를 추가하라.
2. Append to sys.path in your userSetup.py or other script once Maya is running.
2. userSetup.py에 다음의 명령문을 추가하거나 일단 Maya가 실행중이라면 스크립에서 다음의 명령문을 실행하기 바란다.

Here is an example of appending sys.path
sys.path로 경로 추가하기에 관한 예는 다음과 같다.

import sys
sys.path.append( '/Users/jdoe/maya/Scripts' )
import sys
sys.path.append( '당신의 Python경로' )

( 역주: userSetup.py에 위의 문을 코딩하면 경로가 추가됩니다 )



MEL and Python importing
MEL and Python importing (MEL과 Python import하기)

If you have a MEL script in your path, you do not need to source it before accessing any single global procedure it contains with the same name. However, Python requires you to import a script explicitly before accessing any classes or functions it contains; for example:
MEL 스크립트 경로에 쓰고자 하는 MEL이 있다면 Import할 필요 없이 같은 이름으로 접근하면 된다. 그러나 Python의 경우 경로 상에 있다고 해도 classes 나 mudul등에 접근하기 전에 반듯이 Import를 해야한다; 예:

(역주: Mel의경우 스크립트 파일에 foo.mel이라는 file이 있을경우 스크립트창에 바로 foo라고 실행하면 실행이 된다.
그러나 Python의 경우 반듯이 Import foo 한다음에 실행해야 실행이 된다.)


# This will access the function "bar" in the file "foo.py"
import foo
foo.bar()

466개(20/24페이지)
마야
번호 제목 글쓴이 조회 날짜
공지 마야 뷰포트 네비게이션 팁 푸딩뱃살 42372 2020.04.06 17:22
공지 Maya 버전 별 Python 버전 푸딩뱃살 63689 2014.01.08 17:59
84 [Rendering] [스크랩] 마야 - 렌더 패스 Tutorial 사진 첨부파일 artsone 4630 2008.01.15 17:26
83 [Rendering] [스크랩] 마야 멘탈레이 - Layer Render [ Occlusion ] 사진 첨부파일 artsone 3869 2008.01.15 17:14
82 [Script] [스크랩] Maya help에 있는 Python 참조문 번역 - Current limitations artsone 4299 2008.01.15 17:07
81 [Script] [스크랩] Maya help에 있는 Python 참조문 번역 - Important difference artsone 5455 2008.01.15 17:07
80 [Script] [스크랩] Maya help에 있는 Python 참조문 번역 - Python from an exter artsone 4852 2008.01.15 17:04
79 [Script] [스크랩] Maya help에 있는 Python 참조문 번역 - Python and threading artsone 4691 2008.01.15 17:02
78 [Script] [스크랩] Maya help에 있는 Python 참조문 번역 - Using Python 사진 첨부파일 artsone 5491 2008.01.15 16:56
>> [Script] [스크랩] Maya help에 있는 Python 참조문 번역 - Python in Maya artsone 5110 2008.01.15 16:54
76 [FX] Rigid Body 테스트 사진 첨부파일 artsone 2261 2007.12.20 16:53
75 [참고] MEL Script Site artsone 2685 2007.12.17 04:31
74 [Base] 단축키 artsone 2062 2007.12.17 03:55
73 [Script] Expression - Time (sin, cos, tan) test 사진 첨부파일 artsone 2708 2007.12.15 05:40
72 [Rendering] UV Check Maps 사진 첨부파일 artsOne 1896 2007.12.09 23:45
71 [Rendering] [스크랩] V-Ray for Maya 사진 첨부파일 artsone 2631 2007.12.06 02:04
70 [Rigging] Squash and Stretch 뼈대 만들기 - IK Spline Handle 활용 사진 첨부파일 artsone 2827 2007.11.18 23:17
69 [Rigging] Squash and Stretch 뼈대 만들기 - IK Handle 활용 2 (만들기) 사진 첨부파일 artsone 2640 2007.11.16 01:14
68 [Rigging] Squash and Stretch 뼈대 만들기 - IK Handle 활용 1 (정의) 사진 첨부파일 artsOne 2509 2007.11.15 13:53
67 [Script] Expression - rad_to_deg 사진 첨부파일 artsone 2673 2007.11.14 19:40
66 [Script] Expression - time 사진 첨부파일 artsone 2320 2007.11.14 19:36
65 [Script] 리깅에 사용되는 Utility Node - Condition Node 사진 첨부파일 artsone 2234 2007.11.13 02:54