3ds maxscript 튜토리얼_20151206_서진택

127
3dsMax Script : 01. 개개개개 개개개 2014 년 3 년 31 년 년년년 , [email protected]

Upload: jintaek-seo

Post on 23-Feb-2017

1.090 views

Category:

Technology


6 download

TRANSCRIPT

Page 1: 3ds maxscript 튜토리얼_20151206_서진택

3dsMax Script :01. 개발환경 갖추기

2014 년 3 월 31 일서진택 , [email protected]

Page 2: 3ds maxscript 튜토리얼_20151206_서진택

발표순서 발표의 범위 개발에 필요한 툴 설치 툴 설치 후 동작 확인 MaxScript 동작 확인

– 3dsMax 2011 의 경우– 3dsMax 9 의 경우

MaxScript– 변수– 문장– 문자열– 할당의 의미

2

Page 3: 3ds maxscript 튜토리얼_20151206_서진택

Max Script 강좌의 범위 3dsMax 2011 의 Help-->MaxScript Help… 를

선택합니다 .

3

Page 4: 3ds maxscript 튜토리얼_20151206_서진택

How To - Practical Examples 까지를 이 강좌에서 다룹니다 .

4

Page 5: 3ds maxscript 튜토리얼_20151206_서진택

편집 툴 설치

[] Notepad++ 6.1.6 을 설치합니다경로\\nas\...파일npp.6.4.3.Installer.exe

[] Beyond Compare 3.1.3 을 설치합니다 .경로각 팀 프로그래머에게 요청하면 됩니다 .파일doa-0263.zip----Svn 과 통합하여 파일이나 폴더를 비교하기 위해 사용하는 툴입니다 .

Page 6: 3ds maxscript 튜토리얼_20151206_서진택

소스 관리 툴 설치

[] TortoiseSvn 1.6.6 을 설치합니다 .경로\\nas\...파일TortoiseSVN-1.6.6.17493-x64-svn-1.6.6.msiLanguagePack_1.6.6.17493-x64-ko.msi

----TortoiseSvn 은 소스 관리 툴입니다 .[TortoiseSvn 설치 후에 한국어 언어팩을 설치합니다 .]

Page 7: 3ds maxscript 튜토리얼_20151206_서진택

TortoiseSvn.Diff Viewer

[] External ProgramsDiff Viewer 를 설정합니다 .Diff Viewer 로 Beyond Compare 를 설정합니다 .Diff Viewer 의 위쪽과 아래쪽 창에 다음과 같이 입력합니다 ."C:\Program Files (x86)\Beyond Compare 3\BCompare.exe" /fv /leftreadonly %base %mine /title1=%bname /title2=%yname"C:\Program Files (x86)\Beyond Compare 3\BCompare.exe" /fv /leftreadonly %base %mine /title1=%bname /title2=%yname

Page 8: 3ds maxscript 튜토리얼_20151206_서진택

TortoiseSvn.Merge Tool

[] External Programs Merge Tool 을 설정합니다 ."C:\Program Files (x86)\Beyond Compare 3\BCompare.exe" %mine %theirs %base %merged /title1=%yname /title2=%tname% /title3=%bname% /title4=%mname%

Page 9: 3ds maxscript 튜토리얼_20151206_서진택

[] Notepad++ 에 MaxScript 자동완성 기능을 추가합니다 .MaxScript.xml 파일을 Notepad++ 이 설치된 폴더의 plugins\APIs\ 폴더에 복사합니다 .

Notepad++_MaxScript-1.0 설치

Page 10: 3ds maxscript 튜토리얼_20151206_서진택

[] Notepad++ 에 MaxScript 문법 강조 기능을 추가합니다 .(1) (2) UserDefinedLang.xml 을 User Application Data 폴더의 Roaming\Notepad++\ 폴더에 복사합니다 .

Page 11: 3ds maxscript 튜토리얼_20151206_서진택

첨부된 test_ExternalMaxscriptIDE.ms 파일을 열어서 문법 강조가 되는지 확인합니다 .

(1) Create 라고 입력한 상태에서 Ctrl + Space 를 누르면 아래 그림처럼 후보 리스트가 표시되어야 합니다 .

