创建一个按钮,你可以单击它,然后添加一个新按钮。
你必须创建一个动态UI,使用maxscript UI元素,将卷展栏构建为字符串,然后评估该字符串并打开新的卷展栏以更新你的UI;使用RolloutCreator(请参阅帮助文件)帮助您构建卷展栏,并打开新的卷展栏以更新您的UI,看下面的示例:
global roll_buttons
global build_rolloutfn addAnotherButton = (roll_buttons_count += 1counter = roll_buttons_count as stringroll_buttons += "button btn_" + counter + " \"Button " + counter + "\"
"
)
roll_header = "rollout roll_test \"test\" (button btn_test \"点击我\"on btn_test pressed do (destroyDialog roll_testaddAnotherButton()createDialog (buildRollout()))
"
roll_footer = "