Postby admin » Sun Jan 21, 2018 1:39 pm
Hi
To set the material of the first capture set, for the first pass, to (say) the active material in the medit, you can do:
mat = (medit.GetTopMtlSlot (medit.getActiveMtlSlot()))
capsets = #(1)
passes = #(1)
RPMCaptureProps.captureCapSetMaterial capsets passes mat
-- and to enable the 'on' checkbox:
for capset in capsets do
(
custAtt = custAttributes.get TrackViewNodes.RenderPassManager.rendermanager_captureSets (capset + 1)
dataArray = for j in custAtt.RMdataStor collect j
for pass in passes do
(
numbS = rpmdata.getUniqueFromIndex pass as string
indx = finditem dataArray numbS
custAtt.RMcapSetEnable[indx] = true
)
)
See if that works for you, if the UI is open it won't refresh with the code above. Though, if you have the UI open, it's a much simpler maxscript call for the active pass:
mat = (medit.GetTopMtlSlot (medit.getActiveMtlSlot()))
rpmdata.RPMObjProp.moAltMat.picked mat
which should both set the material and turn on the checkbox. If you pass undefined as the mat it'll clear it and turn off the checkbox.
cheers,
grant