EffectsChannelEx Setup

Below is an example of using functions that are added by plug-in EffectsChannelEx.

--
-- (c) Pavel Kuznetsov, 2012
-- www.lastjedioutpost.ru
--

macroScript MaterialIDChannel
category: "Medit Tools"
internalCategory: "Medit Tools"
ButtonText: "Material ID Channel"
tooltip: "Material Effects Channel ID"
(
rollout MatIDCh "Material ID Channel" width:160 height:80
(
spinner GBufID "ID" pos:[50,15] width:70 height:16 range:[0,255,0] type:#integer
button getIDButton "Get" pos:[15,45] width:60 height:20
button setIDButton "Set" pos:[85,45] width:60 height:20

on MatIDCh open do MatIDCh.GBufID.value = getEffectsChannel (medit.GetCurMtl())

on getIDButton pressed do MatIDCh.GBufID.value = getEffectsChannel (medit.GetCurMtl())

on setIDButton pressed do setEffectsChannel (medit.GetCurMtl()) MatIDCh.GBufID.value
)
on execute do createDialog MatIDCh

on isChecked do MatIDCh.GBufID.value = getEffectsChannel (medit.GetCurMtl())
)

Just save this script as MaterialIDChannel.mcr to a folder MacroScripts to ensure its automatic start (see the 3ds Max Help).

Then add to the menu "Medit - Material" command "Material Effects Channel ID" from the category "Medit Tools" (see the 3ds Max Help). Now the script is ready for use.