[ New Plugin ] Remove Unused Masters Module
I have read quite a lot of posts in this forum about issues with large scene files due to Unused Master Objects and/or Shaders. To remove them you have to activate one or more menu items (e.g. 'Edit->Remove Unused Masters->Remove Unused Objects') Not very efficient or userfriendly.
This plugin will do it automatically, if you allow it. It sits in the background and waits for a signal that a instance of an object is removed from the tree of instances. It then checks all the masters ( objects, shaders, clips and sounds ) for having an instancecount of 0. Those, depending on your preferences, will all be removed with the exception of the 'Default master shader'. The default master shader is needed whenever you insert a new object or primitive.
The signal is send every time you delete an instance. Unfortunately the group/ungroup action also sends this signal. Internally Carrara probably uses copy+delete in a group/ungroup action. So be ware of this whenever you create a new master shader using the menu 'Edit->New Master Shader'. Make sure to apply it to an instance or this plugin will inadvertently remove it.
It's also possible to manually invoke the removal using the menu 'Edit->RuudL->Remove Unused Masters Module' or using the keyboard shortcut Ctrl+Alt+R on windows and Cmd+Option+R on a mac.
I don't expect that the menu or the shortcut will be used very often. It's intended use is right after you opened a previous saved scene files with unused masters.
The default setting is to remove Master Objects and Shaders only. Using the 'Remove Unused Masters Module' option in the File->Preferences menu you can set your own preferred setting. There is also an option to set it to manual activation ( disabling the automatic removal )
You can obtain the plugin from my SourcForge page: https://sourceforge.net/projects/carrara-plug-ins-adventures/files/
As usual place the 3 plugin files in the extension folder within the Carrara application.
At the moment only a macOS 64bit version is available ( I don't own an windows system yet, mayby later this year I'll buy one at the Black Friday sale. ) For those of you that don't want to wait and are capable of compiling c++ sourcecode, I made the sourcecode files also available on my SourceForge page.
It's Free Software under the GNU GPL v3 license.
Comments
thanks great Work .
moot point as I am on Windoze
but I am trying to figure out how this is different to the remove unused shaders, objects and clips we have
I am sure it is useful though the Mac users can tell us
First off, let me say that it is great that somebody made a plugin, and I'm sure it will come in handy for people. Hopefully it plays well with other plugins. That being said, I'm not that interested because that sounds like a great way to inadvertantly lose work, such as building a shader or clips. I would actually be more interested in having a key-combination to do those functions. Again, not a criticism, just my personal preferences.
Wendy, it sounds as if (depending on preferences) that if you simply delete an object from your Instances tab, it activates and automatically deletes the unused object, shader, sound, or clip. You can then avoid having to gp to the Edit menu and manually selecting what you wish to do.
@3drendero I'm familiar with virtualization. I have Parallels with Windows XP on my mac and occasionally use wineHQ. But I do need a windows computer for development and run tests with Carrara. I also want to use it as a rendernode.
@Khoe You're welcome. Are you using the plugin on Catalina?
@WendyLuvsCatz The issue with the removal of unused masters is the same on both Mac and Windows. This plugin is just a sort of garbage collector for usused masters.
@evilproducer Thank you for your feedback. As long as a shader is applied to an object, a clip is on the NLA track and a sound is on the sound track the plugin will not remove it. The best thing to do is to save the shader/clip to the browser tray. Soundfiles are just external files and Carrara only saves a link in the scene file. You can activate the plugin with a shortcut and it will honor your preference setting.
If you only want key-combinations for those functions you can do so using File->Preferences - Keyboard Shirtcuts - Application - Edit
Hi Ruudl,
Do you want me to provide a Windows version?
i used in Mojave and Catalina and Big Sur. most Time i work in Mojave (witht Paralles) in all system work good.
Yes, your help will be much appreciated. Thanks in advance!
If you are US based and have a decent budget for a new machine, there are some deals on the new AMD 7950X 16 core that kicks ass in all rendering benchmarks: https://wccftech.com/get-a-free-32-gb-ddr5-5600-kit-50-usd-off-am5-motherboards-purchase-amd-ryzen-7000-cpu-microcenter/ Also China has sales, but not yet in Europe, either for BlackFriday or after Christmas.
And how about the Boot-Camp ?? .Thanx
@3drendero and @ed3D thanks for the suggestions! I had already made up my mind on the computer model and make. I'm just waiting for a better deal. Hopefully at the SD-, BF- or CM- sale.
and You're welcome ~
Yes! Do a Windows version! I want this!
This is something that most 3d apps do automatically anyway. I want this for Carrara!!! Thanks RuudL!!!
At first I was thinking: "it doesn't also consolidate duplicate shaders?!!!" but we can already set that up as default in preferences, which I have - so I'm fine with that. I'm anxiously awaiting the Windows version of this!
Thanks @RuudL that's terrific and very kind
I finally managed to build a Windows version of the RemoveUnusedMastersModule. It's available for download on my SourceForge page: https://sourceforge.net/projects/carrara-plug-ins-adventures/files/
I also fixed a bug that left the Assembly Room inactive after switching back from one of the other rooms.
The Assembly Room module is also a 'Scene Document' module as are the 'Properties' and 'Hierarchy' modules on the right side of the window. To solve the issue I added the Assembly Room module to the Activate/Deactivate module class function.
A updated macOS version is also available for download. Please replace the previous plugin with this updated one on your installation.
I removed the source files from my SF-page. I'll rerelease them later after polishing it up a bit.
Awesome, thank you! :)
awesome thanks
fyi - your page's font is unreadable to me... luckily my mouse hover over got me the right file.. just thought I'd let you know.
Many thanks !!!
that's Sourceforge's layout
it would also depend on your settings and monitor I guess
You are all very welcome.
I hope you enjoy using the plugin as much as I did developing it.
@Stezza It's as Wendy said. It's SF's layout. I've zero control of it. From my own experience, there layout works best on large screens.
yep, no probs... my screen is only a 32" one I can't fit a bigger one on the desk lol
all good