Notifications
Clear all

[Closed] editText text instead of modifier name maxscript

hey guys, I was trying something the other day and I couldn’t make it work, so i thought i’d ask here as I am a bit stuck wih it.
Lets say I have a GUI for a script i made, this has an editText, in it you are suposed to type the name of the morpher in which you want the script to affect, so lets say I have object A, with a morpher on it called THEMORPH and with another morpher on it called THEOTHERMORPH,
now on the editText entry I type the name of the morpher that i want to affect with the script, so i have something like that:


myobject = $A
myMorph = editText.text
WM3_MC_BuildFromNode myObject.myMorph 1 $teapot01


so THAT wouldn’t work, but if I type the actual name of the morph instead of the one in the edittext, works…


myobject = $A
WM3_MC_BuildFromNode myObject.THEMORPH 1 $teapot01

any idea how i could assignt the text on an editText instead of calling the actual name of the modifier?

thanks!

4 Replies
myobject = $A
myMorph = editText.text
WM3_MC_BuildFromNode myObject.modifiers[ myMorph ] 1 $teapot01

this should work

hey thanks so much for the quick reply, I’ll try that!

thanks again

 lo1

Wouldn’t your user prefer to select the morpher name from a dropdownlist, rather than have to type it in?

hah, i didn’t think of that!
thanks for the suggestion!