PDA

View Full Version : Lscript Add Channel



dev2000
02-12-2009, 05:03 PM
Hi. I have a couple of Lscript questions that I am struggling with:


How can I add a new channel, such as "Intensity" to an object or light? Does it have anything to do with Envelope() or AddEnvelope()?


Is there a way to directly access an object channel by name, instead of cycling through each channel with firstChannel() and nextChannel()?


If I add a new object with:

AddPointLight("NewLight");

How can I make this the "currently selected object" or "object of interest" within lscript so I can then dig into the channels? Sorry, I'm fuzzy on how to select and work with objects in lscript.


I wish I could find these answers in the Lscript Guide or Reference! If there are any good lscript resources or tutorials with examples I would love to know about them!


Thanks!

walfridson
02-12-2009, 11:28 PM
Should take a look at the lscript master - Mike Greens springy script
http://www.mikegreen.name/Lscripts.html

It makes use of a custom envelope.

adamredwoods
02-13-2009, 11:27 AM
If I add a new object with:

AddPointLight("NewLight");

How can I make this the "currently selected object" or "object of interest" within lscript so I can then dig into the channels? Sorry, I'm fuzzy on how to select and work with objects in lscript.


You need to issue the command "SelectItem (item.id)"
The newest added object id is usually the first on the stack so you can use " item = Light(); ". (i think...)

adamredwoods
02-13-2009, 11:29 AM
Hi. I have a couple of Lscript questions that I am struggling with:


How can I add a new channel, such as "Intensity" to an object or light? Does it have anything to do with Envelope() or AddEnvelope()?


Yes. If you want it avaiable after the script ends, make sure to use "persist(true)" method.




Is there a way to directly access an object channel by name, instead of cycling through each channel with firstChannel() and nextChannel()?

No.
There may be helper lscript functions, or create your own.