LS Commander (Basic Q)

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  03 March 2003
LS Commander (Basic Q)

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
 
  03 March 2003
This is actuauly good, as lscript is somthing that is powerful yet underused. I'm just looking into lscript now as I've been doing a lot of scripting work on the game I'm working on.

I don't know the functions we need but this is probably how the logic should work:

//////////////////////////////////////////////////////
variable1 = objects current x pos;
variable2 = objects current z pos;

Position ( variable1, 0, variable2);

Select next object;
//////////////////////////////////////////////////////
Unless there is a SetPositionY function....

The way to do this without lscript would be to just select them all, open the grpah editor, hit shift-g to get all the curves, select only the y curves, select all the keyframes and type in 0 in the value field.

But i'd love CIM or CMAN or someone to chime in here on how one would do this script as I'd love to learn more myself.

Mike
__________________
My School: http://www.CAVEschool.com
The people I work for: http://www.theembassyvfx.com
My personal company: http://www.elementvfx.com

 
  03 March 2003
Isn't this something you could do in the spreadsheet editor? Just do a batch selection, select motion options and key in a value only on the y axis for all objects?
 
  03 March 2003
There are probably a lot of ways to do this, geditor, spreadsheet...... but I'm actually intersted in getting a discussion going on lscript....
__________________
My School: http://www.CAVEschool.com
The people I work for: http://www.theembassyvfx.com
My personal company: http://www.elementvfx.com

 
  03 March 2003
Basically, something like this would be decent:

generic
{
// Get selected
sel = Scene().getSelect() || error("Select Something!");
// Get currenttime
curTime = Scene().currenttime;

// Loop through selected
// Get position
// Select and set position
for(i = 1; i <= sel.size(); i++)
{
pos[i] = sel[i].getPosition(curTime);

SelectItem(sel[i].id);
Position(pos[i].x, 0, pos[i].z);
}
}
 
  03 March 2003
pos[i] has all the position numbers contained it in right? And you extract the one you want by adding a .x .y or .z at the end of it?

Cool.

for(i = 1; i <= sel.size(); i++)
{
}

this section runs whats in the squggle brackets once after running the top part each time... Which defines i, sets the for loop to stop once i is equal to the number of selected items, and then increments it once per loop... right?

Mike
__________________
My School: http://www.CAVEschool.com
The people I work for: http://www.theembassyvfx.com
My personal company: http://www.elementvfx.com

 
  03 March 2003
Works like a charm, thanks CIM!
__________________
"I have always wanted to be somebody, but I see now I should have been more specific."
 
  03 March 2003
This is off from the LScript discussion but Shade01 mentions batching the Y value in the spreadsheet. Am I missing something? I don't see any options for affecting the individual move/rot/scale channels.

I've been sucked into general new media work for awhile now and have been away from LW's newer tools but I do consult the manual and search a bit before posting. Plz excuse my loss at some of the new goodz!

/devin

PS - Thx for the help everyone.
 
  03 March 2003
I tried running the script provided by CIM btw and get an 'Unknown command "}" error every time.

Darn.
 
  03 March 2003
Very cool, CIM. LScript is still a huge mystery to me...maybe one of these days I'll really sit down and try to wrap my head around it.

@Devin: I ran it, and it works fine for me with 7.5. Are you running 7.5b by any chance? (I actually didn't use LS commander....I copy/pasted what CIM wrote into a plain text file, and saved it with a .ls extension. Then I just ran it by going to LScript->LScript Tools->LScript. Worked like a charm.)
__________________
Gregg Domain
Visual Effects Artist
www.greggdomain.com
--------------
Get Into Adobe After Effects

Last edited by Triple G : 03 March 2003 at 08:08 AM.
 
  03 March 2003
Quote: Originally posted by devin
This is off from the LScript discussion but Shade01 mentions batching the Y value in the spreadsheet. Am I missing something? I don't see any options for affecting the individual move/rot/scale channels.

I've been sucked into general new media work for awhile now and have been away from LW's newer tools but I do consult the manual and search a bit before posting. Plz excuse my loss at some of the new goodz!

/devin

PS - Thx for the help everyone.

Select all your objects in the scene editor.
Open the graph editor and hit shift g to throw every channel of every object into the channel bin. Use the filter function to filter out everything except the Y channels. Select all the Y channels and set them to zero.
 
  03 March 2003
Faulknermano posted this as a responce in the newtek board:

@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);
}
}


I'm trying to see the differences between that and yours CIM:

generic
{
sel = Scene().getSelect() || error("Select Something!");
curTime = Scene().currenttime;

for(i = 1; i <= sel.size(); i++)
{
pos[i] = sel[i].getPosition(curTime);

SelectItem(sel[i].id);
Position(pos[i].x, 0, pos[i].z);
}
}


The on ly thing i can see is that you put current time into a variable, Faulknermano didnt. Cool.
__________________
My School: http://www.CAVEschool.com
The people I work for: http://www.theembassyvfx.com
My personal company: http://www.elementvfx.com

 
  03 March 2003
He's setting the Y rotation to 0.
 
  03 March 2003
Interesting. But other than that they are very similar
__________________
My School: http://www.CAVEschool.com
The people I work for: http://www.theembassyvfx.com
My personal company: http://www.elementvfx.com

 
  03 March 2003
Got it now. Thx a mill for all your help everyone. Life is much easier with these boards and the good ppl on them.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 12:13 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.