Message 1 of 10
A question about MAXScript
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I want to implement a functionality where, in the currently active SME view, I search for all VRayMtl nodes. If found, I check if the node connected to the diffuseMap port is a VRayBitmap. If it is, I modify coords.blur to 0.01. If not, I traverse all output ports of the material until I find a VRayBitmap and set its coords.blur to 0.1. Below is my code, but I don't know why it's throwing errors.
function setVRayBitmap m =
(
diffuseMap = m.diffuseMap
if isKindOf diffuseMap VRayBitmap do
(
diffuseMap.coords.blur = 0.01
)
if not isKindOf diffuseMap VRayBitmap do
(
for i = 1 to m.numOutputs() do
(
outputMap = m.getOutputMap i
if isKindOf outputMap VRayBitmap do
(
outputMap.coords.blur = 0.01
return
)
)
)
)
function SMEGetMatsInView =
(
viewNode = sme.GetView (sme.activeView)
for n = 1 to trackViewNodes[#sme][(sme.activeView)].numSubs do
(
m = trackViewNodes[#sme][(sme.activeView)][n].reference
if classOf m == VRayMtl do
(
setVRayBitmap m
)
)
)
SMEGetMatsInView()