Page 12: 3ds maxscript 튜토리얼_20151206_서진택

Svn 으로 버전 관리

Notepad++ Tortoise Svn addin 을 설치하면 소스 파일의 버전 관리를 할 수 있습니다 .

12

Page 13: 3ds maxscript 튜토리얼_20151206_서진택

MaxScript Listener 는 스크립트의 실행 결과를 출력합니다 .

MaxScript Editor 는 스크립트를 편집하고 실행할 수 있습니다 .

3dsMax 20113dsMax 2011

Page 14: 3ds maxscript 튜토리얼_20151206_서진택

14

MaxScript Listener 는 스크립트의 실행 결과를 출력합니다 .

MaxScript Editor 는 스크립트를 편집하고 실행할 수 있습니다 .

3dsMax 93dsMax 9

Page 15: 3ds maxscript 튜토리얼_20151206_서진택

맥스 스크립트 실행

15

Page 16: 3ds maxscript 튜토리얼_20151206_서진택

16

Page 17: 3ds maxscript 튜토리얼_20151206_서진택

MAX SCRIPT 실습 : 변수 , 문장 , 대입 , 함수

17

Page 18: 3ds maxscript 튜토리얼_20151206_서진택

사칙연산 , 문장 , 문자열 , 변수@ 사칙연산 arithmetic 2 + 3 2 ^ 3 2 * 3 2 / 3@ 문장 statement 의 구분 2 + 3; 3 + 4@ 문자열 string "hello"@ 배열 array #()@ 변수 variable 및 할당 assignment a = "Hello" a + "World"

18

Page 19: 3ds maxscript 튜토리얼_20151206_서진택

할당 assignment 의 의미 , 함수 function@ x = x + 1 의 의미 x += 1@ 상수 constant pi@ 함수 function function f x = ( return x ^ 2 + x )

19

Page 20: 3ds maxscript 튜토리얼_20151206_서진택

함수 cont.@ 함수 function function f x y = ( return x ^ 2 + y )f( 2 4 )-- Argument count error: f wanted 2, got 1f(2) 48

20

Page 21: 3ds maxscript 튜토리얼_20151206_서진택

함수 cont.@ 함수 : 이름 명시 파라미터 named parameterfunction f x:0 y:0 =( return x ^ 2 + y)f()f x:2 y:48f y:4 x:28@ 미리 정의된 함수 predefined function

21

Page 22: 3ds maxscript 튜토리얼_20151206_서진택

함수 cont. 삼각함수

22

Page 23: 3ds maxscript 튜토리얼_20151206_서진택

다음주는 논리 연산자 logical operator 와 제어문 control statement 에 대해서 합니다 .

23

Page 24: 3ds maxscript 튜토리얼_20151206_서진택

3dsMax Script :02. 제어문이해하기

2014 년 4 월 16 일[email protected]

Page 25: 3ds maxscript 튜토리얼_20151206_서진택

발표순서 배열 array, name value 논리연산자 logical operator 조건문 if 반복문 for 반복문 do while 조건문 case

25

Page 26: 3ds maxscript 튜토리얼_20151206_서진택

지난주 복습

26

Page 27: 3ds maxscript 튜토리얼_20151206_서진택

함수@ 함수 function function f x y = ( return x ^ 2 + y )f( 2 4 )-- Argument count error: f wanted 2, got 1f(2) 48

27

Page 28: 3ds maxscript 튜토리얼_20151206_서진택

배열 arraya = #( 1, 3, 5 )a[1]a[4]

name valueb = #Hello

28

Page 29: 3ds maxscript 튜토리얼_20151206_서진택

논리 연산자 LOGICAL OPERATOR

29

Page 30: 3ds maxscript 튜토리얼_20151206_서진택

논리연산자 logical operator == equal to != not equal to > greater than >= greater than or equal to < less than <= less than or equal to

30

Page 31: 3ds maxscript 튜토리얼_20151206_서진택

조건문 IF조건을 판단합니다 .

31

Page 32: 3ds maxscript 튜토리얼_20151206_서진택

