PDA

View Full Version : Lightlink increasing file size


gagiu
04-03-2009, 10:57 AM
Hey!

I have a BIG issue with quite simple files that become huge due to multiple referencing or imports. Maya 2008 with sp1 is the version i use. The lighlinker bug is a very old problem that apparently was fixed in maya 5 but strangely enough, it surfaced in my files. I have searched the net for a fix and found 4 working scripts and a compiled tool that kind of fix the problem (files opened, imported, saved and exported in a seccond) BUT they generate another one...NOTHING would render..the light-linking gets completely disconnected.

It wouldn't be a problem to reconnect that by hand BUT when it comes to more files, well, i think some scripting would be very helpful. Here are a few examples of the lighlink nodes that get stored within the files (i saved the file in ASCII format although i use .mb):

connectAttr ":defaultLightSet.msg" "lightLinker1.lnk[13109].llnk";
connectAttr ":hyperGraphLayout.msg" "lightLinker1.lnk[13109].olnk";
connectAttr ":defaultLightSet.msg" "lightLinker1.lnk[13110].llnk";
connectAttr ":hyperGraphLayout.msg" "lightLinker1.lnk[13110].olnk";
connectAttr ":defaultLightSet.msg" "lightLinker1.lnk[13111].llnk";
connectAttr ":hyperGraphLayout.msg" "lightLinker1.lnk[13111].olnk";
connectAttr ":defaultLightSet.msg" "lightLinker1.lnk[13112].llnk";
connectAttr ":hyperGraphLayout.msg" "lightLinker1.lnk[13112].olnk";
connectAttr ":defaultLightSet.msg" "lightLinker1.lnk[13113].llnk";
connectAttr ":hyperGraphLayout.msg" "lightLinker1.lnk[13113].olnk";
connectAttr ":defaultLightSet.msg" "lightLinker1.lnk[13114].llnk";

and the list goes on and on and on (few thousands entryes)


and here are the scripts i have found (for their authors-see the links):
****************************************************
script 01
http://forums.cgsociety.org/archive/index.php/t-181747.html
***************************************************

string $xt_dos[] = `listConnections -s 1 -p 1 defaultObjectSet.message`;
for ( $invalue in $xt_dos ){
disconnectAttr defaultObjectSet.message $invalue;
}
string $xt_dls[] = `listConnections -s 1 -p 1 defaultLightSet.message`;
for ( $invalue in $xt_dls ){
disconnectAttr defaultLightSet.message $invalue;
}
string $xt_isg[] = `listConnections -s 1 -p 1 initialShadingGroup.message`;
for ( $invalue in $xt_isg ){
if($invalue != "initialMaterialInfo.shadingGroup"){
disconnectAttr initialShadingGroup.message $invalue;
}
}
string $xt_ipse[] = `listConnections -s 1 -p 1 initialParticleSE.message`;
for ( $invalue in $xt_ipse ){
disconnectAttr initialParticleSE.message $invalue;
}


script 02:
http://www.3dbuzz.com/vbforum/showthread.php?p=1442506
****************************************************



string $xt_dos[] = `listConnections -s 1 -p 1 defaultObjectSet.message`;
for ( $invalue in $xt_dos ){

}
string $xt_dls[] = `listConnections -s 1 -p 1 defaultLightSet.message`;
for ( $invalue in $xt_dls ){
}
string $xt_isg[] = `listConnections -s 1 -p 1 initialShadingGroup.message`;
for ( $invalue in $xt_isg ){
if($invalue != "initialMaterialInfo.shadingGroup"){
disconnectAttr initialShadingGroup.message $invalue;
}
}
string $xt_ipse[] = `listConnections -s 1 -p 1 initialParticleSE.message`;
for ( $invalue in $xt_ipse ){
}



script 03:
http://forums.cgsociety.org/archive/index.php/t-258889.html
*********************************************


global proc cleanUpLightLinker()
{
string $destinations[] = `connectionInfo -dfs hyperGraphLayout.msg`;
string $dst;

print ("\n\n--------- Cleaning up hyperGraphLayout Connections -----------\n");
for ( $dst in $destinations )
{
disconnectAttr hyperGraphLayout.msg $dst;
}
print ("\n\n--------- Cleaning up initialShadingGroup Connections -----------\n");
$destinations = `connectionInfo -dfs initialShadingGroup.msg`;
for ( $dst in $destinations )
{
disconnectAttr initialShadingGroup.msg $dst;
print("Disconnected initialShadingGroup and " + $dst + "\n");
}
print ("\n\n--------- Cleaning up initialParticleSE Connections -----------\n");
$destinations = `connectionInfo -dfs initialParticleSE.msg`;
for ( $dst in $destinations )
{
disconnectAttr initialParticleSE.msg $dst;
print("Disconnected initialParticleSE and " + $dst + "\n");
}

print ("\n\n--------- Cleaning up defaultLightSet Connections -----------\n");
$destinations = `connectionInfo -dfs defaultLightSet.msg`;
for ( $dst in $destinations )
{
disconnectAttr defaultLightSet.msg $dst;
print("Disconnected defaultLightSet and " + $dst + "\n");
}
print ("\n\n--------- Done -----------\n\n");
};



script04:
(can't find the author, sorry)


{
string $destinations[] = `connectionInfo -dfs hyperGraphLayout.msg`;
string $dst;
for ( $dst in $destinations ) {
disconnectAttr hyperGraphLayout.msg $dst;
}
$destinations = `connectionInfo -dfs defaultLightSet.msg`;
for ( $dst in $destinations ) {
disconnectAttr defaultLightSet.msg $dst;
}
}


Any help would be greatly appreciated!

kind regards
gagiu

DOor
04-06-2009, 06:41 PM
im not sure I understand what you want to do. do you want something that reconnects the default light links? or are you planning on modifying one of the scripts to detach the links then reconnect them after something has been exported?

sivanny
04-06-2009, 10:10 PM
Maya has an unsupported script that might help remove those extra links:
runTime/scripts/unsupported/cleanUpSpuriousLightLinks.mel

If you have this kind of connection bloat in the child references as well, you might need to run it on those files separately.

CGTalk Moderation
04-06-2009, 10:10 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.