이벤트 처리기 재정의

사용자 정의 UI 특성에서 이벤트 처리기를 정의하여 MCG 도구의 추가 처리기를 만들 뿐만 아니라 생성된 이벤트 처리기를 재정의할 수 있습니다.

예를 들어 MCG 기반 제어기, 수정자 또는 형상 연산자를 3ds Max에서 적용하면 create 이벤트가 트리거된 다음 도구의 initialize() 함수를 호출합니다. 그래프를 평가하고 생성된 .ms 파일을 열면 다음과 같은 코드가 표시됩니다.

	on create do 
	(
	    initialize()
	)

이 코드를 확장하여 고유한 생성 논리를 추가하려면 사용자 정의 UI 특성에 다음을 입력할 수 있습니다.

-- Restore the default rollout
rollout params "Parameters"
(
<<ParamUIDefs>>
<<RolloutParamsHanders>>
)

-- Define your custom functions before they are called
fn myCustomSetup
(
    -- Add your code here
)

-- Override the create handler
on create do
(
    -- Initialise the plug-in
    initialize()

    -- Call your custom MAXScript
    myCustomSetup()
)

-- Define additional handlers
on postCreate do 
(
    -- Add your code here
)