a = 1if a == 1 then messageBox "Hello"

if a == 1 do messageBox "Hello"

32

Page 33: 3ds maxscript 튜토리얼_20151206_서진택

a = 0if a == 1 then( messageBox "Hello" messageBox "Hello2")else( messageBox "World")

33

Page 34: 3ds maxscript 튜토리얼_20151206_서진택

반복문 FOR

34

Page 35: 3ds maxscript 튜토리얼_20151206_서진택

for i = 1 to 10 do( print "*")

35

Page 36: 3ds maxscript 튜토리얼_20151206_서진택

s = 0for i = 1 to 10 do( s += i)messageBox ( s as string )

36

Page 37: 3ds maxscript 튜토리얼_20151206_서진택

s = 0for i = 1 to 10 by 2 do( s += i)messageBox ( s as string )

37

Page 38: 3ds maxscript 튜토리얼_20151206_서진택

data = #( 1, 3, 5 )s = 0for i in data do( s += i)messageBox ( s as string )

38

Page 39: 3ds maxscript 튜토리얼_20151206_서진택

s = ""for i = 1 to 10 do( s = "" for j = 1 to i do

(s += "*"

)print s

)39

Page 40: 3ds maxscript 튜토리얼_20151206_서진택

반복문 WHILE, DO

40

Page 41: 3ds maxscript 튜토리얼_20151206_서진택

s = 0i = 1while i <= 10 do( s += i i += 2)messageBox ( s as string )

41

Page 42: 3ds maxscript 튜토리얼_20151206_서진택

s = 0i = 1do( s += i i += 2) while i <= 10messageBox ( s as string )

42

Page 43: 3ds maxscript 튜토리얼_20151206_서진택

i = 1while i <= 10 do( if i == 5 do ( i += 1 continue ) s = "" for j = 1 to i do ( s += "*" ) print s i += 1)

43

Page 44: 3ds maxscript 튜토리얼_20151206_서진택

조건문 CASE

44

Page 45: 3ds maxscript 튜토리얼_20151206_서진택

a = 2case a of( 1 : a += 10 2 : a += 100 default : a += 1)

45

Page 46: 3ds maxscript 튜토리얼_20151206_서진택

퀴즈

46

Page 47: 3ds maxscript 튜토리얼_20151206_서진택

퀴즈 . 아래와 같이 출력하는 스크립트를 작성하세요 ." *"" **"" ***"" ****"" *****"" ******"" *******"" ********"" *********"" **********"

47

Page 48: 3ds maxscript 튜토리얼_20151206_서진택

끝다음주는 클래스 class 와 객체 object 에 대해서 강의합니다 .

48

Page 49: 3ds maxscript 튜토리얼_20151206_서진택

3dsMax Script :03. 클래스와 인스턴스

2014 년 4 월 19 일[email protected]

Page 50: 3ds maxscript 튜토리얼_20151206_서진택

발표순서 클래스와 인스턴스 미리 정의된 클래스 미리 정의된 객체 Visual MaxScript 에디터

50

Page 51: 3ds maxscript 튜토리얼_20151206_서진택

지난주 복습

51

Page 52: 3ds maxscript 튜토리얼_20151206_서진택

배열 arraya = #( 1, 3, 5 )a[1]a[4]

name valueb = #Hello

52

Page 53: 3ds maxscript 튜토리얼_20151206_서진택

a = 0if a == 1 then( messageBox "Hello" messageBox "Hello2")else( messageBox "World")

53

Page 54: 3ds maxscript 튜토리얼_20151206_서진택

s = 0for i = 1 to 10 by 2 do( s += i)messageBox ( s as string )

54

Page 55: 3ds maxscript 튜토리얼_20151206_서진택

data = #( 1, 3, 5 )s = 0for i in data do( s += i)messageBox ( s as string )

55

Page 56: 3ds maxscript 튜토리얼_20151206_서진택

a = 2case a of( 1 : a += 10 2 : a += 100 default : a += 1)

56

Page 57: 3ds maxscript 튜토리얼_20151206_서진택

클래스 ( 구조체 STRUCTURE)투싼과 ' 홍길동이 가진 투싼 ' 의 차이점은 ?

