ScriptSpot is a diverse online community of artists and developers who come together to find and share scripts that empower their creativity with 3ds Max. Our users come from all parts of the world and work in everything from visual effects to gaming, architecture, students or hobbyists.
Submitted by JokerMartini on Fri, 2010-11-19 12:36
I need a callback function that runs a "Function" on selection change. I am not familiar with callbacks yet and I would appreciate any help from the scriptspot community.
Thanks
JokerMartini
Hey Budi G thanks for the help.
I ended up figuring it out and using implementing them into a handful of scripts these past few days. They are great. Thanks.
now I will remove the update buttons and convert it to call back function.
rollout drop_roll "Drop Down List"(
local obj_array = #()
dropdownlist obj_dd "Objects :" offset:[0,-20] items:#()
fn update_objs =
(
obj_array = objects--as array
obj_dd.items = for i in obj_array collect i.name
)
on drop_roll open do(
update_objs()
callbacks.addScript #selectionSetChanged "drop_roll.update_objs()" id:#testcall -- register call back fn for automatically update the listbox when some object has been deleted or added)
on obj_dd selected i do select obj_array[i]
on drop_roll close do callbacks.removeScripts id:#testcall -- unregister call back scripts when closing the dialog)
createDialog drop_roll
Comments
Hey
Hey Budi G thanks for the help.
I ended up figuring it out and using implementing them into a handful of scripts these past few days. They are great. Thanks.
John Martini
Digital Artist
http://www.JokerMartini.com (new site)
first keep your mind on
first keep your mind on register callback fn ,
and after using it you need unregister callback fn.
check out the mxs reference for details.
I try to make one example:
in this forum I've made a script, there's the update buttons as manually update for user.
http://www.scriptspot.com/forums/3ds-max/general-scripting/dropdown-list...
now I will remove the update buttons and convert it to call back function.