Add functions to the script SimonScripts-VrayColorCorrect_V1

Hi, I try to add functions to this script (https://www.scriptspot.com/3ds-max/scripts/vraymtl-color-correction), but it doesn't work, help pls
....
local createColorCorrection = on
local matDiffArr = #()
local matTransArr = #()
local matBumpArr = #()
local matglossArr = #()
local matIllumArr = #()
local matOpacArr = #()
local trans = TranslcencyCheckbox.checked
local diff = DiffuseCheckbox.checked
local bump = BumpCheckbox.checked
local gloss = GlossinessCheckbox.checked
local selfillum = SelfIllumChekbox.checked
fn getmatArr curArr RenderMat texmap_Slot Slot_Color =
(
local createColorCorrection
for o in selection where o.material != undefined do
join curArr (getClassInstances RenderMat target:o.material)

makeUniqueArray curArr

for mat in curArr do
(
if mat.texmap_Slot != undefined and isKindOf mat.texmap_Slot Color_Correction do
(
createColorCorrection = off
exit
)
)---check for already existing ColorCorrect if it finds one it avoid add a new one

if createColorCorrection do
(
for mat in curArr do
(
local cc = Color_Correction ()
cc.color = mat.Slot_Color
newMat = copy mat
newMat.name = mat.name
newMat.texmap_Slot = copy cc

if newMat.texmap_Slot != undefined do
(
newMat.texmap_Slot.map = mat.texmap_Slot
newMat.texmap_Slot.saturation = Saturationval.value
newMat.texmap_Slot.hueShift = hueShiftval.value
newMat.texmap_Slot.gammaRGB = gammaRGBval.value
newMat.texmap_Slot.pivotRGB = pivotRGBval.value
newMat.texmap_Slot.liftRGB = liftRGBval.value
newMat.texmap_Slot.brightness = brightval.value
newMat.texmap_Slot.contrast = contrastval.value
(
if Invertrb.state == 1 then
(
newMat.texmap_Slot.rewireMode = 0
)
else
(
newMat.texmap_Slot.rewireMode = 2
)
)
(
if lightnessrb.state == 1 then
(
newMat.texmap_Slot.lightnessMode = 0
)
else
(
newMat.texmap_Slot.lightnessMode = 1
)
)
)

replaceInstances mat newMat
)
)

)

---------------------------------------------------Diffuse----------------------------—
if diff do
try ( with redraw off
getmatArr matDiffArr VrayMtl texmap_diffuse diffuse
redrawViews()
) catch()
createColorCorrection = on
....

Показать список оценивших

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
SimonBourgeois's picture

Hi

Hi,
what are the functions you'd like to add?
I have added some selection options and have rewritten the script it was one of my first script and was not very well written...
The new version is still messy but might be easier to modify, you can find it here:
http://www.scriptspot.com/3ds-max/scripts/vraymtl-color-correction

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.