PDA

View Full Version : Light Linking Problem/Bug


EightBit
12-22-2011, 04:45 PM
I discovered a problem where I can't unlink a light from my objects.
In the light linker, it is not connected to any objects. When I test using 'lightlink' query on an object, the object has no lights affecting it. If I use the Lighing/"Select Objects Illuminated by Light" command, the objects are not selected. However the light affects all my geometry unless I specifically set its intensity to 0 or turn off its visibility. When I add new lights to the scene and unlink them from all the objects, the lightlinking is not obeyed.
The only fix I can think of is to use layer overrides to control the visibility, but that creates a new set of problems.
Perhaps I am missing something, or perhaps something is corrupt - anyone have insight into this problem?
Thx.

EightBit
12-22-2011, 08:48 PM
...4 hours later...
I don't know if its unique to my scene or Maya in general, but I found a fix, which is that unless the lite is linked to an object's shading group, the object can't be unlinked from the light, even if all queries show that there are no lites linked to the object, it will be affected by lites that become corrupted like this. I don't have any idea how it got this way in the first place.
Code summary:# START w/lite linked to all meshes, and corresponding shadingGroups
# Unlink SG, still renders:
cmds.lightlink( b = 1, light = 'univLite03', object = "exterior_white_SG"

# Unlink objs. Query shows no linking. Objs are unhilited in lightLinker but still renders. Corrupt state. SOL at this point.
cmds.lightlink( b = 1, light = 'univLite03', object = "exterior_white_SG" )

# Link SG. Objs are hilited in lightLinker. Query shows connection. Obj still renders. Restored state.
cmds.lightlink(light = 'univLite03', object = "exterior_white_SG" )

# Unlink objs. Query shows no linking. Objs are unhilited in lightLinker. Obj doesn't render.
cmds.lightlink( b = 1, light = 'univLite03', object = "exterior_white_SG" )

nookie
12-23-2011, 01:23 AM
I'm experiencing similar problems in Maya 2011 (especially with references in the scene).
My workaround is to uncheck the "Illuminate by default" checkbox on the light and re link only the objects I want to be lit by that light.
You can also try to open the hypergraph and delete the connection to the default light set (or something similar, no Maya in front of me right now :) )

withego
12-23-2011, 04:03 AM
I'm experiencing similar problems in Maya 2011 (especially with references in the scene). My workaround is to uncheck the "Illuminate by default" checkbox on the light and re-link only the objects I want to be lit by that light. You can also try to open the hypergraph and delete the connection to the default light set (or something similar, no Maya in front of me right now :) ) Mitch the workaround suggested by Luca in the previous reply, should solve your problem...:thumbsup:

I strongly suggest you to avoid using the Hypergraph Editor panel to link or un-link objects to lights, or viceversa and use the Relationship Editor panel instead.

With the "Light centric light linking" option enabled from the Relationship Editor drop down menu, as displayed by the next few screenshots...

Extracted from the "DAYSKYPHOTO_PEOPLE_HAIRS_2011" Acrobat Portfolio.pdf doc, recently uploaded to the main Tutorial Guide's thread:

http://www.samui3d.com/Light_Linker_0_800.jpg

Link to the high rez version:

http://www.samui3d.com/Light_Linker_0.jpg

http://www.samui3d.com/Light_Linker_1_800.jpg

Link to the high rez version:

http://www.samui3d.com/Light_Linker_1.jpg

http://www.samui3d.com/Light_Linker_2_800.jpg

Link to the high rez version:

http://www.samui3d.com/Light_Linker_2.jpg

Hope it helps...

Ciao.

"I know it seems hard sometimes, but remember one thing... Through every dark night, there's a bright day after that... So no matter how hard it get, stick your chest out, keep ya head up... and handle it.

EightBit
12-23-2011, 08:06 AM
Thanks for the replies.
@luca
I had references in the scene, but that became so problematic that I imported everything, so now my scene is over 300MB. Perhaps referencing is related to the problem. I'll check to see if 'illuminate by default' helps the situation.
@alex
I've only been using the relationship editor and python to make changes - python being the fastest. Here is a set of rules that seem to work in the light-centric Relationship Editor:
Rule: Unlink objects when lite is linked to its shadingGroup, else they remain linked. Even if querying them shows no lights are linked they continue to light the object.
IE:
If obj is linked while SG is unlinked, it cannot be unlinked until the SG is linked. It may appear unlinked, but it will remain lit by the lite.

Further, if multiple lights are selected in RE, they can be linked to a SG all at once, but linking/unlinking objects/hierarchies will only work on one of the selected lights.

withego
12-23-2011, 11:18 AM
Mitch in my previous reply forgot to remind you that when using the Relationship Editor panel, to link or un-link objects and ShadingGroups to lights or viceversa...

Always need to refresh the Relationship Editor panel a few times to make sure that it will finally respect the custom light linking between objects, ShadingGroups and lights.

Mostly when disabling and re-enabling the light "Illuminates by Default" switch, btw since you are dealing with the infamous "Light Linker" node...

Please don't forget to disable the "Export Light Linker" option, located under the Render Settings panel Options > Translation > Customization tab.

I usually avoid using the File referencing features whenever possible, because I hate "namespaces" and "parent/child nomenclature" stuff:

File referencing tips (http://download.autodesk.com/global/docs/maya2012/en_us/files/File_referencing_File_referencing_tips.htm)

Since the File referencing features are quite "tricky", therefore they add a huge amount of complexity to the scenes and as suggested by the main Autodesk online help docs...

They should be used for collaborative productions where multiple users need to work concurrently and share various assets, in scenes with complex hierarchical structures.

Ciao.

Alex

"I know it seems hard sometimes, but remember one thing... Through every dark night, there's a bright day after that... So no matter how hard it get, stick your chest out, keep ya head up... and handle it.

EightBit
02-07-2012, 10:16 PM
I revisited this issue today. A followup:
As of 2012 SAP SP1, select a lite parent in the Light Centric Relationship Editor, click to deselect the Shading Groups (SG) that are to be unlinked and it will unlink all of the child lites. This will also unlink all of the objects that use the (now deselected) SG. Drag/select in Relationship Editor is a bit funky, so don't drag too far in a single action.
Presumably this will work with the lites directly selected, but the parent feature is very convenient.

CGTalk Moderation
02-07-2012, 10:16 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.