I came across this MEL script for breaking glass in maya called Knapper_UI – simply drag and drop the mel file in maya to run or copy it to your script folder, open maya, open script editor, type knapper_UI. Download the script here.
lesterbanks
3D, VFX, design, and typography. Twenty year veteran instructor in all things computer graphics.
Related Posts

A Complete Guide to Walk Cycle Animation
lesterbanksApril 30, 2024

How to Mix Two Displacement Maps With Maya MaterialX Graph
lesterbanksApril 26, 2024

An Introduction to MaterialX Data Model in Maya LookdevX
lesterbanksApril 11, 2024
thanks, got it fixed.
ok, got the script running but how does it work?
Hi Yonni,
Once you bring up the UI, you fist make a template, and then break it – so in the knap_base tab you can change some of the template settings and hit the template button, then move over to the knap_flaw tab and hit the KnappeR button to run the script that breaks everything apart. Here is the thing though – when i tried it on maya 2009 on a mac, the window wasn’t big enough in the knapper UI to show all the buttons – it seemed to work fine in 2011 however (minus the tiny extra tab from the new maya api changes).
Once you have everything built, open up the outliner and poke around, there are some settings that you can play with in the channel box from the different created components.
hope this helps!
-lxb
in my Maya 2008 Mac version, where the Knapper UI window was too small – as Dontnoun suggested – on line 18, I typed the following in Smultron, my code editor:
window -e -s 1 knaper_UI;
this was supposed to make the window expandable. instead, Maya gave me an error saying Knapper wasn’t found.
however, I discovered when I replaced it with the original code:
window -widthHeight 260 212 -s 1 -title “[gls knapper]” $GK;
not only was the MEl script recognized when I dragged and dropped it in, but also the window was suddenly big and expandable, and I was able to see the Template button.
I still haven’t gotten the rotate function to work. when I follow Dontnoun’s instructions to the tee, the group is shattered from the beginning as a result.
I also have no clue how to get past the cracked to the explosive shattered stage as when the skeleton runs through the glass. is this physics? particle effects?
got the rotation to work.
I finally realized I had to click off of the group to see the shatter effect again… d’oh!
I’m still in the dark about explosively shattering the glass outwards though.
Hopefully someone can answer this as I have the same issue, the glass looks very real and I’d like to use this method for shattering the glass. I can also only get to the rotate stage. I have tried to get the glass to animate as an explosion by adding fields in maya and rigid bodies, however it really dogs my top of the line system which shouldn’t really be happening this bad on a new 12 core mac. Any solutions / tips would be fantastic thanks for this.