nick
03-11-2006, 11:53 PM
Hey guys got a small lscript problem. this is my first lscript (i know a good bit of mel script which is probably why im blind to this problem but im most probably just being daft) Anyway I keep getting this
"invalid argument 1 type to ExcludeLight()"
when i run my script, i just cant see whats wrong with it. Ive checked the result of variable and it makes sense that it should work but it doesnt. Any ideas ?
@warnings
@name "lightswitch2"
@script generic
//nicholas pliatsikas
generic
{
L1 = nil;
L2 = false;
reqbegin("My Requester");
reqsize(299,98);
a1 = ctllightitems("LightItems",L1);
ctlposition(a1,0,39,242,23);
c2 = ctlcheckbox("Exclude_invert",L2);
ctlposition(c2,164,5,106,22);
c3 = ctltext("","select objects to be effected");
ctlposition(c3,13,10,134,13);
s1 = ctlsep(0,-1);
ctlposition(s1,0,33,668,5);
return if !reqpost();
lightName = getvalue(a1);
L2 = getvalue(c2);
reqend();
myscene = Scene();
myobjects = myscene.getSelect();
arraysize = size(myobjects);
for(x = 1; x <= arraysize; x++)
{
itemname = myobjects[x].name;
SelectItem(itemname);
ExcludeLight (lightName);
}
}
Thanks in advance
Nick
"invalid argument 1 type to ExcludeLight()"
when i run my script, i just cant see whats wrong with it. Ive checked the result of variable and it makes sense that it should work but it doesnt. Any ideas ?
@warnings
@name "lightswitch2"
@script generic
//nicholas pliatsikas
generic
{
L1 = nil;
L2 = false;
reqbegin("My Requester");
reqsize(299,98);
a1 = ctllightitems("LightItems",L1);
ctlposition(a1,0,39,242,23);
c2 = ctlcheckbox("Exclude_invert",L2);
ctlposition(c2,164,5,106,22);
c3 = ctltext("","select objects to be effected");
ctlposition(c3,13,10,134,13);
s1 = ctlsep(0,-1);
ctlposition(s1,0,33,668,5);
return if !reqpost();
lightName = getvalue(a1);
L2 = getvalue(c2);
reqend();
myscene = Scene();
myobjects = myscene.getSelect();
arraysize = size(myobjects);
for(x = 1; x <= arraysize; x++)
{
itemname = myobjects[x].name;
SelectItem(itemname);
ExcludeLight (lightName);
}
}
Thanks in advance
Nick
