회원 로그인
|
Expression - rand
객체.attribute = rand(limit, limit);
//예제1) //pCube1가 translate X의 1~50 사이로 렌덤하게 한 프레임씩 이동하게 된다. pCube1.translateX = rand(1, 50); //예제2) //pCube1가 translate X의 -50~50 사이로 렌덤하게 한 프레임씩 이동하게 된다. pCube1.translateX = rand(-50, 50);rotate와 scale, visibility도 가능하다.
* visibility는 on (1) / off (0) 이므로
pCube1.visibility = rand(0, 1);이렇게 해주면 된다.
활용 예제)
컨트롤 아이콘을 달아 expression을 제어하도록 해보자.
conIcon이라는 이름으로 curve를 만들어 conIcon이라고 attribute를 추가한 후 pCube1에 expression을 적용한다. curve인 conIcon의 on_off가 0이면 rand 명령을 중단하고, 1이면 expression이 작동된다.
if (conIcon.on_off == 1) { pCube1.translateX = rand(-1, -50)+rand(1,50); pCube1.translateY = rand(-1, -50)+rand(1,50); pCube1.translateZ = rand(-1, -50)+rand(1,50); pCube1.scaleX = rand(-1, -50)+rand(1,50); pCube1.visibility = rand(0, 1); } else {}
- exp_rand.mb (55.1KB) (0)
댓글 0개
| 엮인글 0개
466개(19/24페이지)
번호 | 제목 | 글쓴이 | 조회 | 날짜 |
---|---|---|---|---|
마야 뷰포트 네비게이션 팁 | 푸딩뱃살 | 42789 | 2020.04.06 17:22 | |
Maya 버전 별 Python 버전 | 푸딩뱃살 | 64097 | 2014.01.08 17:59 | |
104 | [Script] Python for Maya - 2. select (선택) | artsOne | 5020 | 2008.02.20 23:18 |
103 | [Script] Python for Maya - 1. 시작 | artsOne | 5815 | 2008.02.19 13:45 |
102 | [참고] Simulating Musculature in Maya | artsOne | 3011 | 2008.02.17 18:41 |
101 | [Script] MEL - checkBox | artsone | 3305 | 2008.02.11 02:49 |
100 | [Script] 연산자(Operator) 정의 | artsone | 2473 | 2008.02.09 18:17 |
99 | [Script] 변수(Varialbe) 정의 | artsone | 2385 | 2008.02.02 19:00 |
98 | [Script] [스크랩] Expressions to scale, rotate and spin by Aziz Khan | artsone | 2736 | 2008.01.31 03:36 |
97 | [Base] 속성(Attribute) 정의 | artsone | 2029 | 2008.01.29 22:39 |
96 | [Script] MEL - 이동 제어문 return | artsone | 3192 | 2008.01.28 21:48 |
95 | [Script] MEL - 이동 제어문 continue | artsone | 3111 | 2008.01.28 21:17 |
94 | [Script] MEL - 이동 제어문 break | artsone | 3326 | 2008.01.28 21:01 |
93 | [Script] MEL - 반복 제어문 for | artsone | 3446 | 2008.01.25 21:12 |
92 | [Script] MEL - 반복 제어문 for-in | artsone | 3297 | 2008.01.28 22:39 |
91 | [Script] MEL - 반복 제어문 do-while | artsone | 2842 | 2008.01.25 20:58 |
90 | [Script] MEL - 반복 제어문 while | artsone | 3126 | 2008.01.23 23:46 |
89 | [Script] MEL - 조건 제어문 ?: | artsone | 3076 | 2008.01.23 23:12 |
88 | [Script] MEL - 조건 제어문 switch | artsone | 3140 | 2008.01.23 22:50 |
87 | [Script] MEL - 조건 제어문 if | artsone | 3904 | 2008.01.21 01:23 |
>> | [Script] Expression - rand | artsone | 2406 | 2008.01.20 23:43 |
85 | [Rendering] [스크랩] Maya software render에서 그림자에도 motion blur적용하는 방법 | artsone | 4700 | 2008.01.15 17:35 |