View Full Version : lighting linking trasfer to other scenes

08 August 2004, 03:54 PM
is there any way that i can "capture" the scenes all Light Linking information
and then "paste" onto another scene with exactly same objects ?

08 August 2004, 05:48 PM
Have you tried to export (file>exportSelected) the light from the base scene to the other one?

08 August 2004, 06:42 PM
i cant do that becus my target scene has new animations on the lights
(don't ask me to copy the animtion curves to the source scene, becus the target scene has the most update models, rigs, animations.)

any ideas?

08 August 2004, 10:38 AM
Does the lights and the linked objects have the same names in the two scenes ? If ye,s I could help you creating a script to transfer linking infos.
Are you more or less good at melscripting? What's your level?

08 August 2004, 11:52 AM
So here the script I've writen for you. How to use it? Open the old scene, select lights you want to transfer to links (select only lights). Then run this script. This script writes another script (quite smart) built from the old scene selected lights links info. Copy this script (Ctrl+C), then open the new scene, paste the script in the script editor and run it.

Extra notes : for unknow reason, the writen script is printed twice. So do copy only one. The script is secured, but as I said, the new scene must have exactly the same lights and objects names.

// helps to transfer light linking from a scene to an other (light centric method)
// Writes a script to be run in the second scene then.

print("\n\nSelected lights links parsing computing.\n\n\n");

string $lightLinkingScriptString;
string $selection[] = `ls -sl`;

$lightLinkingScriptString += ("//--- Lights links script string START.\n\n");

for($light in $selection) {

// Could check if the selection type is right light (something like if(type == light) {})

string $lightLinkedObjects[] = `lightlink -query -light $light`;

$lightLinkingScriptString += ("// " +$light+ " light links.\n");
$lightLinkingScriptString += ("if(`objExists " +$light+ "`) {\n\n");

for($lightLinkedObject in $lightLinkedObjects) {

$lightLinkingScriptString += ("\tif(`objExists " +$lightLinkedObject+ "`) {");
$lightLinkingScriptString += ("lightlink -make -light " +$light+ " -object " +$lightLinkedObject+ ";}\n");
$lightLinkingScriptString += ("}\n\n");

$lightLinkingScriptString += ("//--- Lights links script string END.\n\n\n");

print("\n\nSelected lights links parsing finished. Copy the script below in the script editor.");
print $lightLinkingScriptString; // Damn, it copys the string twice
// Could reuse $lightLinkingScriptString string variable in a file stream

08 August 2004, 12:12 PM
YOU ARE SUPERB!!!!!!!!!!!!!!!!!!
THANKS X 100000000000:thumbsup:

08 August 2004, 01:28 PM
Glade it helps you a lot ;)
I'm just wondering, everything works well, no problem? (cause I've not tested it)

CGTalk Moderation
01 January 2006, 10:00 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.