Hello,
I’m writing a simple script that is adding a colorcorrection nodes before nodes in diffuse slot for all materials of objects selected. I am trying to connect these colorcorrection nodes with bezier_float controllers. I managed to create the cc nodes correctly and create the bezier_float nodes, but I’m unable to connect them to the cc nodes.
Here is the code I have so far:
mats_col = #()
for o in selection where o.material != undefined do
join mats_col (getClassInstances VRayMtl target:o.material)
makeUniqueArray mats_col
av = sme.ActiveView
SelView = sme.GetView sme.ActiveView
HueCtrl = bezier_float()
HueCtrlNode = SelView.CreateNode HueCtrl [10,10]
HueCtrlNode.name = “HueShiftCTRL”
SatCtrl = bezier_float()
SatCtrlNode = SelView.CreateNode SatCtrl [10,10]
SatCtrlNode.name = “SaturationCTRL”
GainCtrl = bezier_float()
GainCtrlNode = SelView.CreateNode GainCtrl [10,10]
GainCtrlNode.name = “GainCTRL”
GammaCtrl = bezier_float()
GammaCtrlNode = SelView.CreateNode GammaCtrl [10,10]
GammaCtrlNode.name = “GammaCTRL”
for mymat in mats_col do
(
if mymat.texmap_diffuse != undefined then
(
mymap = mymat.texmap_diffuse
ccnode = ColorCorrection()
ccnode.Map = mymap
ccnode.lightnessMode = 1
mymat.texmap_diffuse = ccnode
)
else print “nothing in diffuse slot”
)
I tried to add rootScene[#SME][av][ccnode].SMENodeAttr.reference.hueShift = ?? but didn't work