LightLinking Bug removal with MEL??

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 09 September 2007   #1
LightLinking Bug removal with MEL??

I've came across a Maya bug that makes lots of connections between the "initialShadingGroup" node and the "lightLinker1" node.
it slows the file down alot while saving and it's basically trash connections that I don't need.
I'va already asked this in another Thread but I thought it would be better to link to it here too.

Maybe one of the Mel wizards here can help me with a script that breaks these connections??

any help is much apriciated,
thanks in advance.

-Mina
__________________
 
Old 09 September 2007   #2
Try this out:


global proc RemoveUnusedLightLinkers()
{
	 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;
	 	}
}
__________________
mike hovland
lead technical artist
Robomodo

Life beats down and crushes the soul... art reminds you that you have one. - Stella Adler
 
Old 09 September 2007   #3
Thanks alot... First test off this works fine.
I tried it on an empty file that got the error and it worked just fine.
one thing though... it disconnected even all the light links... wich in an empty file is considerably an unused light link
I'll do another test and come back here

thanks again this is really a promising solution

-Mina
__________________
 
Old 09 September 2007   #4
thanks mhovland
I commented out most of the code... left only the parts I needed..
now it solves the problem without disconnecting everything.
I added to lines at the end that adds the default connections again.

thanks alot, my problem is now solved.
Quote: global proc RemoveUnusedLightLinkers()
{
// 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;
// }
}
RemoveUnusedLightLinkers;
connectAttr -f initialShadingGroup.message lightLinker1.link[0].object;
connectAttr -f initialShadingGroup.message lightLinker1.shadowLink[0].shadowObject;
//
//
//
print ("//LightLinks Fixed ");
__________________
 
Old 09 September 2007   #5
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 12:02 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.