PDA

View Full Version : Can someone try this? (Lscript related)


adrencg
03-06-2006, 07:17 PM
I'm trying to create an Lscript(with Commander) which turns on "matte object" and sets alpha to "constant black".

Everything seems to go into the Commander window properly...When I run the Lscript, I get an error which states "unssenbyalphachannel expecting 0, found 1."

I realize that Lscript recognizes three different states for Alpha channel:

0= Surface settings
1= Unnaffected by object
2= Constant black

here's one of the Lscripts:

generic
{
MatteObject();
UnseenByAlphaChannel();
}

If I leave the parentheses empty, the Lscript works but switches to "unaffected by object"(choice 2). If I put any number in the parantheses, I get the error. Any Lscript experts with some advice. Thanks in advance.

Mike

evenflcw
03-06-2006, 07:54 PM
It might be that the lscript command just isn't working as it should. So do this instead:

CommandInput("UnseenByAlphaChannel 2");

This executes the same CS command LS Commander shows (before converting to lscript).

NanoGator
03-07-2006, 01:17 AM
The error you recieved basically means that function cannot accept arguments. I did a little testing and I'm sorry to tell you that you can only toggle with it. Even with a 1 or a 2 on the end, it still simply toggles. :/

adrencg
03-07-2006, 07:24 PM
The error you recieved basically means that function cannot accept arguments. I did a little testing and I'm sorry to tell you that you can only toggle with it. Even with a 1 or a 2 on the end, it still simply toggles. :/

Thanks for the help....Another barrier from LW. Not surprised.

Using "Command input" didn't work either.

Mike

Flashfire
03-07-2006, 08:09 PM
http://www.geocities.com/lw_flashfire/files/

There is an LScript there that does exactly what you are looking to do... while this doesnt help you solve your programming issue, it will of course do what you're looking to have done. The LScript is Selective Alpha, located at the bottom of the page.

Cheers!

evenflcw
03-07-2006, 09:06 PM
Using "Command input" didn't work either.

Well, it works here! The following script will set the Alpha Channel to Constant Black for all selected objects:

generic
{
CommandInput("UnseenByAlphaChannel 2");
}

NanoGator
03-07-2006, 09:15 PM
If you run that command again, it'll toggle back to where it was.

evenflcw
03-07-2006, 10:16 PM
Wierd. I assure you it doesn't do that by me. It sticks at Constant Black, nomatter if I run the script over and over. Oh well...

NanoGator
03-07-2006, 10:47 PM
Wierd. I assure you it doesn't do that by me. It sticks at Constant Black, nomatter if I run the script over and over. Oh well...

Really???

Hmm, maybe I shouldn't have said that so 'matter of factly'. Sorry, man. (I did tinker with it a bit, but I didn't do a wide range of tests...)

adrencg
03-10-2006, 08:49 PM
Well, it works here! The following script will set the Alpha Channel to Constant Black for all selected objects:

generic
{
CommandInput("UnseenByAlphaChannel 2");
}

That didn't work at all. How many different ways are there to write an lscript? Doesnyone know of a solid reference on the correct syntax to use. All i want to do is make a button that will turn an object's alpha setting on and off without having to go through the object panel.

I'm surprised there isn't one that does this already.

thanks for all the help.

Mike

Flashfire
03-10-2006, 09:57 PM
Okay... whatever has been stated above is NOT going to work.

In Commander, type the following:

SelectByName <Objectname> *
UnseenByAlphaChannel

*the parenthesis must be used, and you dont need .lwo extension on object name

Thats it, thats all... it does not toggle back and forth, even when loading new assets into Layout. Of course, this could be a PITA if you have MANY objects to occlude from the alpha...

Hope this helps ya

CGTalk Moderation
03-10-2006, 09:57 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.