DannyBoy3
11-30-2011, 09:42 PM
Hi. I am having trouble with the button event handler part of this code. It yields either a "expected while' or 'expected factor', or it throws a ' no get function for undefined', no matter what combination I use of string, do loop, etc.. Any help would be much appreciated,
ctrlcentre = circle radius:5
rotate ctrlcentre (angleaxis -91 [1,0,0])
morphs_used =#("up","down","turnaround")
addmodifier ctrlcentre (EmptyModifier ())
attdeff = ""
attStr = ""
attStr += "attdef = attributes facialctrl\n"
attStr += "(\n"
attStr += " parameters facialctrl rollout:Weights \n"
attStr += " (\n"
for i = 1 to morphs_used.count do
(
attStr += " " + morphs_used[i] + " type:#float ui: "+ morphs_used[i] as string+"Sl \n"
)
attStr += " )\n"
attStr += "rollout Weights \"Weights\" \n"
attStr += "("
attStr += " local range=[-2.00,2.00,1.00]\n"
attStr += "group \"Upper Left Position\" (\n"
for j = 1 to morphs_used.count do (
attStr += " slider "+ morphs_used[j] + "Sl \""+ morphs_used[j] + "\" range:range ; \n"
)
attStr += ")\n"
attStr += "group \"Upper Right Position\" (\n"
attStr += "button resetAll \"Reset All\" \n"
attStr += "on resetAll pressed " do ( for k = 1 to morphs_used.count do (
attStr+=" ctrlcentre.modifiers[#Attribute_Holder].custAttributes[1][k].value = 1.0\n" ;
)
)
attStr += " )\n"
attStr += " )"
attdeff = execute attStr
custAttributes.add ctrlcentre.modifiers[1] attdeff
ctrlcentre = circle radius:5
rotate ctrlcentre (angleaxis -91 [1,0,0])
morphs_used =#("up","down","turnaround")
addmodifier ctrlcentre (EmptyModifier ())
attdeff = ""
attStr = ""
attStr += "attdef = attributes facialctrl\n"
attStr += "(\n"
attStr += " parameters facialctrl rollout:Weights \n"
attStr += " (\n"
for i = 1 to morphs_used.count do
(
attStr += " " + morphs_used[i] + " type:#float ui: "+ morphs_used[i] as string+"Sl \n"
)
attStr += " )\n"
attStr += "rollout Weights \"Weights\" \n"
attStr += "("
attStr += " local range=[-2.00,2.00,1.00]\n"
attStr += "group \"Upper Left Position\" (\n"
for j = 1 to morphs_used.count do (
attStr += " slider "+ morphs_used[j] + "Sl \""+ morphs_used[j] + "\" range:range ; \n"
)
attStr += ")\n"
attStr += "group \"Upper Right Position\" (\n"
attStr += "button resetAll \"Reset All\" \n"
attStr += "on resetAll pressed " do ( for k = 1 to morphs_used.count do (
attStr+=" ctrlcentre.modifiers[#Attribute_Holder].custAttributes[1][k].value = 1.0\n" ;
)
)
attStr += " )\n"
attStr += " )"
attdeff = execute attStr
custAttributes.add ctrlcentre.modifiers[1] attdeff
