Very beginner at MAXScript, can't get matchPattern to work
EDIT: by trial and errors (so many errors....) i made it work! thanks anyway
I'm doing a few exercise in maxscript to get the handle of it and i'm trying to modify objects depending on their name. I write my pattern in a Edittext box and i want it to compare with objects in my scene. I managed to have my objects change if i wrote my pattern directly in my script but i can't get it to work with the text i write in my Edittext.
Here is my function to matchpattern and replace the objects
on RecastFromPattern pressed do
--select all the objects on the scene
for i = 1 to selection.count do
--will do this function as many times as there are objects
if (matchPattern selection[i] pattern:"Pattern") then
--will verify the name of each objects and compare it with what was written in the Edittextt box and saved in the variable "Pattern"
instanceReplace selection[i] ThePickMaster
--if there is a match it will replace the object of that number of the count with the object previously selected by the pickbutton and saved in the variable ThePickMaster
Can anyone tell me what i'm doing wrong with matchpattern???