i created this addon for @GloriaTheAnimat to speed up applying of modifiers on objects that have shapekeys. I updated the addon today and thought i should also post it here, to make it more accessible.
This Addon adds 3 new operators which can be found in via the Quick Search floater ( **Hotkey: F3) and typing âshapekeyâ or anything else in the names listed below:
Sk: Apply All Modifiers (Keep Shapekeys)
Applies all modifiers on the object
Sk: Apply Subdivision (Keep Shapekeys)
Applies only the top most subdivision modifier and keeps the others
Sk: Apply Chosen Modifiers (Keep Shapekeys) (Added in this update [version 1.2])
Shows a popup with all modifiers on the object and only applies those you select
Might lead to unexpected behaviour if you choose to apply modifiers that arenât at the top of the modifier stack
Select the Object you want to apply modifiers to and select one of the options.
It also add 3 menu entries to the 3DViews >> Object Menu:
This thread needs to get some traction. I already dowloaded it from Gumroad and shared it on my socials. Letâs see how people like this one.
Thank you for arranging this code.
Cheers!
*** UPDATE ***
THANKS! This addon should be default on Blender. It works fantastically.
Unlike the other script that tries to do the same thing, this one actually works well!
In comparison, the other script took nearly two hours, and did not recombine in the end.
This script took 19 minutes and worked perfectly.
It worked on my complex skeletal mesh with over 400 shape keys.
Based on its behavior, this appears to be a very well written script instead of a hack.
I am not a python programmer so i cannot analyze the code, but based on the way it works and interacts with Blender, it has my vote to be added to the core Blender release.
Thank you very much for making and releasing this open source tool!
Unfortunately, i have either hit the limitations of the plugin, or my system itself.
i9 32gigs ram
When i run the model through with the base 450 shape keys, everythings works great!
When i run it through with all the shape keys, 691 of them, it crashes about 3/4 of the way through.
Now to eliminate a possible errant shape key, i have broken the 691 shape keys in to 3 sections and tested 1/3 at a time. each 1/3 section works fine, but combined, it hard crashes out of blender. I thought maybe it had something to do with auto save, so i disabled that. no change. The thought just occured to me, maybe it has to do with my Undo level allowances. i will decrease undo level limits and try again. I will report back here soon.
Thanks again for the plugin, it is amazing!
I really think this is probably more of a system issue than the plugin itself.
Sadly, disabling Global undo, and setting undo history to just 2 had no effect. If anyone has any ideas, they would be appreciated.
This is the only error message i have been able to track down.
Error : Unrecognized Exception
Address : 0x00007FF92B9DD759
Module : C:\Windows\System32\KERNELBASE.dll
Thanks again for your input! Wow, thatâs a lot of shapekeys. Since the addon currently creates a copy of your object for every shapekey and then has to apply the modifier to it and then merges them all back into one object i think your assumption that this is now a case where your hardware limits you is correct. In your case the addon tries to create 691 copies of your mesh and then applies their modifiers (potentially subdivision surface). That would result in an absurd number of polygons.
(You could confirm this suspicion by looking at your RAM usage in Windows Task Manager, while executing the addon)
To make this case work on your Hardware the code of the addon would have to be changed.
All the shapekeys would have to be built after each other instead of simultaneously or they could be built in chunks (i.e only 100 shapekeys at a time) until all 691 have been reached.
I wrote the code pretty quickly and didnât assume somebody would actually have a case where they had that many shapekeys.
Maybe i have some time this weekend to look over the code again and make some adjustments.
Yes, it uses all 32gigs of ram, at which point it seems to start adressing virtual memory, but eventually fails, regardless. Yes indeed it is an absurd numer of polygons, but it will actually be more in the end! It is for characters/monsters so i have to do this procedure for many different models. It is for a character/monster creator i am making. After the shape keys are set by the user, they are baked and removed so runtime memory will be minimal.
Thank you again for making this. It is a daunting task already, and much more so without your script.
I just had a look and made some changes to the code. I wrote a new Operator that is now also available in the object menu of the 3DView right next to the others. Apply All Modifiers (High-Performance)
This operator now works through the shapekeys one after the other. This means there will not be as many copies of your model as there are shapekeys on them during execution. Instead there will be only a maximum of 3 copies during script execution time.
I did a small test / benchmark:
Normal Operator:
Mesh faces: 14,336
Shapekeys: 300
Max RAM Usage: 1.2 GB
Execution Time: 45 seconds
That is amazing! Thank you! previously with the 600+ shape keys the time exceeded 25 minutes and RAM/Swap file usage exceeded 64GB at which point the failure occurred.
Now, with the same set of 600+ shape keys on the complex character mesh, time to successful completion is ~4.5 minutes, and RAM usage never exceeds a few hundred MBs!
A note to others⌠On completion, if you select wireframe view it gives the illusion that nothing was done (it shows the wireframe count of the original model, not the subdivision that was applied). This is, as far as i can tell, a Blender issue and has nothing to do with this amazing script. if you simply tab over to edit mode, the proper subdivided model display will appear. It was already subdivided, and appears as such with solid rendering view. all that switching to edit mode does is force a refresh of the displayed view.
Thank you again for creating and sharing this @nidus . Truly a sanity, and project saver!
Considering its amazing successful performance with your latest changes, are you considering adding a high performance option that applies only the subdivision but leaves the other modifiers untouched?
Thank you for testing! Iâm glad itâs working fine now. I didnât want to bother updating the other operators until I had the feedback from you, that itâs working. It seems like the new code performs well even under heavy load.
I took the time to update all other operators to work the same way as the âHigh Performanceâ one and pushed a new release (v1.6) to all platforms the addon is currently available on.
SKkeeper v1.6:
Operator names are back to the way they were in version 1.4
I also looked over the code again and improved it a little bit more, so it should be even faster now!
(The execution time in my testcase, that i posted above dropped from 27 seconds down to 18 seconds)
The display bug with the Optimal Display view of the Subdivision Modifier staying around after collapsing the modifiers has been fixed.
I am sure you are aware of this link Blender plugin submission information, but your plugin is so important and working so well, i wanted to share it just to be sure.
A sincere thank you, and best wishes!
Great addon. Too bad that it doesnât work properly on a mesh with an armature (it gets heavily deformed).
Iâm illiterate when it comes to this so i hope u dont mind me asking the following question. Is it possible to make this addon work on a mesh with an aramture?
Edit: Forget what I said. Stupid me forgot to reset the transformation of each bone before using the addon. Great stuff man, you are a life saver.
Iâm so glad this exists! I had to delete half my model and give it a mirror modifier to resymmetrize my weight paints after I messed those up, and while I donât have 600 shapekeys, this will be a LOT faster than saving each shape key as a separate object, applying the mirror modifier, and then joining each object back to the base mesh as a shapekey.
Hello! Thank you so much for releasing this addon, and I canât say enough about how useful it is! I did have one question though. I canât seem to apply the skin modifer properly.
It does seem to apply the modifer, and make the duplicate mesh, but it doesnât remerge them as shapekeys. Instead it gives this error, and then leaves three meshes, 2 with no modifers or shape keys, and 1 with a modifer and shapekeys.
âline 235, in execute receiver.data.shape_keys.key_blocks[i].name = sk_names[i]
AttributeError: âNoneTypeâ object has no attribute âkey_blocksââ
I was just wondering if I was doing something wrong, or if applying the skin modifer wasnât supported. Thank you for your hard work on the add-on!
I did some tests and found that if you are using the mirror modifier and accidentally merge some vertices in the middle while using the âClippingâ option it generates this problem of creating 2 messed up meshes as you said.
As soon as I removed the vertices that were merging it just gave me 1 mesh with everything applied as it should be correctly.
Iâm still doing some tests for see what else can give us this error.