Using maxscript to turn material Backface culling property on/off

Hey Guy’s,
Sorry for late reply.
Yes, you can change the value using the MaxScript.
The Babylon Attributes is a standard 3DSMax Custom Attribute.
here a small example

-- get the material selected into the view : you may change this to select all the material from the scene
n = SME.GetMtlinParamEditor()
-- access the babylon attributes
att = n.custAttributes["Babylon Attributes"]
-- optional show all the availables properties
showProperties att
-- change the value to desired one
att.babylonBackfaceCulling = true

A more complex one, which select all the material should be

/* script work only when Slate Material Editor is open */
if sme.IsOpen() == false then (
  sme.Open()
) 
/* select all nodes */
viewNode = sme.GetView (sme.activeView)
viewNode.SelectAll()
n = viewNode.GetSelectedNodes()
l = n.count
/* foreach node, test if a babylon custom attribute is present. */
for i = 1 to l do ( 
   att = n[i].reference.custAttributes["Babylon Attributes"]; 
   if att != undefined then( 
       att.babylonBackfaceCulling = true
   )
)
1 Like