[ New Plugin ] Remove Unused Masters Module

RuudLRuudL Posts: 193
edited November 2022 in Carrara Discussion

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.

 

PreviewScreenSnapz005.png
637 x 317 - 130K
PreviewScreenSnapz006.png
581 x 531 - 100K
PreviewScreenSnapz007.png
774 x 333 - 92K
Post edited by RuudL on

Comments

  • 3drendero3drendero Posts: 2,024
    Thanks, looks great, can't wait for the Windows version. Unless you really need a second computer, there are multiple options to run Windows on Mac. Here is a list: https://machow2.com/best-way-run-windows-mac/ While they recommend Parallells, the VMWare Fusion Player is free for personal use.
  • KhoeKhoe Posts: 312

    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 yes the Mac users can tell us wink

  • 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. 

  • RuudLRuudL Posts: 193
    edited November 2022

    @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

    PreviewScreenSnapz005.png
    583 x 534 - 117K
    Post edited by RuudL on
  • RuudL said:

     

    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.

     

    Hi Ruudl,

    Do you want me to provide a Windows version? 

  • KhoeKhoe Posts: 312
    edited November 2022

    RuudL said:

    @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

    i used in Mojave and Catalina and  Big Sur. most Time i work in Mojave (witht Paralles) in all system work good.

    Post edited by Khoe on
  • RuudLRuudL Posts: 193

    Philemo_Carrara said:

    RuudL said:

     

    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.

     

    Hi Ruudl,

    Do you want me to provide a Windows version? 

    Yes, your help will be much appreciated. Thanks in advance!

  • 3drendero3drendero Posts: 2,024
    edited November 2022

    RuudL said:

    @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.

    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.

    Post edited by Richard Haseltine on
  • 3drendero3drendero Posts: 2,024
    Then there is a laptop with the 16 core desktop CPU 5950x downclocked to 88W, a bit slower than a desktop, takes no space. https://www.xmg.gg/xmg-apex/
  • ed3Ded3D Posts: 2,187

    3drendero said:

    Thanks, looks great, can't wait for the Windows version. Unless you really need a second computer, there are multiple options to run Windows on Mac. Here is a list: https://machow2.com/best-way-run-windows-mac/ While they recommend Parallells, the VMWare Fusion Player is free for personal use.

    And  how  about  the  Boot-Camp ??   .Thanx 

  • RuudLRuudL Posts: 193

    @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.

  • ed3Ded3D Posts: 2,187

    RuudL said:

    @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   ~ 

  • DartanbeckDartanbeck Posts: 21,569

    Philemo_Carrara said:

    RuudL said:

     

    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.

     

    Hi Ruudl,

    Do you want me to provide a Windows version? 

    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!!!

  • DartanbeckDartanbeck Posts: 21,569

    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!

  • HeadwaxHeadwax Posts: 9,987

    Thanks @RuudL that's terrific and very kind

  • RuudLRuudL Posts: 193
    edited January 2023

    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.

    Post edited by RuudL on
  • JonstarkJonstark Posts: 2,738

    Awesome, thank you!  :)

  • StezzaStezza Posts: 8,061

    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. wink

  • Bunyip02Bunyip02 Posts: 8,613

    Many thanks !!!

  • WendyLuvsCatzWendyLuvsCatz Posts: 38,213

    Stezza said:

    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. wink

    that's Sourceforge's layout

    it would also depend on your settings and monitor I guess 

  • RuudLRuudL Posts: 193

    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.  

  • StezzaStezza Posts: 8,061

    yep, no probs... my screen is only a 32" one I can't fit a bigger one on the desk lol

    all good yes

Sign In or Register to comment.