MCG ツールで生成したイベント ハンドラは、カスタム UIプロパティでそれらを定義することにより、上書きしたり、追加のハンドラを作成することができます。
たとえば、MCG ベースのコントローラ、モディファイヤ、またはジオメトリ オペレータが 3ds Max に適用されると、create イベントがトリガされ、それによりツールの initialize() 関数が呼び出されます。グラフを評価し、 .ms ファイルを開くと、次のコードが示されます。
on create do ( initialize() )
これを拡張して独自の作成ロジックを追加する場合は、カスタム UI プロパティに次のように入力します。
-- Restore the default rollout
rollout params "Parameters"
(
<<ParamUIDefs>>
<<RolloutParamsHandlers>>
)
-- 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
)