Hi all, this is my first post. This blog is pretty new and actually there is nothing more than the standard wordpress installation. Things will change a lot in the next future.
Let’s start with the first post.
Few days ago i discovered a bug in Maya, well not the only one, and i figured out how to fix it. I know it’s quite famous bug but Autodesk didn’t solve it. So in the meanwhile i decided to find a way to get around it.
The scenario i simple. You have a scene with some reference in it and some light. It’s something quite common. Now if some of these lights have a lightlink to one of these referenced objects and you try to delete just one of those lights and then try to save the scene maya will crash. Funny not? Moreover maya will also totally wipe the file you are trying to save. These could mean only one thing, everyone who is working on that scene will probably lose some work.
The easiest workaround is to hide that light and keep working on a scene with some useless hidden light. Nothing too bad but absolutely not clean.
What i discovered is that if I unreference the lightlinked object and then delete the light it will let maya save the file without any crash.
Obviously if you got hundreds of referenced objects and those are also rigged characters or environments this workaround will take some time to understand what to unload. Moreover unloading references, deleting the light and then reloading the reference will take some time, more than just deleting a light!
First of all we have to understand what the light is linklinked to. To do that whe should provide a function that given a light will tell us which reference is lightlinked to. This is quite simple asking what objects are lightlinked with “lightlink” command and then looping thru them asking if the object is part of a reference with the referenceQuery command.
After that we should store a list of reference nodes, unload those references, delete the light and then reload the references.
This script will avoid maya crash. That’s pretty good but is not sufficient to prevent people to delete lights and it will be much slower than just deleting a light. So it’s better to figure out a better way to let people work like they used to do until the introduction of this new featured bug.
In the next post i will manage a way to overrinde the delete function just for lights using callbacks and use a temporary hidden group to delete the lights when saving or loading the scene.