PDA

View Full Version : LScript Commander (Basic)



devin
03-15-2003, 07:51 PM
Hi,

I've been given a scene file with hundreds of objects (mainly clones) that have been haphazardly placed in the Y within Layout. I've already modded the model files but now have to fix the scene. I'm trying to get them to all rest on the ground now at "0".

I thought I'd give LS Commander a try to speed things up but here's the prob.

I just want to move objects in the Y and not influence X and Z but I have no clue how to do that. I'm a programming flunky for sure.

Here's what I get...

generic
{
Position("<X>","<0>","<Z>");
}

Is there anything that I can place for X and Z to tell it to ignore moving these channels.

Maybe there is something easier to truly batch these items. I'd appreciate any info. I've already searched flay.

/devin

faulknermano
03-15-2003, 08:09 PM
LS Commander will not give you a 'run-through-selected-objects' functionality, though i think it should because it's so commonly needed.. here's what you can do.




@warnings
@script generic
generic
{
s = Scene().getSelect();
for(i=1;i<=s.size();i++)
{
pos = s.getPosition(Scene().currenttime);
SelectItem(s[i].id);
Position(s.x,0.0,s.z);
}
}




(i havent tested that code above, but i think it'll work.. and then some :D)

devin
03-15-2003, 08:24 PM
Thanks for the reply and the code. Unfortunately it's giving me an 'Unknown command "}" ' when I try to run it though.

I tried to move the "}" characters around a bit but since I know nothing about syntax, it didn't seem to help.

Thx again.

/devin

Lynx3d
03-15-2003, 09:46 PM
Hehe, you can't leave out the brackets here...
Donno what you did wrong...typo?

I just tried it and it gives me an "invalid object method getPosition()"
hm...confused. It for sure is a valid method...can only mean it has no object to use the method on?
But i never really use scripts, most i want to do needs the SDK anyway...so that's my toy at the moment.

faulknermano
03-16-2003, 04:37 AM
whooops! :D

hehehe..



@warnings
generic
{
s = Scene().getSelect();
for(i=1;i<=s.size();i++)
{
pos = s[i].getPosition(Scene().currenttime);
SelectItem(s[i].id);
Rotation(s[i].x,0.0,s[i].z);
}
}

devin
03-16-2003, 05:50 PM
I get the same error. I'm copying and pasting then hitting execute (in addition to saving it as a plug/script) but I must be doing something wrong.

Thx.

devin
03-16-2003, 06:01 PM
Update: I got it to work finally! Thanks faulknermano! I didn't realize that I could paste the code into a text file w/ a .ls extension which was suggested on cgtalk.

I really appreciate you taking the time out and envy your ability to wrap your head around programming. Thx again.

/devin