Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
this script is for merging lots of namespaced shaders in your scene, in case you have many instances of the same object with shaders included. in this kind of situation, maya's built-in "remove duplicate shading networks" doesn't always work, so this is a workaround.
only shaders that are named exactly the same (aside from the namespacing) will be considered duplicates.
to use: just put the MEL in your scripts folder and run "hfCleanShaders;" if you want to exclude any shaders from the process, just select them before running the script
usage notes: the script automatically removes unused nodes after merging the shaders... it's best to import objects from reference before you run this script so that this can happen.
if you enabled sharing shading networks between references, mental ray materials in your scene may break due to the cleanup operation. you should disable node sharing in your scene before importing from references if you're going to use this script.
please report any bugs or comments to henry@toadstorm.com
Please use the Bug System to report any bugs.
Please use the Feature Requests to give me ideas.
Please use the Support Forum if you have any questions or problems.
Please rate and review in the Review section.