57

Page 58: 3ds maxscript 튜토리얼_20151206_서진택

struct KPoint( x, y, z)a = KPoint()a.xa = KPointb = ac = b()

58

Page 59: 3ds maxscript 튜토리얼_20151206_서진택

a = KPoint()a = KPoint 1 3 5a = KPoint x:1 y:3 z:5

59

Page 60: 3ds maxscript 튜토리얼_20151206_서진택

struct KPoint( x, y, z, function Init x_ y_ z_ = ( x = x_ y = y_ z = z_ ), function Print = ( format "x = %, y = %, z = %\n" x y z ))

60

Page 61: 3ds maxscript 튜토리얼_20151206_서진택

미리 정의된 클래스

61

Page 62: 3ds maxscript 튜토리얼_20151206_서진택

a = box() a.width a.width = 10 move a [10,10,10]

setCommandPanelTaskMode #modifyselect a

uvwmod = Unwrap_UVW() addModifier a uvwmod

62

Page 63: 3ds maxscript 튜토리얼_20151206_서진택

미리 정의된 객체

63

Page 64: 3ds maxscript 튜토리얼_20151206_서진택

if selection.count == 1 then( setCommandPanelTaskMode #modify uvwmod = Unwrap_UVW() addModifier $ uvwmod uvwmod.edit())

64

Page 65: 3ds maxscript 튜토리얼_20151206_서진택

65

Page 66: 3ds maxscript 튜토리얼_20151206_서진택

퀴즈 오브젝트와 인스턴스의 차이점은 ?

– 오브젝트 Object(== 객체 )– 인스턴스 instance

66

Page 67: 3ds maxscript 튜토리얼_20151206_서진택

Visual MaxScript Editor

67

Page 68: 3ds maxscript 튜토리얼_20151206_서진택

68

Page 69: 3ds maxscript 튜토리얼_20151206_서진택

rollout unnamedRollout "Untitled" width:162 height:300(

button btn1 "Add Unwrap Uvw" pos:[20,19] width:118 height:36 on btn1 pressed do ( if selection.count == 1 then ( setCommandPanelTaskMode #modify uvwmod = Unwrap_UVW() addModifier $ uvwmod uvwmod.edit() ) ))

CreateDialog unnamedRollout

69

Page 70: 3ds maxscript 튜토리얼_20151206_서진택

끝다음주는 ( 내용을 작성할 것 ).

70

Page 71: 3ds maxscript 튜토리얼_20151206_서진택

3dsMax Script :04. HowTo 준비

2014 년 5 월 12 일[email protected]

Page 72: 3ds maxscript 튜토리얼_20151206_서진택

발표순서 벡터 버텍스 위치와 벡터 두개의 벡터가 이루는 각 구하기 세개의 버텍스가 이루는 각 구하기 스크립트 유틸리티 판넬 실습숙제

72

Page 73: 3ds maxscript 튜토리얼_20151206_서진택

지난주 복습

73

Page 74: 3ds maxscript 튜토리얼_20151206_서진택

struct KPoint( x, y, z, function Init x_ y_ z_ = ( x = x_ y = y_ z = z_ ), function Print = ( format "x = %, y = %, z = %\n" x y z ))

74

Page 75: 3ds maxscript 튜토리얼_20151206_서진택

rollout unnamedRollout "Untitled" width:162 height:300(

button btn1 "Add Unwrap Uvw" pos:[20,19] width:118 height:36 on btn1 pressed do ( if selection.count == 1 then ( setCommandPanelTaskMode #modify uvwmod = Unwrap_UVW() addModifier $ uvwmod uvwmod.edit() ) ))

CreateDialog unnamedRollout

75

Page 76: 3ds maxscript 튜토리얼_20151206_서진택

벡터 Vector

76

Page 77: 3ds maxscript 튜토리얼_20151206_서진택

축 axis, 벡터 vector, 벡터의 더하기 addition

77

Page 78: 3ds maxscript 튜토리얼_20151206_서진택

벡터의 빼기 subtraction

78

Page 79: 3ds maxscript 튜토리얼_20151206_서진택

벡터에 스칼라 scalar 곱하기 , 나누기

79

Page 80: 3ds maxscript 튜토리얼_20151206_서진택

벡터의 길이 length 와 방향 direction

80

Page 81: 3ds maxscript 튜토리얼_20151206_서진택

버텍스 VERTEX 위치 POSITION 에서 벡터 구하기

81

Page 82: 3ds maxscript 튜토리얼_20151206_서진택

82

Page 83: 3ds maxscript 튜토리얼_20151206_서진택

83

Page 84: 3ds maxscript 튜토리얼_20151206_서진택

84

Page 85: 3ds maxscript 튜토리얼_20151206_서진택

85

Page 86: 3ds maxscript 튜토리얼_20151206_서진택

두 벡터의 각 구하기

86

Page 87: 3ds maxscript 튜토리얼_20151206_서진택

벡터의 내적 inner product– dot

역함수– F(x) = x + 1– G(x) = x – 1

cos 의 역함수– acos

87

Page 88: 3ds maxscript 튜토리얼_20151206_서진택

두 벡터의 각 degree 구하기fn GetVectorsAngle v1 v2 =( theAngle = acos(dot (normalize v1) (normalize v2)))GetVectorsAngle [10,0,0] [10,20,0]63.435

외적 cross productcross <point3> <point3>

88

Page 89: 3ds maxscript 튜토리얼_20151206_서진택

3 개의 버텍스 VERTEX 가 이루는 각 구하기

89

Page 90: 3ds maxscript 튜토리얼_20151206_서진택

90

Page 91: 3ds maxscript 튜토리얼_20151206_서진택

91

Page 92: 3ds maxscript 튜토리얼_20151206_서진택

92

Page 93: 3ds maxscript 튜토리얼_20151206_서진택

스크립트 UTILITY 판넬 PANEL

93

Page 94: 3ds maxscript 튜토리얼_20151206_서진택

스크립트 utility 판넬

94

Page 95: 3ds maxscript 튜토리얼_20151206_서진택

utility spread "Spread objects" -- define the utility name and description string( local last_amt = 0 -- define and initialize local variable checkbox x "Spread in x" -- create 3 checkboxes checkbox y "Spread in y" checkbox z "Spread in z" spinner spread "Spread amount:" range:[-1000,1000,0] -- create a spinner on spread changed amt do -- when spinner value changes... ( delta = amt - last_amt -- calculate difference in current and previous for obj in selection do -- values for each selected object ( -- calculate new position based on current position and selection center p = obj.pos + normalize (obj.pos - selection.center) * delta if x.checked then obj.pos.x = p.x if y.checked then obj.pos.y = p.y if z.checked then obj.pos.z = p.z ) last_amt = amt -- store spinner value as previous value ) -- end of "on spread changed") -- end of utility definition

95

Page 96: 3ds maxscript 튜토리얼_20151206_서진택

실습 숙제 이미지를 읽어서 각 필셀을 박스로 만드는 스크립트입니다 . 박스의 x, y 와 z 크기를 spinner 로 받도록 추가합니다 . 스크립트의 기능에 대한 설명문을 작성합니다 .

96

Page 97: 3ds maxscript 튜토리얼_20151206_서진택

rollout testRollout "Test" width:162 height:300( button btnHello "Hello" pos:[21,24] width:111 height:24 progressbar doitProgress color:red on btnHello pressed Do ( local new_bmp = getOpenFileName caption:"Select Texture" filename:"*.png" if new_bmp != undefined then ( local bitmapSource = openBitmap new_bmp for iHeight = 1 to bitmapSource.height Do ( doitProgress.value = 100. * iHeight / bitmapSource.height for iWidth = 1 to bitmapSource.width do ( local pixels = getPixels bitmapSource [iWidth-1, iHeight-1] 1 local pixel = pixels[1]

)--for )--for )--if )--on btnHello pressed Do)

97

Page 98: 3ds maxscript 튜토리얼_20151206_서진택

for 문의 내부 if 문 for iWidth = 1 to bitmapSource.width do ( local pixels = getPixels bitmapSource [iWidth-1, iHeight-1] 1 local pixel = pixels[1]

if pixel.r < 255 then ( local x = iWidth local y = bitmapSource.height - iHeight + 1 local b = box width:1 height:1 length:1 b.pos = [x, y, 0] b.wirecolor = [pixel.r, pixel.g, pixel.b] )--if )--for

98

Page 99: 3ds maxscript 튜토리얼_20151206_서진택

끝다음주는 팀별 응용 사례를 발표합니다 .

99

Page 100: 3ds maxscript 튜토리얼_20151206_서진택

3dsMax Script :05. 팀에서 활용하기

2014 년 5 월 19 일[email protected]

Page 101: 3ds maxscript 튜토리얼_20151206_서진택

발표순서 Hero 팀 축 토글 작업 Gc 팀 Biped 설정 작업

– 매크로 유틸리티 등록 /제거

Ods 팀 텍스쳐 아틀라스 작업

101

Page 102: 3ds maxscript 튜토리얼_20151206_서진택

지난주 복습 :버텍스 vertex 위치 position 에서 벡터 구하기

102

Page 103: 3ds maxscript 튜토리얼_20151206_서진택

103

Page 104: 3ds maxscript 튜토리얼_20151206_서진택

두 벡터의 각 degree 구하기fn GetVectorsAngle v1 v2 =( theAngle = acos(dot (normalize v1) (normalize v2)))GetVectorsAngle [10,0,0] [10,20,0]63.435

104

Page 105: 3ds maxscript 튜토리얼_20151206_서진택

Hero 팀 : 축 axis 토글하기

105

Page 106: 3ds maxscript 튜토리얼_20151206_서진택

rollout unnamedRollout "Untitled" width:162 height:300( button btnHello "Hello" pos:[21,24] width:111 height:24 on btnHello pressed Do ( varAxis = getRefCoordSys()

if varAxis == #World or varAxis == #Hybrid then (toolMode.coordsys #Local) else if varAxis == #Local then (toolMode.coordsys #View) ))

CreateDialog unnamedRollout

106

Page 107: 3ds maxscript 튜토리얼_20151206_서진택

Gc 팀 : Biped 설정 작업

107

Page 108: 3ds maxscript 튜토리얼_20151206_서진택

작업 과정1> 화면에 있는 Biped 를 모두 선택한다 .: Edit - Select by ? Name: Select Object 창에서 ‘ Bip’ 입력후 Seclct 클릭

108

Page 109: 3ds maxscript 튜토리얼_20151206_서진택

2> Motion 패널의 Convert to Footsteps 를 선택 , 이후 Generate a keyFrame per Frame 을 체크한 후 OK 를 누른다 .(Flatten Footsteps to Z = 0 은 체크되지 않아야 한다 .)

109

Page 110: 3ds maxscript 튜토리얼_20151206_서진택

3> TimeLine 에 놓여신 키프레임들을 선택한 후 1 프레임 뒤로 이동시켜준다 . = 0 프레임부터 배치된 키프레임을 1 프레임으로 이동시켜준다 .( 선택된 키프레임은 하얀색으로 변경됨 )

110

Page 111: 3ds maxscript 튜토리얼_20151206_서진택

4> Motion 패널 ? Biped 탭의 Figure Mode 선택 5> Copy/Paste 탭의 Create Collection ? Pose ? Copy Posture ? Pose 를 순서대로 클릭

6> Motion 패널 ? Biped 탭의 Figure Mode 선택 ( 한번더 선택하면 피규어모드가 비 활성화 된다 .)

111

Page 112: 3ds maxscript 튜토리얼_20151206_서진택

7> 타임라인을 0 프레임으로 이동시킨다 .

8> 우측 하단의 Auto Key 를 활성화 시켜준다 .

112

Page 113: 3ds maxscript 튜토리얼_20151206_서진택

8> Copy/Paste 탭의 Paste Option 에서 Paste Horizontal/ Paste Vertical/ Paste Rotation 을 활성화 시키고 Paste Pose 를 선택한다 .

113

Page 114: 3ds maxscript 튜토리얼_20151206_서진택

구현 과정 ---------------------------------------------------------------------------------------------------- -- 1 화면에 있는 biped 를 모두 선택한다 . -- -- 먼저 bip 로 시작하는 모든 객체들을 선택한다 . --MessageBox "select all biped objects" a = select $bip*

114

Page 115: 3ds maxscript 튜토리얼_20151206_서진택

---------------------------------------------------------------------------------------------------- -- 2 Motion 패널의 Convert to Footsteps 를 선택 , 이후 Generate a keyFrame per Frame 을 체크한 후 OK 를 누른다 . -- --MessageBox "generate key per frames" --setCommandPanelTaskMode #motion for obj in selection do with undo true ( local ctrl = obj.controller if ctrl != undefined then ( biped.convertToFootSteps ctrl keyPerFrame:true flattenToZ:false )--if )--for

115

Page 116: 3ds maxscript 튜토리얼_20151206_서진택

---------------------------------------------------------------------------------------------------- -- 3 TimeLine 에 놓여신 키프레임들을 선택한 후 1 프레임 뒤로 이동시켜준다 . -- = 0 프레임부터 배치된 키프레임을 1 프레임으로 이동시켜준다 . -- --MessageBox "insert time at 0 frame" for obj in selection do with undo true ( local ctrl = obj.controller if ctrl != undefined then ( if isProperty ctrl #figuremode == true then ( selectKeys ctrl insertTime ctrl 0 1 ) )--if )--for

116

Page 117: 3ds maxscript 튜토리얼_20151206_서진택

set animate on slidertime = 0 for obj in selection do with undo true ( local ctrl = obj.controller if ctrl != undefined then ( if isProperty ctrl #figuremode == true then ( --MessageBox obj.name ctrl.figuremode = true local numCopyCollection = biped.numCopyCollections ctrl local copyPoseName = "BipCopyPose" + (m_copyPoseCounter as string ) m_copyPoseCounter += 1 biped.createCopyCollection ctrl copyPoseName local copyCollection = biped.getCopyCollection ctrl ( numCopyCollection + 1 ) local copiedPose = biped.copyBipPose ctrl copyCollection #snapView ctrl.figuremode = false biped.pasteBipPose ctrl copiedPose false #pstdefault true true true false ) ) )--for

117

Page 118: 3ds maxscript 튜토리얼_20151206_서진택

매크로 유틸리티로 등록 /삭제

118

Page 119: 3ds maxscript 튜토리얼_20151206_서진택

119

Page 120: 3ds maxscript 튜토리얼_20151206_서진택

120

Page 121: 3ds maxscript 튜토리얼_20151206_서진택

ODS 팀 : 텍스쳐 아틀라스 ATLAS

121

Page 122: 3ds maxscript 튜토리얼_20151206_서진택

122

아틀라스 : 면 자르기 및 Uv 설정

(1) 과 같은 polygon face 의 uv face가 (2) 와 같이 [0,1] 의 범위를 벋어나는 경우 , 면을 추가합니다 .

Page 123: 3ds maxscript 튜토리얼_20151206_서진택

123

면을 자르고 Uv 를 normalize 합니다 .

uv 가 [0,1] 의 범위를 벗어나면 면을 추가합니다 .

새로운 면들과 기존 면들은 [0,1] 로 정규화합니다 .

Page 124: 3ds maxscript 튜토리얼_20151206_서진택

124

Texture Locator(C#) 텍스쳐 배치

정보를 편집하고 MaxScript 로 결과를 전달합니다 .

– MaxScript 로 Ui를 구현할 수 있습니다 .

– 하지만 구현 비용이 높아서 C# 으로 구현하고 Clipboard 를 이용하여 통신하기로 했습니다 .

Page 125: 3ds maxscript 튜토리얼_20151206_서진택

125

Invalid Face Breaker (1) 툴바에서 아이콘을

선택한다 . (2) 해당 면 정리 기능을

실행한다 .

Page 126: 3ds maxscript 튜토리얼_20151206_서진택

126

Page 127: 3ds maxscript 튜토리얼_20151206_서진택

끝5 회 강의동안 수고하셨습니다 .

127