Using OpScript to set light links isn't working

Using OpScript to set light links isn't working

huseila
Advocate Advocate
892 Views
3 Replies
Message 1 of 4

Using OpScript to set light links isn't working

huseila
Advocate
Advocate

Hi, I'm encountering a strange issue and I'm not sure if it's a problem with Katana or KtoA, so I've posted on both forums for help. I tried to set up a light link with OpScript, but it doesn't seem to work, and the attributes are behaving oddly. The 'offCEL' attribute only has a value set for the light I select, even though the OpScript is supposed to apply to both lights. However, even when the 'offCEL' attribute shows a value, the render result looks as if no light link was set up at all. I wonder if this is a bug or if I'm setting things up incorrectly. Any suggestions would be appreciated. Thanks.

0 Likes
Accepted solutions (1)
893 Views
3 Replies
Replies (3)
Message 2 of 4

tim.goransson6XTRC
Enthusiast
Enthusiast
Accepted solution

I think you might have to set the lightList attribute under `/root/world` instead of directly on the lights. I recently did something similar when creating light filters with an opscript. I'd check the katana workflow forums but looks like they are down. 

0 Likes
Message 3 of 4

tim.goransson6XTRC
Enthusiast
Enthusiast

what I did was I made a user parameter on the opscript where I add the lights, then when you GetOpArg that param it will be one big string. so you will have to process the string to turn it into a table of light locations you can loop over to get the information you need for the light list

0 Likes
Message 4 of 4

huseila
Advocate
Advocate

Hi Tim, thanks for the solution. It works when the opscript is applied on "/root/world". It required a slight adjustment to the code logic, but it definitely works.