如何使用 maxscript 在 3ds Max 中切换 object/by 层?

How toggle by object/by layer in 3ds Max with maxscript?

我正在寻找在显示属性中切换对象的 "By Object"/"By Layer" 属性 的功能,特别是 "By Object"。我无法获得这里的任何功能 http://help.autodesk.com/view/3DSMAX/2015/ENU/?guid=__files_GUID_78B79975_7BA5_4A03_8FEF_27E78D14B575_htm 来做我想做的事。

提前致谢!

希望对您有所帮助

fn Display_ByObject_ByLayer node state: =
(
    if isValidNode node do node.displaybylayer = state
)
-- define first some object
cube = Box()
--try to display by object
Display_ByObject_ByLayer cube state:on
--try to display by layer
Display_ByObject_ByLayer cube state:off

或者您可以使用下一个进行选择

mapped fn Display_ByObject_ByLayer nodes state: =
(
    if isValidNode nodes do node.displaybylayer = state
)
--now you can test it
if selection.count > 0 do Display_ByObject_ByLayer (selection as array) state:off